/* =============================================
   SpeakUp Mongolia - Main Stylesheet
   ============================================= */

/* --- Root Variables --- */
:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --secondary: #06b6d4;
  --secondary-light: #67e8f9;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --bg: #0f172a;
  --bg-2: #1e293b;
  --bg-3: #243044;
  --card: #1e293b;
  --card-hover: #243550;
  --border: #334155;
  --border-light: #475569;

  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,.3);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.5);

  --nav-height: 70px;
  --transition: .25s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary-light); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(15,23,42,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.05);
  z-index: 1000;
  transition: all var(--transition);
}
.navbar.scrolled {
  background: rgba(15,23,42,.98);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-icon { font-size: 1.5rem; }
.brand-text { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.brand-accent { color: var(--primary-light); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
}

.nav-link {
  padding: .5rem .85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.07); }

.btn-nav {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff !important;
  border-radius: 20px;
  padding: .45rem 1.1rem !important;
}
.btn-nav:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(79,70,229,.4); }

.btn-nav-outline {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .45rem 1.1rem !important;
}
.btn-nav-outline:hover { border-color: var(--primary-light); color: var(--primary-light) !important; }

.admin-link { color: var(--accent) !important; }
.admin-link:hover { background: rgba(245,158,11,.1) !important; }

/* User menu */
.nav-user { position: relative; }
.user-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-size: .9rem;
  font-family: var(--font);
  transition: all var(--transition);
}
.user-btn:hover { background: rgba(255,255,255,.1); border-color: var(--primary-light); }
.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem; color: #fff;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 140px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all .2s ease;
}
.nav-user:hover .user-dropdown, .user-dropdown:hover {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.user-dropdown a {
  display: block;
  padding: .6rem 1rem;
  color: var(--text-muted);
  font-size: .9rem;
  transition: all var(--transition);
}
.user-dropdown a:hover { background: rgba(255,255,255,.05); color: var(--text); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1;
  padding-top: var(--nav-height);
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: 4rem 1.5rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(79,70,229,.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6,182,212,.15) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(245,158,11,.08) 0%, transparent 40%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  0% { opacity: .7; }
  100% { opacity: 1; }
}

/* Floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: floatOrb 6s ease-in-out infinite alternate;
}
.orb-1 { width: 400px; height: 400px; background: rgba(79,70,229,.12); top: -100px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: rgba(6,182,212,.1); bottom: -50px; right: -50px; animation-delay: 2s; }
.orb-3 { width: 200px; height: 200px; background: rgba(245,158,11,.08); top: 50%; left: 60%; animation-delay: 4s; }
@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.1); }
}

/* Grid pattern */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(79,70,229,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(79,70,229,.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.8) 0%, transparent 70%);
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem 1rem;
  background: rgba(79,70,229,.15);
  border: 1px solid rgba(79,70,229,.3);
  border-radius: 20px;
  font-size: .85rem;
  color: var(--primary-light);
  font-weight: 600;
  margin-bottom: 1.5rem;
  animation: fadeSlide .8s ease .2s both;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.2rem;
  animation: fadeSlide .8s ease .3s both;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
  animation: fadeSlide .8s ease .4s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeSlide .8s ease .5s both;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  animation: fadeSlide .8s ease .6s both;
}
.stat-item { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--primary-light); }
.stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* Hero visual card */
.hero-visual {
  animation: fadeSlide .8s ease .3s both;
}
.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(79,70,229,.3), rgba(6,182,212,.2));
  z-index: -1;
}
.card-header-viz {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.card-dots { display: flex; gap: .4rem; }
.card-dots span { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }
.card-title-bar { font-size: .85rem; color: var(--text-muted); }

.lesson-preview-list { display: flex; flex-direction: column; gap: .75rem; }
.lesson-preview-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.lesson-preview-item:hover { border-color: var(--primary); background: rgba(79,70,229,.1); transform: translateX(4px); }
.lesson-preview-item.active { border-color: var(--primary); background: rgba(79,70,229,.12); }
.lpi-icon { font-size: 1.4rem; flex-shrink: 0; }
.lpi-info { flex: 1; }
.lpi-title { font-size: .9rem; font-weight: 600; }
.lpi-level { font-size: .75rem; color: var(--text-muted); }
.lpi-status { font-size: .8rem; }

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 40px;
  margin-top: 1.2rem;
  padding: .75rem;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
}
.wave-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary), var(--secondary));
  border-radius: 2px;
  animation: wave 1.5s ease-in-out infinite;
  min-height: 4px;
}
@keyframes wave {
  0%, 100% { height: 40%; }
  50% { height: 90%; }
}
.wave-bar:nth-child(2) { animation-delay: .1s; }
.wave-bar:nth-child(3) { animation-delay: .2s; }
.wave-bar:nth-child(4) { animation-delay: .3s; }
.wave-bar:nth-child(5) { animation-delay: .4s; }
.wave-bar:nth-child(6) { animation-delay: .5s; }
.wave-bar:nth-child(7) { animation-delay: .6s; }
.wave-bar:nth-child(8) { animation-delay: .7s; }
.wave-bar:nth-child(9) { animation-delay: .8s; }
.wave-bar:nth-child(10) { animation-delay: .9s; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(79,70,229,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(79,70,229,.5); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); transform: translateY(-2px); }

