/* ============================================================
   AIALPHAVIDEOS.CLOUD — shared design system
   Modern-tech dark UI · premium gold accent · futuristic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* canvas */
  --bg:        #07080a;
  --bg-1:      #0b0d11;
  --surface:   #111419;
  --surface-2: #161a21;
  --line:      rgba(255,255,255,0.08);
  --line-2:    rgba(255,255,255,0.14);

  /* text */
  --fg:        #f6f5f1;
  --fg-soft:   #c3c5ca;
  --fg-mute:   #8b8e96;
  --fg-faint:  #5c5f67;

  /* gold accent */
  --gold:      #e9c46a;
  --gold-2:    #d4af37;
  --gold-deep: #b8902a;
  --gold-glow: rgba(233,196,106,0.22);

  /* cool secondary (sparingly, for the "tech" energy) */
  --ice:       #7fa9ff;

  /* type */
  --display: 'Space Grotesk', sans-serif;
  --body:    'Manrope', sans-serif;

  /* layout */
  --maxw: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;

  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* atmospheric backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 78% -8%, rgba(233,196,106,0.10), transparent 60%),
    radial-gradient(800px 700px at 8% 12%, rgba(127,169,255,0.06), transparent 55%);
  pointer-events: none;
}

::selection { background: var(--gold); color: #1a1500; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

h1,h2,h3,h4 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }

.eyebrow {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section { padding: clamp(72px, 11vw, 140px) 0; position: relative; }

.muted { color: var(--fg-mute); }
.soft  { color: var(--fg-soft); }
.gold  { color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  border-radius: 999px;
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }

.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: #1a1400;
  box-shadow: 0 0 0 1px rgba(233,196,106,0.4), 0 14px 34px -14px var(--gold-glow);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(233,196,106,0.6), 0 20px 44px -14px var(--gold-glow); }

.btn-ghost {
  background: rgba(255,255,255,0.03);
  border-color: var(--line-2);
  color: var(--fg);
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); border-color: var(--gold); }

.btn-lg { padding: 17px 32px; font-size: 16px; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .3s var(--ease), border-color .3s var(--ease), backdrop-filter .3s;
}
.nav.scrolled {
  background: rgba(7,8,10,0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
/* Authenticated app pages keep a solid header background at all scroll
   positions (matches auth.css), so the header doesn't start transparent
   and only "fill in" after scrolling. */
.nav--authed {
  background: rgba(7,8,10,0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav-inner {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand .mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep));
  display: grid; place-items: center;
  color: #1a1400;
  font-size: 16px;
  box-shadow: 0 0 0 1px rgba(233,196,106,0.4), 0 8px 22px -10px var(--gold-glow);
}
.brand .mark svg { width: 17px; height: 17px; }
.brand b { color: var(--gold); font-weight: 700; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg-soft);
  padding: 9px 15px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--fg); background: rgba(255,255,255,0.05); }
.nav-links a.active { color: var(--gold); }
.nav-links a.nav-mobile-only { display: none; }

