/* =============================================================
   navbar.css — Technaureus navbar with mega dropdowns
   Base font-size: 19px (global.css)
   ============================================================= */

/* ---------------------------------------------------------------
   1. HEADER SHELL
--------------------------------------------------------------- */
.navbar-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5.947rem; /* 113px / 19 */
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-gray);
  z-index: 1000;
  transition: box-shadow 0.3s ease, height 0.3s ease;
}

.navbar-header.scrolled {
  height: 4.737rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 101.053rem; /* 1920px / 19 */
  height: 100%;
  margin: 0 auto;
  padding: 0 7.895rem; /* 150px */
  gap: 2rem;
}

@media (max-width: 1600px) { .navbar-inner { padding: 0 4rem; } }
@media (max-width: 1280px) { .navbar-inner { padding: 0 2rem; } }

/* ---------------------------------------------------------------
   2. LOGO
--------------------------------------------------------------- */
.navbar-logo {
  display: block;
  width: 13.316rem; /* 253px */
  height: 3.158rem; /* 60px */
  flex-shrink: 0;
}

.navbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------------------------------------------------------------
   3. NAV LIST
--------------------------------------------------------------- */
.navbar-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2.105rem; /* 40px */
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: static; /* mega uses viewport-relative positioning */
}

/* Link and button base */
.nav-link,
.nav-link--btn {
  display: inline-flex;
  align-items: center;
  gap: 0.316rem;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 0.842rem; /* 16px */
  color: var(--base-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  white-space: nowrap;
  transition: color 0.25s ease;
  line-height: 1;
}

.nav-link::after,
.nav-link--btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-blue);
  transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link--btn:hover,
.nav-link.active {
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-link:hover::after,
.nav-link--btn:hover::after,
.nav-link.active::after,
.nav-item--mega.is-open .nav-link--btn::after {
  width: 100%;
}

/* Active / open state — blue + bold */
.nav-item--mega.is-open > .nav-link--btn,
.nav-link--btn[aria-expanded="true"] {
  color: #006cc2;
  font-weight: 600;
}

/* Chevron rotation */
.nav-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.nav-item--mega.is-open .nav-chevron {
  transform: rotate(180deg);
}

/* ---------------------------------------------------------------
   4. MEGA DROPDOWN
--------------------------------------------------------------- */
.mega-dropdown {
  position: fixed;
  left: 0;
  right: 0;
  top: 5.947rem; /* flush under header */
  background: #ffffff;
  box-shadow: 0 9px 20px rgba(8, 75, 129, 0.26);
  z-index: 999;

  /* Hidden state */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.navbar-header.scrolled .mega-dropdown {
  top: 4.737rem;
}

/* Visible state — toggled by JS */
.nav-item--mega.is-open .mega-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.mega-inner {
  display: flex;
  max-width: 101.053rem;
  margin: 0 auto;
  padding: 0 7.895rem;
  min-height: 15rem;
}

@media (max-width: 1600px) { .mega-inner { padding: 0 4rem; } }
@media (max-width: 1280px) { .mega-inner { padding: 0 2rem; } }

/* ---------------------------------------------------------------
   5. MEGA SIDEBAR (left tab column)
--------------------------------------------------------------- */
.mega-sidebar {
  width: 18.368rem; /* 349px */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.526rem 0; /* 29px */
}

.mega-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 3.105rem; /* 59px */
  padding: 0 1.368rem; /* 26px */
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 0.842rem;
  color: #ffffff;
  background: #006cc2;
  border: 0.8px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.mega-tab--active {
  background: #084b81;
  font-weight: 500;
}

.mega-tab:hover:not(.mega-tab--active) {
  background: #0558a0;
}

.mega-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.mega-tab--active svg {
  opacity: 1;
}

/* ---------------------------------------------------------------
   6. MEGA CONTENT (right panels)
--------------------------------------------------------------- */
.mega-content {
  flex: 1;
  position: relative;
  padding: 2.632rem 2.105rem; /* 50px 40px */
}

.mega-panel {
  display: none;
  gap: 3rem;
  grid-template-columns: repeat(3, 1fr);
}

.mega-panel--active {
  display: grid;
}

/* Single or double column panels */
.mega-panel:has(.mega-col:only-child) {
  grid-template-columns: 1fr;
}

.mega-panel:has(.mega-col:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
}

.mega-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mega-link {
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 0.842rem; /* 16px */
  color: #000000;
  text-decoration: none;
  line-height: 1;
  padding: 1.263rem 0; /* ~24px — matching Figma row height ~48px / 2 */
  border: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: block;
}

.mega-link:hover {
  color: var(--primary-blue);
  padding-left: 0.5rem;
}

/* ---------------------------------------------------------------
   7. RIGHT ACTIONS
--------------------------------------------------------------- */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.789rem; /* ~15px */
  flex-shrink: 0;
}

/* Icon buttons */
.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.105rem;
  height: 2.105rem;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.nav-icon-btn:hover {
  background: var(--bg-light);
}

.nav-icon-btn svg {
  display: block;
  flex-shrink: 0;
}

/* Menu / hamburger — larger icon */
.nav-icon-btn--menu svg {
  width: 1.523rem;
  height: 1.523rem;
}

/* Bookmark badge */
.nav-badge-wrap {
  position: relative;
}

.nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--primary-blue);
  color: #ffffff;
  font-family: var(--font-secondary);
  font-weight: 600;
  font-size: 0.632rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-white);
  pointer-events: none;
}

