/* 
 * Navigation Responsive Improvements
 * 
 * This file provides enhanced responsive navigation support
 * with standardized 1024px breakpoint and improved mobile experience
 */

/* ========================================
   MOBILE NAVIGATION IMPROVEMENTS
   ======================================== */

/* Mobile navigation container */
@media (max-width: 1023px) {
  .navmenu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(33, 37, 41, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .mobile-nav-active .navmenu {
    opacity: 1;
    visibility: visible;
  }

  /* Mobile navigation menu */
  .navmenu ul {
    position: absolute;
    inset: 60px 20px 20px 20px;
    background-color: var(--nav-mobile-background-color);
    border-radius: 12px;
    padding: 10px 0;
    margin: 0;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Mobile navigation items */
  .navmenu ul li {
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navmenu ul li:last-child {
    border-bottom: none;
  }

  /* Mobile navigation links */
  .navmenu ul li a {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 10px 20px;
    color: var(--nav-dropdown-color);
    font-family: var(--nav-font);
    font-size: 17px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: transparent;
  }

  .navmenu ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--nav-dropdown-hover-color);
  }

  /* Mobile dropdown indicators */
  .navmenu ul li a i.bi-chevron-down {
    font-size: 14px;
    transition: transform 0.2s ease;
    color: var(--accent-color);
  }

  .navmenu ul li.dropdown.active > a i.bi-chevron-down {
    transform: rotate(180deg);
  }

  /* Mobile dropdown menus */
  .navmenu .dropdown ul {
    position: static;
    display: none;
    background-color: rgba(255, 255, 255, 0.05);
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    max-height: none;
    overflow: visible;
  }

  .navmenu .dropdown.active > ul {
    display: block;
  }

  .navmenu .dropdown ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .navmenu .dropdown ul li a {
    padding-left: 40px;
    font-size: 14px;
    background-color: rgba(255, 255, 255, 0.02);
  }

  .navmenu .dropdown ul li a:hover {
    background-color: rgba(255, 255, 255, 0.08);
  }

  /* Nested dropdowns */
  .navmenu .dropdown .dropdown ul {
    background-color: rgba(255, 255, 255, 0.03);
  }

  .navmenu .dropdown .dropdown ul li a {
    padding-left: 60px;
    font-size: 13px;
  }

  /* Mobile navigation toggle */
  .mobile-nav-toggle {
    display: block;
    color: var(--nav-color);
    font-size: 24px;
    line-height: 0;
    margin-right: 10px;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 9999;
    position: relative;
  }

  .mobile-nav-active .mobile-nav-toggle {
    color: #fff;
    position: fixed;
    top: 20px;
    right: 20px;
    margin-right: 0;
    z-index: 9999;
  }

  /* Mobile navigation active state */
  .mobile-nav-active {
    overflow: hidden;
  }

  .mobile-nav-active body {
    overflow: hidden;
  }
}

/* ========================================
   TABLET NAVIGATION IMPROVEMENTS
   ======================================== */

@media (min-width: 1024px) {
  .navmenu {
    padding: 0;
  }

  .navmenu ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    gap: 0;
  }

  .navmenu li {
    position: relative;
  }

  .navmenu a,
  .navmenu a:focus {
    color: var(--nav-color);
    padding: 15px 12px;
    font-size: 14px;
    font-family: var(--nav-font);
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: 0.3s;
    min-width: 0;
  }

  .navmenu a i,
  .navmenu a:focus i {
    font-size: 10px;
    line-height: 0;
    margin-left: 3px;
    transition: 0.3s;
  }

  .navmenu li:hover > a,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-hover-color);
  }

  /* Tablet dropdown menus */
  .navmenu .dropdown ul {
    margin: 0;
    padding: 8px 0;
    background: var(--nav-dropdown-color);
    display: block;
    position: absolute;
    visibility: hidden;
    left: 10px;
    top: 120%;
    opacity: 0;
    transition: 0.3s;
    border-radius: 6px;
    z-index: 99;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
    list-style: none;
    min-width: 180px;
  }

  .navmenu .dropdown ul li {
    min-width: 180px;
    list-style: none;
  }

  .navmenu .dropdown ul a {
    padding: 8px 15px;
    font-size: 13px;
    text-transform: none;
    color: var(--nav-dropdown-color);
  }

  .navmenu .dropdown ul a i {
    font-size: 10px;
  }

  .navmenu .dropdown ul a:hover,
  .navmenu .dropdown ul .active:hover,
  .navmenu .dropdown ul li:hover > a {
    color: var(--nav-dropdown-hover-color);
  }

  .navmenu .dropdown:hover > ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
  }

  /* Nested dropdowns on tablet */
  .navmenu .dropdown .dropdown ul {
    top: 0;
    left: 100%;
    visibility: hidden;
  }

  .navmenu .dropdown .dropdown:hover > ul {
    opacity: 1;
    top: 0;
    left: 100%;
    visibility: visible;
  }

  /* Hide mobile toggle on tablet */
  .mobile-nav-toggle {
    display: none;
  }
}