.nav-right { display: flex; align-items: center; gap: 14px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 42px; height: 42px; border-radius: 10px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--fg); margin: 4px auto; transition: .3s; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  padding: 70px 0 38px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h5 {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 18px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer ul a { color: var(--fg-mute); font-size: 14.5px; font-weight: 500; transition: color .2s; }
.footer ul a:hover { color: var(--gold); }
.footer-bottom {
  margin-top: 54px; padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  flex-wrap: wrap;
  color: var(--fg-faint); font-size: 13.5px;
}

/* ---------- cards / shared bits ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.card:hover { border-color: var(--line-2); transform: translateY(-3px); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  font-family: var(--display); letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.03);
  color: var(--fg-soft);
}
.tag {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px;
  border: 1px solid rgba(233,196,106,0.25); background: var(--gold-glow); color: var(--gold);
  font-family: var(--display); font-size: 12px; font-weight: 600;
}
.tag.admin { border-color: rgba(127,169,255,0.25); color: #9bc0ff; background: rgba(127,169,255,0.08); }

/* striped image placeholder */
.ph {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0 10px, transparent 10px 20px),
    var(--surface);
  display: grid; place-items: center;
  overflow: hidden;
}
.ph .ph-label {
  font-family: 'Space Grotesk', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  padding: 6px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: rgba(7,8,10,0.5);
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* section heading block */
.head { max-width: 720px; }
.head h2 { font-size: clamp(30px, 4.4vw, 52px); margin: 18px 0 0; }
.head h2 + p { margin-top: 20px; font-size: 18px; color: var(--fg-soft); }
.head.center { margin-inline: auto; text-align: center; }
.head.center .eyebrow::before { display: none; }

/* responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .sidebar-toggle { display: flex !important; }
  .nav-right {
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .nav-right > .pill,
  .nav-right > .tag {
    display: none;
  }
  .nav-right .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
  .nav.open .nav-links {
    display: flex; flex-direction: column;
    position: fixed; top: 74px; left: 0; right: 0; width: 100vw; max-width: 100vw;
    background: rgba(7,8,10,0.96); backdrop-filter: blur(16px);
    padding: 18px; gap: 8px; border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 74px);
    overflow: auto;
  }
  .nav.open .nav-links a {
    padding: 14px 16px;
    width: 100%;
    justify-content: flex-start;
  }
  .nav.open .nav-links a.nav-mobile-only { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Hide public nav links on authenticated pages */
.nav--authed .nav-links { display: none !important; }


/* ═══════════════════════════════════════════════════════════
   SIDEBAR NAV  —  mobile + desktop (hamburger on all sizes)
   ═══════════════════════════════════════════════════════════ */

/* Hamburger toggle — shown on all screen sizes for authed pages */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  border: none;
  background: none;
  color: var(--fg-soft,#c3c5ca);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s, color .18s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.07); color: #f6f5f1; }
/* Brand stays left, nav-right pushed right */
.nav-inner:has(.sidebar-toggle) .brand,
.nav-slim:has(.sidebar-toggle) .brand { margin-right: auto; }

/* Dim overlay */
.sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.sidebar-overlay.sidebar-overlay--open { opacity: 1; pointer-events: auto; }

/* Slide-in panel */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 272px;
  background: #111419;
  border-right: 1px solid rgba(255,255,255,0.09);
  z-index: 410;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
  display: flex;
  flex-direction: column;
}
.sidebar.sidebar--open { transform: translateX(0); }

/* Panel header */
.sidebar-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute,#8b8e96);
}
.sidebar-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #8b8e96;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .18s, color .18s;
}
.sidebar-close:hover { background: rgba(255,255,255,0.12); color: #f6f5f1; }

/* Account block */
.sidebar-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-account-av {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg,#e9c46a,#b8902a);
  display: grid; place-items: center;
  color: #1a1400;
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.sidebar-account-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-account-info b {
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-size: 14px; font-weight: 700; color: #f6f5f1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-account-info span { font-size: 12px; color: #5c5f67; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav links */
.sidebar-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #c3c5ca;
  text-decoration: none;
  font-family: var(--display,"Space Grotesk",sans-serif);
  font-size: 14px;
  font-weight: 600;
  transition: background .16s, color .16s;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: #f6f5f1; }
.sidebar-item.sidebar--active { background: rgba(233,196,106,0.1); color: #e9c46a; }
.sidebar-item.sidebar--active svg { color: #e9c46a; }
.sidebar-item svg { width: 18px; height: 18px; color: #5c5f67; flex-shrink: 0; transition: color .16s; }
.sidebar-item:hover svg { color: #8b8e96; }

/* Footer — Sign Out */
.sidebar-foot {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-item--danger { color: #f06a6a; }
.sidebar-item--danger svg { color: #f06a6a; }
.sidebar-item--danger:hover { background: rgba(240,106,106,0.1); color: #f06a6a; }
.sidebar-item--danger:hover svg { color: #f06a6a; }

/* Admin-only nav items — hidden until role:admin is confirmed */
[data-admin-only] { display: none !important; }
[data-admin-only].admin-visible { display: flex !important; }

/* Student+admin nav items — hidden until role:student or role:admin is confirmed */
[data-student-only] { display: none !important; }
[data-student-only].student-visible { display: flex !important; }
