/* ============================================================
   AACPOJ Navbar v5.2 — dark glassmorphism + floating orbs
   Ported from /home/aacp/anna/dev-frontend/oj-dark-nav-preview.html
   ============================================================ */

/* Hide DMOJ's old <nav id="navigation"> if it ever leaks through */
nav#navigation { display: none !important; }

/* footer { position: absolute; bottom: 0 } — footer sits at the bottom of
   #page-container. When page content determines the container height, the visible
   gap above the footer = padding-bottom − footer_visible_height (~37px).
   3.5em (49px) left only 12px gap — less than one code line (18px) — causing the
   last line to be covered. 5em (70px) gives ~33px of visible breathing room. */
#content-body { padding-bottom: 5em; }

/* Remove DMOJ's legacy <br> spacer and reduce #content margin-top.
   base.html has a bare <br> before <main id="content"> plus style.css sets
   #content { margin: 52px auto auto } — together they add ~68px of dead space
   below the navbar. We hide the <br> globally and bring margin-top down to 16px.
   Full-viewport pages (IDE, room, problems list) already force margin:0 !important
   in their own <style> blocks, so they remain flush to the navbar. */
#page-container > br { display: none; }
#content { margin-top: 16px; }

/* === Shell === */
.aaoj-shell {
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 1100;
  background: linear-gradient(135deg, var(--aacp-header-bg-from) 0%, var(--aacp-header-bg-to) 100%);
  border-bottom: 1px solid rgba(0, 168, 150, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-family: var(--display);
  overflow: visible;
}
body.is-impersonating .aaoj-shell {
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #dc2626, #f59e0b) 1;
}
.aaoj-shell-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--navbar-h);
  width: min(1800px, calc(100% - 24px));
  margin: 0 auto;
}

/* === Logo (shimmer text) === */
@keyframes aaoj-nav-perspShift {
  0%, 100% { transform: perspective(500px) rotateY(-12deg) rotateX(3deg); }
  50%      { transform: perspective(500px) rotateY(12deg) rotateX(-3deg); }
}
@keyframes aaoj-nav-shine { to { background-position: 200% center; } }

.aaoj-nav-logo {
  flex: 0 0 auto;
  text-decoration: none !important;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  transition: transform .3s, filter .3s;
}
.aaoj-nav-logo:hover { transform: translateY(-2px) scale(1.05); filter: brightness(1.15); }
.aaoj-nav-logo-text {
  display: inline-flex;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 900;
  font-family: 'Noto Sans TC', sans-serif;
  line-height: 1;
  letter-spacing: -.02em;
  animation: aaoj-nav-perspShift 5s ease-in-out infinite;
  transform-style: preserve-3d;
}
.aaoj-nav-logo-aa,
.aaoj-nav-logo-oj {
  background: linear-gradient(120deg, #a8f0e8, #fff, #00e8d4, #00a896, #e8c880, #fff, #a8f0e8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  animation: aaoj-nav-shine 7s linear infinite;
}
.aaoj-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === Nav orbs === */
.aaoj-nav-primary { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.aaoj-nav-primary > ul {
  display: flex; align-items: center; gap: 5px;
  list-style: none; margin: 0; padding: 0; flex-wrap: nowrap;
}
.aaoj-nav-li {
  flex: 0 0 auto;
  position: relative;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 3px 12px rgba(0,0,0,.15), inset 0 1px 1px rgba(255,255,255,.04);
  transition: transform .35s cubic-bezier(.175,.885,.32,1.275),
              background .35s cubic-bezier(.175,.885,.32,1.275),
              border-color .35s cubic-bezier(.175,.885,.32,1.275),
              box-shadow .35s cubic-bezier(.175,.885,.32,1.275);
  /* No overflow:hidden here — would clip the absolutely-positioned
     .aaoj-mega-panel / .aaoj-submenu children. The ::before sheen
     spills slightly past the pill edge but it's pointer-events:none
     and faint enough to not be visually distracting. */
}
.aaoj-nav-li::before {
  content: '';
  position: absolute; top: -50%; left: 10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,.06), transparent 60%);
  border-radius: 50%;
  pointer-events: none;
}
.aaoj-nav-li:hover {
  transform: translateY(-3px) scale(1.06);
  background: radial-gradient(circle at 30% 30%, rgba(0,168,150,.15), rgba(255,255,255,.05));
  border-color: rgba(0,168,150,.3);
  box-shadow: 0 8px 24px rgba(0,168,150,.18);
}
.aaoj-nav-li.is-current {
  border-color: rgba(0,168,150,.35);
  background: radial-gradient(circle at 30% 30%, rgba(0,168,150,.12), rgba(255,255,255,.04));
}