/* ========================================
   DESKTOP NAVIGATION IMPROVEMENTS
   ======================================== */

@media (min-width: 1024px) {
  .navmenu {
    padding: 0;
  }

  .navmenu ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
    width: 100%;
    justify-content: flex-start;
    gap: 0;
  }

  .navmenu li {
    position: relative;
  }

  .navmenu a,
  .navmenu a:focus {
    color: var(--nav-color);
    padding: 23px 15px 18px 15px;
    font-size: 16px;
    font-family: var(--nav-font);
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: 0.3s;
    min-width: 0;
  }

  .navmenu a i,
  .navmenu a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
    transition: 0.3s;
  }

  .navmenu li:last-child a {
    padding-right: 0;
  }

  .navmenu li:hover > a,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-hover-color);
  }

  /* Desktop dropdown menus */
  .navmenu .dropdown ul {
    margin: 0;
    padding: 10px 0;
    background: var(--nav-dropdown-background-color);
    display: block;
    position: absolute;
    visibility: hidden;
    left: 14px;
    top: 130%;
    opacity: 0;
    transition: 0.3s;
    border-radius: 8px;
    z-index: 99;
    box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.1);
    list-style: none;
    min-width: fit-content;
    width: fit-content;
    flex: none !important;
    max-width: none !important;
  }

  .navmenu .dropdown ul li {
    min-width: fit-content;
    width: 100%;
    list-style: none;
  }

  .navmenu .dropdown ul a {
    padding: 10px 20px;
    font-size: 15px;
    text-transform: none;
    color: var(--nav-dropdown-color);
    width: 100%;
    display: block;
  }

  .navmenu .dropdown ul a i {
    font-size: 12px;
  }

  .navmenu .dropdown ul a:hover,
  .navmenu .dropdown ul .active:hover,
  .navmenu .dropdown ul li:hover > a {
    color: var(--nav-dropdown-hover-color);
  }

  .navmenu .dropdown:hover > ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
  }

  /* Nested dropdowns on desktop */
  .navmenu .dropdown .dropdown ul {
    top: 0;
    left: 100%;
    visibility: hidden;
  }

  .navmenu .dropdown .dropdown:hover > ul {
    opacity: 1;
    top: 0;
    left: 100%;
    visibility: visible;
  }

  /* Hide mobile toggle on desktop */
  .mobile-nav-toggle {
    display: none;
  }
}

/* ========================================
   HEADER RESPONSIVE IMPROVEMENTS
   ======================================== */

