/*
 * Korra AI — MTN-Inspired Corporate Theme System
 * ================================================
 * Clean, corporate design inspired by MTN Group's modern web style.
 * Bold typography, solid backgrounds, minimal decoration.
 *
 * Include via: <link rel="stylesheet" href="/assets/theme.css">
 * Toggle: include assets/theme-toggle.js and add <theme-toggle></theme-toggle> in header.
 */

/* ─── DARK MODE (default) ─────────────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  /* Backgrounds — solid, no glassmorphism */
  --bg-deep:        #050505;
  --bg-base:        #0A0A0A;
  --bg-surface:     #141414;
  --bg-elevated:    #1A1A1A;
  --bg-hover:       #222222;

  /* Text */
  --text-primary:   #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-muted:     #666666;
  --text-inverse:   #050505;

  /* Borders — clean, subtle */
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong:  rgba(255, 255, 255, 0.2);
  --border-subtle:  rgba(255, 255, 255, 0.05);

  /* Accent / Brand — Korra Mint */
  --accent:         #C6FF00;
  --accent-hover:   #D4FF33;
  --accent-text:    #050505;
  --accent-gold:    #FFC247;

  /* Semantic */
  --error:          #D63031;
  --success:        #22c55e;
  --warning:        #eab308;
  --info:           #3b82f6;

  /* Shadows — clean, minimal */
  --shadow-1:       0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-2:       0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-3:       0 16px 64px rgba(0, 0, 0, 0.5);

  /* Header — solid, no blur */
  --header-bg:      #050505;
  --header-border:  rgba(255, 255, 255, 0.08);
  --nav-text:       rgba(255, 255, 255, 0.6);
  --nav-text-active: #FFFFFF;

  /* Input */
  --input-bg:       rgba(255, 255, 255, 0.06);
  --input-border:   rgba(255, 255, 255, 0.12);
  --input-focus:    #C6FF00;
  --input-text:     #FFFFFF;
  --input-placeholder: #666666;

  /* Badge */
  --badge-bg:       rgba(198, 255, 0, 0.12);
  --badge-text:     #C6FF00;

  /* Overlay */
  --overlay:        rgba(0, 0, 0, 0.6);
  --backdrop:       rgba(0, 0, 0, 0.4);

  /* Scrollbar */
  --scrollbar-track: #0A0A0A;
  --scrollbar-thumb: #333;

  /* Card */
  --card-bg:        #141414;
  --card-border:    rgba(255, 255, 255, 0.08);
  --card-radius:    16px;

  /* Spacing */
  --s-8: 8px; --s-16: 16px; --s-24: 24px; --s-32: 32px;
  --s-48: 48px; --s-64: 64px; --s-80: 80px; --s-120: 120px;
  --s-160: 160px; --s-200: 200px;

  /* Radius */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 999px;

  /* Section backgrounds for alternating */
  --section-alt:    #0A0A0A;
  --section-dark:   #050505;
}