.aaoj-nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.65) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: clamp(1rem, 1.05vw, 1.18rem);
  letter-spacing: 0.01em;
  padding: 11px 14px;
  white-space: nowrap;
  position: relative; z-index: 1;
  transition: color .3s;
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  cursor: pointer;
  font-family: var(--display);
}
.aaoj-nav-li:hover .aaoj-nav-link { color: #fff !important; }
.aaoj-nav-li.is-current .aaoj-nav-link { color: #00d4aa !important; }
.aaoj-nav-li.is-current .aaoj-nav-link::after {
  content: ''; position: absolute; bottom: 2px; left: 50%;
  transform: translateX(-50%); width: 14px; height: 2px;
  border-radius: 99px; background: var(--brand);
}
.aaoj-nav-icon { display: none; }
.aaoj-nav-li:hover .aaoj-nav-icon { opacity: 1; }
.aaoj-nav-chevron { font-size: 10px; margin-left: 2px; opacity: 0.6; }

/* is-hot orb (admin can mark a NavigationBar item) */
@keyframes aaoj-hot-glow {
  0%, 100% { box-shadow: 0 4px 20px rgba(0,168,150,.25); border-color: rgba(0,168,150,.45); }
  50%      { box-shadow: 0 4px 30px rgba(0,168,150,.45), 0 0 12px rgba(0,168,150,.2); border-color: rgba(0,168,150,.6); }
}
.aaoj-nav-li.is-hot {
  background: radial-gradient(circle at 30% 30%, rgba(0,168,150,.4), rgba(0,168,150,.12));
  border-color: rgba(0,168,150,.45);
  box-shadow: 0 4px 20px rgba(0,168,150,.25);
  animation: aaoj-hot-glow 2.5s ease-in-out infinite;
}
.aaoj-nav-li.is-hot .aaoj-nav-link { color: #fff !important; font-weight: 700; }

/* === Burger mode ===
   navbar.js adds .aaoj-auto-hamburger whenever the primary nav doesn't fit
   in the available space (any viewport width). The @media (max-width: 980px)
   block below mirrors the same rules as a CSS-only fallback so the burger
   renders correctly before navbar.js has a chance to run on narrow first-paint.
   All drawer-open rules (.aaoj-shell.aaoj-nav-open …) live outside the media
   query so they apply in BOTH cases — keeping them only inside @media was the
   2026-05-24 bug where dynamic-hamburger drawer wouldn't open above 980px. */
.aaoj-shell.aaoj-auto-hamburger .aaoj-nav-primary { display: none; }
.aaoj-shell.aaoj-auto-hamburger .aaoj-nav-toggle { display: inline-flex; margin-left: auto; }
.aaoj-shell.aaoj-auto-hamburger .aaoj-user-area { margin-left: 8px; }

/* === Hamburger toggle button === */
.aaoj-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,.1);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 3px 12px rgba(0,0,0,.15);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.aaoj-nav-toggle:hover {
  background: radial-gradient(circle at 30% 30%, rgba(0,168,150,.15), rgba(255,255,255,.05));
  border-color: rgba(0,168,150,.3);
  box-shadow: 0 6px 20px rgba(0,168,150,.15);
}
.aaoj-burger-icon { width: 26px; height: 26px; display: block; }
.aaoj-shell.aaoj-nav-open .aaoj-nav-toggle {
  background: radial-gradient(circle at 30% 30%, rgba(0,168,150,.18), rgba(255,255,255,.05));
  border-color: rgba(0,168,150,.35);
  box-shadow: 0 6px 20px rgba(0,168,150,.18);
  color: #00d4aa;
}

/* === CSS-only burger fallback for narrow viewports ===
   Mirrors .aaoj-auto-hamburger so the burger is visible before navbar.js runs.
   margin-left:auto pushes the burger to the right edge so the layout becomes
   [logo] ........ [burger][user-area] instead of having the burger float in
   the dead center via space-between distribution. */
@media (max-width: 980px) {
  .aaoj-shell .aaoj-nav-primary { display: none; }
  .aaoj-shell .aaoj-nav-toggle { display: inline-flex; margin-left: auto; }
  .aaoj-shell .aaoj-user-area { margin-left: 8px; }
}

/* === Open drawer ===
   Triggered by clicking the burger (.aaoj-nav-open added on the shell).
   Burger is only clickable in burger mode (auto-hamburger or ≤980px), so
   these rules safely apply at every viewport width — keeping them outside
   the @media query is what lets the dynamic-hamburger drawer actually
   appear above 980px. */
.aaoj-shell.aaoj-nav-open .aaoj-nav-primary {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  left: auto;
  width: min(300px, calc(100% - 24px));
  background: linear-gradient(180deg, rgba(13,17,23,.97), rgba(20,27,46,.97));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(0,168,150,.18);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  max-height: calc(100vh - var(--navbar-h) - 24px);
  overflow-y: auto;
  z-index: 1150;
}
@supports not (backdrop-filter: blur(20px)) {
  .aaoj-shell.aaoj-nav-open .aaoj-nav-primary {
    background: linear-gradient(180deg, rgba(13,17,23,.99), rgba(20,27,46,.99));
  }
}
.aaoj-shell.aaoj-nav-open .aaoj-nav-primary > ul {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 14px 16px;
}

/* Pills become full-width rows; drop hover lift to avoid jiggle in tight column */
.aaoj-shell.aaoj-nav-open .aaoj-nav-li { border-radius: 14px; }
.aaoj-shell.aaoj-nav-open .aaoj-nav-li:hover { transform: none; }
.aaoj-shell.aaoj-nav-open .aaoj-nav-li::before { display: none; }

/* display:flex (was inline-flex) makes the <a> stretch to fill the <li> width
   so the entire row is a click target, not just the icon+text run. */
.aaoj-shell.aaoj-nav-open .aaoj-nav-link {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  gap: 12px;
  justify-content: flex-start;
  font-size: 0.98rem;
}
.aaoj-shell.aaoj-nav-open .aaoj-nav-link span.aaoj-nav-label { display: inline; }
.aaoj-shell.aaoj-nav-open .aaoj-nav-icon { font-size: 16px; width: 18px; }
.aaoj-shell.aaoj-nav-open .aaoj-nav-chevron { display: inline; margin-left: auto; }

/* Active short bar (desktop bottom indicator) → left bar inside drawer */
.aaoj-shell.aaoj-nav-open .aaoj-nav-li.is-current .aaoj-nav-link::after {
  bottom: auto;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
}

/* Inline-expand mega-panel / submenu inside the drawer (no float) */
.aaoj-shell.aaoj-nav-open .aaoj-mega-panel,
.aaoj-shell.aaoj-nav-open .aaoj-submenu {
  position: static;
  transform: none;
  margin: 4px 0 6px 12px;
  min-width: 0;
  max-width: none;
  width: auto;
  box-shadow: none;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  border-color: rgba(0,168,150,.14);
}
.aaoj-shell.aaoj-nav-open .aaoj-mega-panel { padding: 12px; }
.aaoj-shell.aaoj-nav-open .aaoj-mega-inner { grid-template-columns: 1fr; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  .aaoj-nav-toggle,
  .aaoj-shell.aaoj-nav-open .aaoj-nav-primary { transition: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .aaoj-nav-logo-text { animation: none; transform: none; }
  .aaoj-nav-logo-aa, .aaoj-nav-logo-oj { animation: none; background-position: 0% center; }
  .aaoj-nav-li, .aaoj-nav-li.is-hot { transition: none; animation: none; transform: none !important; }
  .aaoj-nav-li:hover { transform: none !important; }
}

/* === Dropdown panels (dark glass) === */
.aaoj-mega-panel,
.aaoj-submenu,
.aaoj-user-menu {
  position: absolute;
  background: linear-gradient(180deg, rgba(13,17,23,.97), rgba(20,27,46,.97));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(0,168,150,.18);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 4px 12px rgba(0,168,150,.08);
  z-index: 1200;
  overflow: hidden;
}
@supports not (backdrop-filter: blur(20px)) {
  .aaoj-mega-panel, .aaoj-submenu, .aaoj-user-menu {
    background: linear-gradient(180deg, rgba(13,17,23,.99), rgba(20,27,46,.99));
  }
}
.aaoj-mega-panel { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 20px; min-width: 600px; max-width: 90vw; }
.aaoj-submenu { top: calc(100% + 8px); left: 0; padding: 6px; min-width: 220px; }

.aaoj-mega-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.aaoj-mega-org {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--display); font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,.55) !important;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 10px;
  text-decoration: none !important;
}
a.aaoj-mega-org { color: #00d4aa !important; }
a.aaoj-mega-org:hover { color: #a8f0e8 !important; }
/* Non-admin students see green static header (same visual as course-admin
   link variant, but non-clickable and no hover brighten). Applies to both
   courses and homework mega-panels. */
h4.aaoj-mega-org { color: #00d4aa !important; cursor: default; }
.aaoj-mega-classes { list-style: none; padding: 0; margin: 0; }
.aaoj-mega-classes li a {
  display: block; padding: 8px 10px; border-radius: 6px;
  font-size: 14px; color: rgba(255,255,255,.85) !important;
  text-decoration: none !important;
  transition: background .12s, color .12s;
  font-family: var(--display);
}
.aaoj-mega-classes li a:hover { background: rgba(0,168,150,.14); color: #fff !important; }
.aaoj-mega-classes .dim { opacity: 0.55; font-size: 12px; }
.aaoj-mega-subhead {
  font-family: var(--display); font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.45);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 8px 0 4px;
}

.aaoj-submenu a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 4px;
  font-size: 14px; color: rgba(255,255,255,.85) !important;
  text-decoration: none !important;
  transition: background .1s, color .1s;
  font-family: var(--display);
}
.aaoj-submenu a:hover { background: rgba(0,168,150,.14); color: #fff !important; }
.aaoj-submenu a i { width: 16px; opacity: 0.7; }

/* === User chip + dropdown === */
.aaoj-user-area { position: relative; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.aaoj-user-chip {
  display: inline-flex !important; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.08), rgba(255,255,255,.02)) !important;
  border: 1px solid rgba(255,255,255,.07) !important;
  border-radius: 999px !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.15) !important;
  font-family: var(--display); font-size: 13px;
  color: rgba(255,255,255,.85) !important;
  text-shadow: none !important;
  text-transform: none !important;
  cursor: pointer;
  transition: all .3s cubic-bezier(.175,.885,.32,1.275);
  text-decoration: none !important;
}
.aaoj-user-chip:hover {
  transform: translateY(-2px) scale(1.04);
  background: radial-gradient(circle at 30% 30%, rgba(0,168,150,.15), rgba(255,255,255,.05)) !important;
  border-color: rgba(0,168,150,.3) !important;
  box-shadow: 0 8px 24px rgba(0,168,150,.18) !important;
  color: #fff !important;
}
.aaoj-user-avatar {
  width: 28px; height: 28px; border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,.15);
  display: inline-block;
  vertical-align: middle;
}
.aaoj-impersonate-warn {
  background: #dc2626; color: #fff !important;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px;
  margin-right: 2px;
}
.aaoj-user-menu {
  top: calc(100% + 8px); right: 0;
  padding: 6px; min-width: 240px;
}
.aaoj-user-menu a, .aaoj-logout-btn {
  display: flex !important; align-items: center; gap: 10px;
  padding: 10px 14px; width: 100%;
  background: transparent !important; background-image: none !important;
  border: none !important; box-shadow: none !important; text-shadow: none !important;
  border-radius: 6px !important;
  font-family: var(--display); font-size: 14px;
  color: rgba(255,255,255,.85) !important;
  text-decoration: none !important; cursor: pointer; text-align: left;
}
.aaoj-user-menu a:hover, .aaoj-logout-btn:hover { background: rgba(0,168,150,.14) !important; color: #fff !important; }
.aaoj-user-menu a i { width: 16px; opacity: 0.75; }
.aaoj-user-menu hr { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 4px 0; }
.aaoj-stop-impersonate { color: #ff6b6b !important; }
.aaoj-stop-impersonate:hover { color: #ff8a8a !important; background: rgba(220,38,38,.16) !important; }
.aaoj-logout-form { margin: 0; padding: 0; }

/* === Anon CTAs === */
.aaoj-cta {
  display: inline-flex !important; align-items: center;
  padding: 8px 18px;
  border-radius: 999px !important;
  font-family: var(--display); font-size: 14px; font-weight: 600;
  text-decoration: none !important; text-shadow: none !important;
  text-transform: none !important;
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
  cursor: pointer;
  border: 1px solid transparent;
}
.aaoj-cta-ghost {
  background: transparent !important; background-image: none !important;
  border-color: rgba(255,255,255,.2) !important;
  color: rgba(255,255,255,.85) !important;
  box-shadow: none !important;
}
.aaoj-cta-ghost:hover {
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(0,168,150,.5) !important;
  color: #fff !important;
  transform: translateY(-2px);
}
.aaoj-cta-prim {
  background: var(--brand) !important; background-image: none !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0,168,150,.35) !important;
}
.aaoj-cta-prim:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,168,150,.45) !important;
}

/* === In-contest banner (dark glass, replaces #contest-info layout) === */
#contest-info {
  position: fixed !important; top: var(--navbar-h) !important; left: 0 !important; width: 100% !important;
  background: linear-gradient(180deg, rgba(13,17,23,.92), rgba(20,27,46,.92)) !important;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: none !important;
  border-bottom: 2px solid #00A896 !important;
  border-radius: 0 !important;
  padding: 10px 24px !important; height: 48px !important;
  box-sizing: border-box;
  z-index: 99 !important;
  font-family: var(--display); font-size: 13px;
  color: #00d4aa !important;
  text-align: center;
  display: flex !important; align-items: center; justify-content: center;
  gap: 8px;
  margin: 0 !important;
  cursor: default !important;
}
@supports not (backdrop-filter: blur(16px)) {
  #contest-info { background: linear-gradient(180deg, rgba(13,17,23,.98), rgba(20,27,46,.98)) !important; }
}
#contest-info a { color: #a8f0e8 !important; text-decoration: none !important; display: inline-flex; align-items: center; gap: 8px; vertical-align: middle !important; }
#contest-info a:hover { color: #fff !important; text-decoration: underline !important; }
.contest-info-makeup-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, .5);
  background: rgba(14, 165, 233, .16);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