/* Mobile header adjustments */
@media (max-width: 1023px) {
  .header {
    padding: 15px 0 0 0;
    height: 80px;
  }

  .header .header-container {
    margin-left: 10px;
    margin-right: 10px;
    padding: 10px 15px;
    border-radius: 20px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: none !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
  }

  /* Override Bootstrap justify-content classes on mobile */
  .header .header-container.justify-content-between {
    justify-content: space-between !important;
  }

  .header .header-container.justify-content-center {
    justify-content: space-between !important;
  }

  .header .header-container.justify-content-start {
    justify-content: space-between !important;
  }

  /* Force single line layout on mobile */
  .header .header-container {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }

  /* Ensure all direct children are inline */
  .header .header-container > * {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
  }

  .header .logo {
    order: 1 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    max-width: 60% !important;
  }

  .header .logo h1 {
    font-size: 18px;
  }

  .header .logo img {
    max-height: 28px;
  }

  .header .nav-right-elements {
    order: 2 !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    max-width: 40% !important;
  }

  /* Ensure mobile navigation toggle is visible and properly positioned */
  .header .mobile-nav-toggle {
    display: block !important;
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
    order: 1 !important;
  }

  /* Ensure all right-side elements are properly aligned */
  .header .nav-right-elements .mobile-nav-toggle,
  .header .nav-right-elements .nav-contact-icon,
  .header .nav-right-elements .nav-language-switcher,
  .header .nav-right-elements .nav-user-menu {
    flex-shrink: 0 !important;
    margin: 0 !important;
  }

  .header .btn-getstarted {
    order: 2;
    margin: 0 5px 0 0;
    padding: 6px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .header .navmenu {
    display: none !important;
    flex: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    order: 999 !important;
  }

  /* Mobile user button */
  .btn-getstarted.dropdown-toggle {
    min-width: 60px !important;
    max-width: 60px !important;
    width: 60px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .user-name-mobile {
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
}

/* Tablet header adjustments */
@media (min-width: 1024px) {
  .header {
    padding: 20px 0 0 0;
    height: 90px;
  }

  .header .header-container {
    margin-left: 15px;
    margin-right: 15px;
    padding: 12px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    max-width: none !important;
    width: 100% !important;
  }

  .header .logo h1 {
    font-size: 20px;
  }

  .header .logo {
    flex-shrink: 0;
  }

  .header .logo img {
    max-height: 30px;
  }

  .header .navmenu {
    margin: 0;
    flex: 1;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
  }

  .header .btn-getstarted {
    margin: 0 10px 0 0;
    padding: 8px 16px;
    font-size: 13px;
    flex-shrink: 0;
  }
}

/* Desktop header adjustments */
@media (min-width: 1024px) {
  .header {
    padding: 30px 0 0 0;
    height: 110px;
  }

  .header .header-container {
    margin-left: 20px;
    margin-right: 20px;
    padding: 15px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    max-width: none !important;
    width: 100% !important;
  }

  .header .logo h1 {
    font-size: 24px;
  }

  .header .logo {
    flex-shrink: 0;
  }

  .header .logo img {
    max-height: 36px;
  }

  .header .navmenu {
    margin: 0;
    flex: 1;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    max-width: none;
  }

  .header .btn-getstarted {
    margin: 0 0 0 30px;
    padding: 8px 20px;
    font-size: 14px;
    flex-shrink: 0;
  }
}

/* ========================================
   LANGUAGE SWITCHER RESPONSIVE
   ======================================== */

/* Mobile language switcher */
@media (max-width: 1023px) {
  .nav-language-switcher {
    margin-right: 0;
  }

  .nav-language-switcher .language-switcher-btn {
    padding: 0.25rem 0.25rem !important;
  }

  .nav-language-switcher .language-flag {
    font-size: 1rem;
  }

  .nav-language-switcher ul {
    min-width: 160px;
    left: 0;
    right: auto;
  }

  .nav-language-switcher ul a {
    padding: 8px 15px;
    font-size: 14px;
  }
}

/* Tablet language switcher */
@media (min-width: 1024px) {
  .nav-language-switcher {
    margin-right: 0;
  }

  .nav-language-switcher .language-switcher-btn {
    padding: 0.25rem 0.25rem !important;
  }

  .nav-language-switcher .language-flag {
    font-size: 1.1rem;
  }
}

/* Desktop language switcher */
@media (min-width: 1024px) {
  .nav-language-switcher {
    margin-right: 0;
  }

  .nav-language-switcher .language-switcher-btn {
    padding: 0.25rem 0.25rem !important;
  }

  .nav-language-switcher .language-flag {
    font-size: 1.2rem;
  }
}

/* ========================================
   CONTACT ICON RESPONSIVE
   ======================================== */

/* Mobile contact icon */
@media (max-width: 1023px) {
  .nav-contact-icon {
    padding: 0.25rem 0.25rem !important;
    font-size: 1rem;
    margin-right: 0;
  }

  .nav-contact-icon .d-lg-none {
    display: inline !important;
  }

  .nav-contact-icon .d-none.d-lg-inline {
    display: none !important;
  }
}

/* Tablet contact icon */
@media (min-width: 1024px) {
  .nav-contact-icon {
    padding: 0.25rem 0.25rem !important;
    font-size: 1.1rem;
    margin-right: 0;
  }
}

/* Desktop contact icon */
@media (min-width: 1024px) {
  .nav-contact-icon {
    padding: 0.25rem 0.25rem !important;
    font-size: 1.2rem;
    margin-right: 0;
  }

  .nav-contact-icon .d-lg-none {
    display: none !important;
  }

  .nav-contact-icon .d-none.d-lg-inline {
    display: inline !important;
  }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus indicators */
.navmenu a:focus,
.language-switcher-btn:focus,
.mobile-nav-toggle:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .navmenu ul li a {
    border: 1px solid transparent;
  }

  .navmenu ul li a:hover {
    border-color: currentColor;
  }

  .mobile-nav-toggle {
    border: 1px solid currentColor;
    padding: 4px;
    border-radius: 4px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .navmenu,
  .navmenu ul,
  .navmenu a,
  .mobile-nav-toggle {
    transition: none;
  }

  .navmenu ul li a i.bi-chevron-down {
    transition: none;
  }
}

/* ========================================
   BROWSER COMPATIBILITY
   ======================================== */

/* Safari backdrop-filter support */
@supports (-webkit-backdrop-filter: none) {
  .navmenu {
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Firefox specific fixes */
@supports (-moz-appearance: none) {
  .navmenu ul {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
  }
}

/* Edge specific fixes */
@supports (-ms-ime-align: auto) {
  .navmenu ul {
    -ms-overflow-style: auto;
  }
}