.btn-secondary {
  background: rgba(255,255,255,.07);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; transform: translateY(-2px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-2px); }

.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; border-radius: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* =============================================
   SECTION STYLES
   ============================================= */
section { padding: 5rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; width: 100%; }

.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
  display: inline-block;
  padding: .35rem .9rem;
  background: rgba(79,70,229,.15);
  border: 1px solid rgba(79,70,229,.25);
  border-radius: 20px;
  font-size: .8rem;
  color: var(--primary-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: .75rem;
}
.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* =============================================
   BENEFITS SECTION
   ============================================= */
.benefits-section { background: var(--bg); }

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.benefit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.benefit-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,70,229,.05), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.benefit-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: 0 20px 40px rgba(0,0,0,.3), 0 0 0 1px rgba(79,70,229,.2); }
.benefit-card:hover::after { opacity: 1; }

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}
.benefit-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; color: var(--text); }
.benefit-desc { font-size: .9rem; color: var(--text-muted); line-height: 1.6; }

/* =============================================
   LEVELS SECTION
   ============================================= */
.levels-section {
  background: var(--bg-2);
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.level-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all .3s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.level-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.level-card.beginner::before { background: linear-gradient(90deg, #10b981, #34d399); }
.level-card.intermediate::before { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.level-card.advanced::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.level-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.level-card.beginner:hover { border-color: #10b981; }
.level-card.intermediate:hover { border-color: #f59e0b; }
.level-card.advanced:hover { border-color: #ef4444; }

.level-icon { font-size: 3rem; margin-bottom: 1rem; }
.level-name { font-size: 1.2rem; font-weight: 800; margin-bottom: .5rem; }
.level-mn { font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem; }
.level-count {
  display: inline-block;
  padding: .3rem .8rem;
  background: rgba(255,255,255,.08);
  border-radius: 20px;
  font-size: .8rem;
  color: var(--text-muted);
}

/* =============================================
   LESSONS GRID
   ============================================= */
.lessons-page { background: var(--bg); padding: 2rem 1.5rem 5rem; }

.lessons-filter {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: .5rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9rem;
  font-family: var(--font);
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(79,70,229,.12);
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.lesson-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s ease;
  display: flex;
  flex-direction: column;
}
.lesson-card:hover { transform: translateY(-6px); border-color: rgba(79,70,229,.5); box-shadow: 0 20px 40px rgba(0,0,0,.3); }

.lesson-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--bg-3);
}
.lesson-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.lesson-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }

.lesson-level {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.level-beginner { background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.2); }
.level-intermediate { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.2); }
.level-advanced { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.2); }

.lesson-title { font-size: 1.05rem; font-weight: 700; line-height: 1.4; color: var(--text); }
.lesson-desc { font-size: .88rem; color: var(--text-muted); line-height: 1.6; flex: 1; }
.lesson-footer { margin-top: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* =============================================
   LESSON DETAIL
   ============================================= */
.lesson-detail { padding: 2rem 1.5rem 5rem; }
.lesson-detail-container { max-width: 900px; margin: 0 auto; }

.breadcrumb { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; font-size: .9rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb span { color: var(--border-light); }

.video-wrapper {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}
.video-wrapper iframe { width: 100%; height: 100%; border: none; }
.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
}
.video-placeholder .play-icon { font-size: 4rem; opacity: .5; }

.practice-sentences-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.practice-sentences-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--primary-light); }
.sentence-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.sentence-item:last-child { border-bottom: none; }
.sentence-num { font-size: .75rem; color: var(--primary-light); font-weight: 700; flex-shrink: 0; margin-top: .15rem; }

/* =============================================
   PRACTICE PAGE
   ============================================= */
.practice-page { padding: 2rem 1.5rem 5rem; }
.practice-container { max-width: 800px; margin: 0 auto; }

.practice-header {
  text-align: center;
  margin-bottom: 3rem;
}

.practice-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.practice-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.question-number {
  font-size: .85rem;
  color: var(--primary-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1rem;
}
.question-text {
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .75rem;
  color: var(--text);
}
.question-category {
  display: inline-block;
  padding: .25rem .75rem;
  background: rgba(6,182,212,.12);
  border: 1px solid rgba(6,182,212,.2);
  border-radius: 20px;
  font-size: .8rem;
  color: var(--secondary-light);
  margin-bottom: 1.5rem;
}
.question-level {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .75rem;
  margin-left: .5rem;
}

.practice-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hint-box {
  background: rgba(79,70,229,.1);
  border: 1px solid rgba(79,70,229,.2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 1.5rem;
  text-align: left;
  display: none;
}
.hint-box.show { display: block; animation: fadeSlide .3s ease; }
.hint-box h4 { font-size: .9rem; color: var(--primary-light); margin-bottom: .5rem; }
.hint-box p { font-size: .9rem; color: var(--text-muted); }

.practice-filter-bar {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.question-transition {
  transition: opacity .3s ease, transform .3s ease;
}
.question-fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

/* Progress ring */
.progress-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto .5rem;
}
.progress-ring-text {
  text-align: center;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* =============================================
   FORMS
   ============================================= */
.form-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background-image:
    radial-gradient(circle at 20% 40%, rgba(79,70,229,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(6,182,212,.1) 0%, transparent 40%);
}

.form-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .5s ease;
}

.form-logo { text-align: center; margin-bottom: 2rem; }
.form-logo .logo-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.form-logo h2 { font-size: 1.5rem; font-weight: 800; }
.form-logo p { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }

.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .5rem;
}
.form-input {
  width: 100%;
  padding: .8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.2); }
.form-input::placeholder { color: var(--text-dim); }

.form-select {
  width: 100%;
  padding: .8rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .95rem;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.5rem;
}
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.2); }

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--text-muted);
}
.form-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-dim);
  font-size: .85rem;
}
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Alert / messages */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: .9rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: #6ee7b7; }
.alert-info { background: rgba(79,70,229,.12); border: 1px solid rgba(79,70,229,.25); color: var(--primary-light); }