/* Contact button */
.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.737rem; /* ~52px */
  padding: 0 1.211rem;
  border: 1px solid var(--primary-blue);
  border-radius: 2rem;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 0.842rem;
  color: var(--base-dark);
  background: var(--bg-white);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  text-decoration: none;
}

.btn-contact:hover {
  background: var(--primary-blue);
  color: #ffffff;
}

/* Talk to an Expert button */
.btn-talk {
  display: inline-flex;
  align-items: center;
  gap: 0.474rem;
  height: 2.316rem; /* 44px */
  padding: 0 1.053rem;
  border: 1px solid #ffffff;
  border-radius: 1.579rem;
  background: var(--primary-blue);
  color: #ffffff;
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 0.842rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}

.btn-talk:hover {
  background: var(--primary-blue);
  color: #ffffff;
  border: 1px solid #ffffff;
  transform: translateY(-1px);
}

.btn-talk svg {
  width: 1.105rem;
  height: 1.105rem;
  display: block;
  filter: brightness(0) invert(1);
}

/* ---------------------------------------------------------------
   8. DARK THEME OVERRIDES
--------------------------------------------------------------- */
body.dark-theme .navbar-header {
  border-bottom-color: var(--border-gray);
}

body.dark-theme .nav-link,
body.dark-theme .nav-link--btn {
  color: var(--base-dark);
}

/* Dark Theme Icon Styling */
body.dark-theme .nav-icon-btn svg path,
body.dark-theme .nav-icon-btn svg rect {
  stroke: var(--base-dark);
}

/* Protect the Yellow Sun in Dark Mode */
body.dark-theme #theme-dark-icon path {
  fill: #FF9933 !important;   /* Force yellow fill */
  stroke: none !important;    /* Remove any stroke */
}


body.dark-theme .mega-dropdown {
  background: #1a1a24;
}

body.dark-theme .mega-link {
  color: #e0e0e0;
}

body.dark-theme .btn-contact {
  color: var(--base-dark);
  background: transparent;
}

/* ---------------------------------------------------------------
   9. MOBILE NAV OVERLAY
--------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Hide mega-capable nav on mobile, show simple overlay instead */
  .navbar-nav {
    position: fixed;
    top: 5.947rem;
    left: -100%;
    width: 100%;
    height: calc(100dvh - 5.947rem);
    background: var(--bg-white);
    flex-direction: column;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    border-top: 1px solid var(--border-gray);
  }

  .navbar-nav.active {
    left: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--border-gray);
  }

  .nav-link,
  .nav-link--btn {
    width: 100%;
    justify-content: space-between;
    font-size: 1.053rem;
    padding: 1rem 0;
  }

  .nav-link::after,
  .nav-link--btn::after {
    display: none;
  }

  /* Mobile mega dropdown — accordion style */
  .mega-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--bg-light);
    transform: none;
    opacity: 1;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .nav-item--mega.is-open .mega-dropdown {
    pointer-events: all;
    max-height: 60rem;
    transform: none;
    opacity: 1;
  }

  .mega-inner {
    flex-direction: column;
    padding: 0;
    min-height: unset;
  }

  .mega-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-right: none;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-gray);
    background: var(--bg-light);
  }

  .mega-tab {
    flex: 1 1 auto;
    height: 2.5rem;
    border-radius: 0.5rem;
    justify-content: center;
    font-size: 0.737rem;
    padding: 0 0.75rem;
  }

  .mega-tab svg { display: none; }

  .mega-content {
    padding: 1rem 1.25rem;
  }

  .mega-panel {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .mega-panel--active {
    display: flex;
    flex-direction: column;
  }

  .mega-link {
    padding: 0.75rem 0;
    font-size: 0.895rem;
  }

  /* Hide some action items on mobile */
  .btn-talk { display: none; }
  .btn-contact { display: none; }
  .nav-icon-btn--theme { display: none; }
}

@media (max-width: 600px) {
  .navbar-inner { padding: 0 1rem; }
  .navbar-logo { width: 10rem; }
}

/* ---------------------------------------------------------------
   10. LANGUAGE SWITCHER
--------------------------------------------------------------- */

/* Wrapper — gives the dropdown a positioning context */
.lang-switcher {
  position: relative;
}

/* Trigger button — extends the existing .nav-icon-btn */
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: auto;
  padding: 0 0.4rem;
  border-radius: 1rem;
}

.lang-active-code {
  font-family: var(--font-primary);
  font-size: 0.684rem;
  font-weight: 600;
  color: var(--base-dark);
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Dropdown panel */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 16rem;
  background: var(--bg-white);
  border: 1px solid var(--border-gray);
  border-radius: 0.75rem;
  box-shadow: 0 8px 28px rgba(8, 75, 129, 0.14);
  z-index: 1100;
  overflow: hidden;

  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-dropdown.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Search bar */
.lang-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border-gray);
}

