/* ─────────────────────────────────────────────────────────────────────────────
   MOVID ACADEMY — SHARED NAV + THEME TOGGLE
   Load this BEFORE any page-specific CSS so page CSS can override colours.
───────────────────────────────────────────────────────────────────────────── */

/* Default nav tokens — overridden by each page's own :root */
:root {
  --nav-h:        68px;
  --pad:          clamp(20px, 5vw, 80px);
  --purple:       #7b3ff2;
  --purple-light: #9b6bff;
  --teal:         #2fa899;
  --teal-light:   #3dc4b3;
  --white:        #ffffff;
  --gray:         #8888aa;
  --gray-light:   #c0c0d8;
}

/* ── Main nav bar ──────────────────────────────────────────────────────────── */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  background: rgba(8,6,20,.94);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(123,63,242,.14);
  transition: top .3s;
}
#main-nav.has-notice, #main-nav.has-flash { top: 40px; }

/* Logo */
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.nav-logo-mark { width: 42px; height: 42px; display: flex; align-items: center; }
.nav-logo-mark img { width: 100%; height: 100%; object-fit: contain; }
.nav-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.nav-logo-name { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 3px; color: var(--white); }
.nav-logo-sub  { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: var(--teal); }

/* Links row */
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links > li { position: relative; }
.nav-links > li::after { content: ''; position: absolute; bottom: -12px; left: 0; right: 0; height: 12px; }
.nav-links > li > a {
  font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--gray);
  padding: 8px 14px; display: flex; align-items: center; gap: 5px;
  transition: color .2s; border-radius: 3px;
}
.nav-links > li > a:hover { color: var(--white); }

.nav-chevron { font-size: 10px; opacity: .6; transition: transform .25s; }
.nav-links > li:hover .nav-chevron { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 420px;
  background: rgba(13,11,28,.98);
  border: 1px solid rgba(123,63,242,.2);
  border-radius: 6px; padding: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s .2s, transform .2s .2s;
  z-index: 200; backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.nav-links > li:hover .nav-dropdown {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity .15s, transform .15s;
}
.nav-dropdown::before {
  content: ''; position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%); width: 12px; height: 6px;
  background: rgba(13,11,28,.98);
  clip-path: polygon(50% 0%,100% 100%,0% 100%);
  border-left: 1px solid rgba(123,63,242,.2);
  border-right: 1px solid rgba(123,63,242,.2);
}

.dropdown-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.dropdown-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 4px;
  transition: background .15s; color: var(--gray-light); text-decoration: none;
}
.dropdown-item:hover { background: rgba(123,63,242,.1); }

.dropdown-item-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.dropdown-item-text { display: flex; flex-direction: column; }
.dropdown-item-name { font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: 1px; color: var(--white); text-transform: uppercase; }
.dropdown-item-sub  { font-size: 11px; color: var(--gray); margin-top: 1px; }

.di-ai     { background: rgba(123,63,242,.2);  }
.di-mktg   { background: rgba(249,115,22,.2);  }
.di-design { background: rgba(234,179,8,.15);  }
.di-it     { background: rgba(59,130,246,.15); }
.di-prod   { background: rgba(245,158,11,.15); }
.di-video  { background: rgba(236,72,153,.15); }

.dd-badge {
  font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.06); color: var(--gray);
  padding: 2px 6px; border-radius: 2px; margin-left: auto; flex-shrink: 0;
}
.dropdown-footer { margin-top: 6px; padding: 10px 14px 6px; border-top: 1px solid rgba(255,255,255,.05); text-align: center; }
.dropdown-footer a { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); transition: color .2s; }
.dropdown-footer a:hover { color: var(--teal-light); }

/* Active dept highlight */
.dropdown-item.dd-active { background: rgba(123,63,242,.08); border-left: 2px solid var(--purple); }
.dropdown-item.dd-active .dropdown-item-name { color: var(--purple-light); }

/* CTA button */
.nav-cta {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff; border: none;
  padding: 11px 22px; border-radius: 8px;
  transition: transform .25s, box-shadow .25s, opacity .2s;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.nav-cta::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  opacity: 0; transition: opacity .25s;
}
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(123,63,242,.45);
}
.nav-cta:hover::before { opacity: 1; }