/* ─── LIGHT MODE ──────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-deep:        #FFFFFF;
  --bg-base:        #F7F8FA;
  --bg-surface:     #FFFFFF;
  --bg-elevated:    #FFFFFF;
  --bg-hover:       #F1F3F5;

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --text-inverse:   #FFFFFF;

  --border-default: rgba(0, 0, 0, 0.08);
  --border-strong:  rgba(0, 0, 0, 0.15);
  --border-subtle:  rgba(0, 0, 0, 0.04);

  --accent:         #C6FF00;
  --accent-hover:   #B8F000;
  --accent-text:    #050505;
  --accent-gold:    #FFC247;

  --error:          #D63031;
  --success:        #16a34a;
  --warning:        #ca8a04;
  --info:           #2563eb;

  --shadow-1:       0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-2:       0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-3:       0 16px 64px rgba(0, 0, 0, 0.12);

  --header-bg:      #FFFFFF;
  --header-border:  rgba(0, 0, 0, 0.08);
  --nav-text:       rgba(15, 23, 42, 0.6);
  --nav-text-active: #0F172A;

  --input-bg:       #F7F8FA;
  --input-border:   rgba(0, 0, 0, 0.12);
  --input-focus:    #C6FF00;
  --input-text:     #0F172A;
  --input-placeholder: #94A3B8;

  --badge-bg:       rgba(198, 255, 0, 0.15);
  --badge-text:     #5A6B00;

  --overlay:        rgba(0, 0, 0, 0.4);
  --backdrop:       rgba(0, 0, 0, 0.2);

  --scrollbar-track: #F7F8FA;
  --scrollbar-thumb: #CBD5E1;

  --card-bg:        #FFFFFF;
  --card-border:    rgba(0, 0, 0, 0.08);
  --card-radius:    16px;

  --section-alt:    #F7F8FA;
  --section-dark:   #0F172A;

  /* Legacy compat */
  --Obsidian:       #0F172A;
  --Obsidian-Deep:  #0F172A;
  --Mint:           #C6FF00;
  --Accent-Teal:    #C6FF00;
  --Glass:          rgba(0, 0, 0, 0.02);
  --Glass-Border:   rgba(0, 0, 0, 0.08);
  --Neutral-400:    #475569;
  --Neutral-500:    #94A3B8;
  --White:          #0F172A;
  --Surface-Soft:   #FFFFFF;
}

/* ─── LEGACY COMPATIBILITY ────────────────────────────────────────────────── */
:root {
  --Obsidian:       var(--bg-deep);
  --Obsidian-Deep:  var(--bg-deep);
  --Obsidian-Layer: var(--bg-base);
  --Mint:           var(--accent);
  --Accent-Teal:    var(--accent);
  --Lemon:          var(--accent);
  --Teal-900:       #002D2A;
  --Glass:          var(--bg-surface);
  --Glass-Border:   var(--border-default);
  --Neutral-400:    var(--text-secondary);
  --Neutral-500:    var(--text-muted);
  --White:          var(--text-primary);
  --Error:          var(--error);
  --Surface-Soft:   var(--bg-surface);
  --Elev-1:         var(--shadow-1);
  --Elev-2:         var(--shadow-2);
  --Elev-3:         var(--shadow-3);
  --S-8: var(--s-8); --S-16: var(--s-16); --S-24: var(--s-24);
  --S-32: var(--s-32); --S-48: var(--s-48); --S-64: var(--s-64);
  --S-80: var(--s-80); --S-120: var(--s-120); --S-160: var(--s-160);
  --S-200: var(--s-200);
  --Radius-S: var(--radius-s);
  --Radius-M: var(--radius-m);
  --Radius-L: var(--radius-l);
  --Radius-XL: var(--radius-xl);
}

/* ─── SYSTEM PREFERENCE ───────────────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-deep: #FFFFFF; --bg-base: #F7F8FA; --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF; --bg-hover: #F1F3F5;
    --text-primary: #0F172A; --text-secondary: #475569; --text-muted: #94A3B8; --text-inverse: #FFFFFF;
    --border-default: rgba(0,0,0,0.08); --border-strong: rgba(0,0,0,0.15); --border-subtle: rgba(0,0,0,0.04);
    --accent: #C6FF00; --accent-hover: #B8F000; --accent-text: #050505;
    --shadow-1: 0 2px 12px rgba(0,0,0,0.06); --shadow-2: 0 8px 32px rgba(0,0,0,0.08); --shadow-3: 0 16px 64px rgba(0,0,0,0.12);
    --header-bg: #FFFFFF; --header-border: rgba(0,0,0,0.08);
    --nav-text: rgba(15,23,42,0.6); --nav-text-active: #0F172A;
    --input-bg: #F7F8FA; --input-border: rgba(0,0,0,0.12); --input-text: #0F172A; --input-placeholder: #94A3B8;
    --badge-bg: rgba(198,255,0,0.15); --badge-text: #5A6B00;
    --scrollbar-track: #F7F8FA; --scrollbar-thumb: #CBD5E1;
    --card-bg: #FFFFFF; --card-border: rgba(0,0,0,0.08);
    --section-alt: #F7F8FA; --section-dark: #0F172A;
    --Obsidian: #0F172A; --Obsidian-Deep: #0F172A; --Mint: #C6FF00;
    --Glass: rgba(0,0,0,0.02); --Glass-Border: rgba(0,0,0,0.08);
    --Neutral-400: #475569; --Neutral-500: #94A3B8; --White: #0F172A; --Surface-Soft: #FFFFFF;
  }
}

/* ─── BASE ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  transition: background-color 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::selection { background: var(--accent); color: var(--accent-text); }

/* ─── HEADER — MTN Style ─────────────────────────────────────────────────── */
header {
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999999;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  transition: background 0.3s ease;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  min-width: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  z-index: 1000001;
  flex-shrink: 0;
}
.logo img { height: 36px; width: auto; }
.logo span { font-size: 20px; font-weight: 900; letter-spacing: -0.03em; color: var(--text-primary); }