/* Countdown pill: brand-color fill that shrinks as time runs out, warns at low time. */
.aacp-timer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  position: relative;
  overflow: hidden;
  margin-left: 4px;
  font-family: var(--mono);
  font-weight: 600;
  color: white !important;
}
.aacp-timer-pill .aacp-timer-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #00A896;
  z-index: 0;
  transition: width 1s linear, background-color .3s;
  width: 100%;
}
.aacp-timer-pill.is-low .aacp-timer-fill { background: #f59e0b; }
.aacp-timer-pill.is-critical .aacp-timer-fill { background: #ef4444; }
.aacp-timer-pill .aacp-timer-text {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
#contest-time-remaining {
  display: inline !important;
  color: white !important;
  font: inherit !important;
}

/* === Footer (dark glass to match navbar) === */
.aaoj-footer {
  background: linear-gradient(135deg, #15181d 0%, #1a1f2c 100%);
  color: rgba(177,182,192,.65);
  padding: 10px 0;
  margin-top: 32px;
  font-family: var(--display);
  border-top: 1px solid rgba(0,168,150,.08);
}
.aaoj-footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.aaoj-footer .powered { font-weight: 600; color: rgba(255,255,255,.7); }
.aaoj-footer .powered .brand { color: #00d4aa; }
.aaoj-footer .sep { opacity: 0.4; }
.aaoj-footer a { color: rgba(255,255,255,.6) !important; text-decoration: none !important; }
.aaoj-footer a:hover { color: #00d4aa !important; }
/* iOS-style language toggle in dark footer */
.aaoj-footer-lang {
  appearance: none;
  position: relative;
  width: 64px; height: 28px;
  padding: 0 4px; margin: 0;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(0,168,150,.35);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: border-color .15s, box-shadow .2s;
}
.aaoj-footer-lang:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(0,168,150,.7);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.25), 0 0 0 3px rgba(0,168,150,.12);
}
.aaoj-flang-thumb {
  position: absolute;
  top: 3px; width: 26px; height: 20px;
  background: #e8f9f6;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0,168,150,.3), inset 0 1px 0 rgba(255,255,255,.9);
  transition: left .28s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 11px;
  color: #028090; letter-spacing: 0.3px;
  pointer-events: none; user-select: none;
}
.aaoj-footer-lang[data-cur="zh"] .aaoj-flang-thumb { left: 3px; }
.aaoj-footer-lang[data-cur="en"] .aaoj-flang-thumb { left: 35px; }
.aaoj-flang-hint {
  position: absolute; top: 0; bottom: 0; width: 32px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 9.5px;
  color: rgba(255,255,255,.38); letter-spacing: 0.5px;
  pointer-events: none; user-select: none;
}
.aaoj-footer-lang[data-cur="zh"] .aaoj-flang-hint { right: 0; }
.aaoj-footer-lang[data-cur="en"] .aaoj-flang-hint { left: 0; }
.aaoj-footer-lang:hover .aaoj-flang-hint { color: rgba(0,168,150,.8); }