/* Hamburger */
.nav-hamburger { display: none; flex-direction: column; gap: 6px; background: none; border: none; padding: 6px; }
.nav-hamburger span { width: 26px; height: 2px; background: var(--gray-light); border-radius: 2px; transition: all .3s; display: block; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile drawer */
.nav-mobile {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: rgba(8,6,20,.98); backdrop-filter: blur(30px);
  border-bottom: 1px solid rgba(123,63,242,.15);
  padding: 20px var(--pad) 28px; z-index: 799;
  flex-direction: column; gap: 2px;
  max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
}
.nav-mobile.open { display: flex; }
.nav-mobile > a {
  font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; color: var(--gray-light);
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.04); transition: color .2s;
}
.nav-mobile > a:hover { color: var(--white); }
.nav-mobile-section-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase; color: var(--gray); padding: 16px 0 8px;
}
.nav-mobile-dept {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; color: var(--gray-light);
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.03); text-decoration: none;
}
.nav-mobile-dept .dropdown-item-icon { width: 28px; height: 28px; font-size: 14px; }
.nav-mobile-dept .dd-badge { margin-left: auto; }
.nav-mobile .nav-cta { margin-top: 18px; display: block; text-align: center; padding: 16px 24px; animation: none; }

/* ── Theme toggle ───────────────────────────────────────────────────────────── */
.theme-toggle {
  position: relative; display: flex; align-items: center;
  width: 104px; height: 28px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px; padding: 3px; cursor: pointer; flex-shrink: 0; overflow: hidden;
}
.tt-thumb {
  position: absolute; top: 3px; left: 3px;
  width: calc(50% - 3px); height: calc(100% - 6px);
  background: var(--purple); border-radius: 14px;
  transition: left .25s cubic-bezier(.4,0,.2,1); pointer-events: none;
}
[data-theme="light"] .tt-thumb { left: calc(50%); }
.tt-label {
  position: relative; z-index: 1; flex: 1; text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; transition: color .25s;
  pointer-events: none; user-select: none;
}
.tt-dark  { color: #fff; }
.tt-light { color: var(--gray); }
[data-theme="light"] .tt-dark  { color: var(--gray); }
[data-theme="light"] .tt-light { color: #fff; }
[data-theme="light"] .theme-toggle { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.14); }

/* ── Light theme nav overrides ──────────────────────────────────────────────── */
[data-theme="light"] #main-nav        { background: rgba(248,247,254,.96); border-bottom-color: rgba(107,45,224,.14); }
[data-theme="light"] .nav-mobile      { background: rgba(248,247,254,.99); border-bottom-color: rgba(107,45,224,.15); }
[data-theme="light"] .nav-dropdown    { background: rgba(255,255,255,.99); border-color: rgba(107,45,224,.18); box-shadow: 0 24px 60px rgba(0,0,0,.12); }
[data-theme="light"] .nav-dropdown::before { background: rgba(255,255,255,.99); border-color: rgba(107,45,224,.18); }
[data-theme="light"] .dropdown-item:hover  { background: rgba(107,45,224,.06); }
[data-theme="light"] .dd-badge             { background: rgba(0,0,0,.06); }
[data-theme="light"] .dropdown-footer      { border-top-color: rgba(0,0,0,.07); }
[data-theme="light"] .dropdown-item.dd-active { background: rgba(107,45,224,.08); }

/* ── Light theme text colour fallbacks ──────────────────────────────────────── */
/* These fire when a page doesn't override --gray via its own CSS variables.    */
[data-theme="light"] .nav-links > li > a       { color: #44446a; }
[data-theme="light"] .nav-links > li > a:hover { color: #0f0e1a; }
[data-theme="light"] .nav-logo-name            { color: #0f0e1a; }
[data-theme="light"] .nav-hamburger span       { background: #44446a; }
[data-theme="light"] .nav-mobile > a           { color: #44446a; }
[data-theme="light"] .nav-mobile > a:hover     { color: #0f0e1a; }
[data-theme="light"] .nav-mobile-dept          { color: #44446a; }
[data-theme="light"] .nav-mobile-section-label { color: #888899; }
[data-theme="light"] .dropdown-item-name       { color: #0f0e1a; }
[data-theme="light"] .dropdown-item-sub        { color: #55556e; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .nav-links     { display: none; }
  .nav-hamburger { display: flex; }
  .nav-cta       { display: none; }
}