/* =============================================
   PROGRESS PAGE
   ============================================= */
.progress-page { padding: 2rem 1.5rem 5rem; }
.progress-container { max-width: 900px; margin: 0 auto; }

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--primary-light); margin-bottom: .25rem; }
.stat-card .label { font-size: .85rem; color: var(--text-muted); }

/* =============================================
   ADMIN PANEL
   ============================================= */
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-height));
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}
.sidebar-title {
  padding: 0 1.25rem 1rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  margin-bottom: .75rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-left-color: var(--primary);
}

.admin-content { flex: 1; padding: 2rem; overflow-y: auto; }

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.admin-card-title { font-size: 1.05rem; font-weight: 700; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  background: var(--bg-3);
  padding: .75rem 1rem;
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text);
  vertical-align: top;
}
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.dash-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.dash-stat .ds-num { font-size: 2.5rem; font-weight: 800; color: var(--primary-light); line-height: 1; margin-bottom: .5rem; }
.dash-stat .ds-label { font-size: .85rem; color: var(--text-muted); }
.dash-stat .ds-icon { position: absolute; right: 1rem; top: 1rem; font-size: 2rem; opacity: .15; }

/* =============================================
   FEATURED LESSONS HOMEPAGE SECTION
   ============================================= */
.featured-section { background: var(--bg-2); }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.view-all-wrap { text-align: center; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 4rem 1.5rem 1.5rem;
  margin-top: auto;
}
.footer-container { max-width: 1200px; margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer-logo { font-size: 1.2rem; font-weight: 800; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.footer-brand p { font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1rem; }
.footer-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.badge { padding: .3rem .7rem; background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 20px; font-size: .78rem; color: var(--text-muted); }

.footer-links h4 { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 1rem; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: var(--text-muted); font-size: .9rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-tagline { color: var(--text-muted); }

/* =============================================
   SCROLL TO TOP
   ============================================= */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(79,70,229,.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
  z-index: 999;
}
.scroll-top.show { opacity: 1; transform: translateY(0); }
.scroll-top:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(79,70,229,.5); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}
.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.stagger > * { transition-delay: 0ms; }
.stagger > *:nth-child(1) { transition-delay: 0ms; }
.stagger > *:nth-child(2) { transition-delay: 80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }

/* =============================================
   LOADING SKELETON
   ============================================= */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-2) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  padding: .85rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  animation: slideIn .3s ease;
  max-width: 300px;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--primary); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-hero {
  background: linear-gradient(135deg, rgba(79,70,229,.12), rgba(6,182,212,.08));
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem;
  text-align: center;
}
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: .5rem; }
.page-hero p { color: var(--text-muted); font-size: 1rem; max-width: 600px; margin: 0 auto; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(15,23,42,.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    gap: .25rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all .3s ease;
  }
  .nav-menu.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-link { width: 100%; padding: .7rem 1rem; }

  .hero-container { grid-template-columns: 1fr; gap: 2rem; }
  .hero-visual { order: -1; }
  .hero-stats { gap: 1rem; }

  .levels-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; }
  .lessons-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  section { padding: 3rem 1rem; }
  .form-card { padding: 1.5rem; }
  .hero-actions { flex-direction: column; }
  .btn-lg { width: 100%; justify-content: center; }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