.lang-search-icon {
  flex-shrink: 0;
  color: #9ca3af;
}

.lang-search {
  flex: 1;
  font-family: var(--font-primary);
  font-size: 0.789rem;
  color: var(--base-dark);
  background: transparent;
  border: none;
  outline: none;
}

.lang-search::placeholder {
  color: #9ca3af;
}

/* Language list */
.lang-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
  max-height: 14rem;
  overflow-y: auto;
}

.lang-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lang-item:hover {
  background: var(--bg-light, #f5f7fa);
}

.lang-item--active {
  background: rgba(0, 108, 194, 0.07);
}

.lang-name {
  font-family: var(--font-primary);
  font-size: 0.789rem;
  font-weight: 500;
  color: var(--base-dark);
  flex: 1;
}

.lang-native {
  font-family: var(--font-primary);
  font-size: 0.684rem;
  color: #6b7280;
}

.lang-check {
  flex-shrink: 0;
  color: var(--primary-blue);
}

/* Empty state */
.lang-empty {
  padding: 0.75rem 0.9rem;
  font-family: var(--font-primary);
  font-size: 0.789rem;
  color: #9ca3af;
  text-align: center;
  margin: 0;
}

/* Dark mode overrides */
body.dark-theme .lang-dropdown {
  background: #1a1a24;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .lang-search-wrap {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .lang-search {
  color: #e0e0e0;
}

body.dark-theme .lang-name {
  color: #e0e0e0;
}

body.dark-theme .lang-native {
  color: #9ca3af;
}

body.dark-theme .lang-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-theme .lang-item--active {
  background: rgba(0, 108, 194, 0.2);
}

body.dark-theme .lang-active-code {
  color: var(--base-dark);
}

/* Mobile — keep the trigger, hide code text on very small screens */
@media (max-width: 600px) {
  .lang-active-code { display: none; }
  .lang-dropdown { right: -1rem; width: 14rem; }
}

.navbar-logo .logo-light { display: none; }
.navbar-logo .logo-dark  { display: block; }

.nav-icon-btn { color: #241e20; }

/* ---------------------------------------------------------------
   11. TRANSPARENT VARIANT (hero pages, e.g. Join Us)
   position stays fixed at all times — only visual treatment changes.
   Unscrolled state = transparent/white-text; .scrolled explicitly
   restates every default value rather than relying on absence.
--------------------------------------------------------------- */

/* --- Unscrolled: transparent look --- */
.navbar-header--transparent {
  background: transparent;
  border-bottom-color: transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.navbar-header--transparent .nav-link,
.navbar-header--transparent .nav-link--btn,
.navbar-header--transparent .lang-active-code {
  color: #ffffff;
  transition: color 0.3s ease;
}

.navbar-header--transparent .nav-link::after,
.navbar-header--transparent .nav-link--btn::after {
  background: #ffffff;
}

.navbar-header--transparent .nav-icon-btn {
  color: #ffffff;
  transition: color 0.3s ease;
}

.navbar-header--transparent .nav-icon-btn:hover{
  color: #2d2c2c;
}
.navbar-header--transparent .nav-icon-btn:hover .lang-active-code {
  color: #2d2c2c;
}

.navbar-header--transparent .btn-contact {
  color: #ffffff;
  border-color: #ffffff;
  background: transparent;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-header--transparent .btn-contact:hover {
  background: #ffffff;
  color: var(--base-dark);
}

.navbar-header--transparent .navbar-logo .logo-dark  { display: none; }
.navbar-header--transparent .navbar-logo .logo-light { display: block; }

/* --- Scrolled: explicit revert to default white navbar ---
   Selector specificity (.navbar-header--transparent.scrolled = 0,2,0)
   beats the unscrolled block above (0,1,0), so this always wins
   once JS adds .scrolled — no reliance on :not() absence. */
.navbar-header--transparent.scrolled {
  background: var(--bg-white);
  border-bottom-color: var(--border-gray);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.navbar-header--transparent.scrolled .nav-link,
.navbar-header--transparent.scrolled .nav-link--btn,
.navbar-header--transparent.scrolled .lang-active-code {
  color: var(--base-dark);
}

.navbar-header--transparent.scrolled .nav-link::after,
.navbar-header--transparent.scrolled .nav-link--btn::after {
  background: var(--primary-blue);
}

.navbar-header--transparent.scrolled .nav-icon-btn {
  color: #241e20;
}

.navbar-header--transparent.scrolled .btn-contact {
  color: var(--base-dark);
  border-color: var(--primary-blue);
  background: var(--bg-white);
}

.navbar-header--transparent.scrolled .btn-contact:hover {
  background: var(--primary-blue);
  color: #ffffff;
}

.navbar-header--transparent.scrolled .navbar-logo .logo-dark  { display: block; }
.navbar-header--transparent.scrolled .navbar-logo .logo-light { display: none; }