/* Nav — clean horizontal */
nav.main-nav {
  display: flex;
  gap: 32px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
nav.main-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--nav-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: color 0.2s ease;
  padding: 8px 0;
}
nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--accent);
}
[data-theme="light"] nav.main-nav a:hover,
[data-theme="light"] nav.main-nav a.active {
  color: var(--nav-text-active);
}

/* Header auth */
.header-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000001;
  flex-shrink: 0;
  max-width: fit-content;
}

/* ─── BUTTONS — MTN Style ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  padding: 12px 28px;
  height: 44px;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(198, 255, 0, 0.25);
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  padding: 12px 28px;
  height: 44px;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="light"] .btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 12px 28px;
  height: 44px;
}
.btn-ghost:hover { color: var(--text-primary); }

/* ─── CONTAINER ───────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.container-wide { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 32px; }

/* ─── SECTIONS — MTN alternating style ────────────────────────────────────── */
.section-dark { background: var(--section-dark); }
.section-alt { background: var(--section-alt); }
.section-accent { background: var(--accent); color: var(--accent-text); }

/* ─── TYPOGRAPHY — MTN bold style ─────────────────────────────────────────── */
.heading-xl {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.heading-lg {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.heading-md {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.heading-sm {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.body-lg { font-size: 18px; line-height: 1.7; color: var(--text-secondary); }
.body-md { font-size: 16px; line-height: 1.6; color: var(--text-secondary); }
.body-sm { font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

/* ─── CARDS — MTN clean style ─────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 32px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
  transform: translateY(-2px);
}
.card-flat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 32px;
}
.card-accent {
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--card-radius);
  padding: 32px;
}

/* ─── STATS — MTN large numbers ───────────────────────────────────────────── */
.stat-number {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.stat-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ─── SECTION EYEBROW ─────────────────────────────────────────────────────── */
.section-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
}
[data-theme="light"] .section-eyebrow {
  color: var(--accent-text);
}

/* ─── DIVIDER ─────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-default);
  border: none;
  margin: 0;
}

/* ─── GRID LAYOUTS ────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ─── INPUTS ──────────────────────────────────────────────────────────────── */
input, textarea, select {
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(198, 255, 0, 0.12);
}
input::placeholder, textarea::placeholder { color: var(--input-placeholder); }

/* ─── BADGE ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: var(--radius-xl);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── MOBILE MENU ─────────────────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 40px;
  transform: translateY(-100%);
  transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
}
.mobile-menu.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mobile-menu a {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000002;
}
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 1000001;
  position: relative;
}
.hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── FOOTER — MTN corporate style ────────────────────────────────────────── */
.footer {
  background: var(--section-dark);
  border-top: 1px solid var(--border-default);
  padding: 80px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 60px;
}
.footer-brand p { color: var(--text-muted); font-size: 14px; line-height: 1.7; margin-top: 16px; max-width: 300px; }
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border-default);
  font-size: 13px;
  color: var(--text-muted);
}
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--text-muted); transition: color 0.2s; }
.footer-social a:hover { color: var(--accent); }

/* ─── UTILITIES ───────────────────────────────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  nav.main-nav { display: none !important; }
  .hamburger { display: flex; }
  #authButtons { display: none !important; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 0 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ─── TRANSITIONS ─────────────────────────────────────────────────────────── */
.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}
