/* ============================================
   🎮 Mängude Õppeplaan — CSS
   Tailwind-inspired utility + custom design system
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors — Dark theme by default */
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2744;
  --bg-accent: #0a0a1a;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-heading: #f1f5f9;

  --accent-green: #22c55e;
  --accent-green-glow: rgba(34, 197, 94, 0.15);
  --accent-yellow: #eab308;
  --accent-yellow-glow: rgba(234, 179, 8, 0.15);
  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.15);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.15);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.15);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.15);
  --accent-cyan: #06b6d4;

  --border-color: #1e293b;
  --border-light: #334155;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  --gradient-card: linear-gradient(145deg, #16213e 0%, #1a1a2e 100%);
  --gradient-green: linear-gradient(135deg, #22c55e, #16a34a);
  --gradient-yellow: linear-gradient(135deg, #eab308, #ca8a04);
  --gradient-orange: linear-gradient(135deg, #f97316, #ea580c);
  --gradient-red: linear-gradient(135deg, #ef4444, #dc2626);
  --gradient-purple: linear-gradient(135deg, #a855f7, #9333ea);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow-green: 0 0 20px rgba(34, 197, 94, 0.2);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.2);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Container */
  --container-max: 1200px;
  --sidebar-width: 280px;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-accent: #e2e8f0;

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-heading: #0f172a;

  --border-color: #e2e8f0;
  --border-light: #cbd5e1;

  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-blue);
}

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Layout --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* --- Navigation / Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 35, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
}

[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
}

.site-logo .logo-icon {
  font-size: 1.5rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.header-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text-heading);
  background: var(--bg-card);
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
}

/* --- Hero Section --- */
.hero {
  background: var(--gradient-hero);
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(34, 197, 94, 0.05), transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.05), transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.hero-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* CTA buttons */
.cta-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

/* --- Progress Bar (Global) --- */
.progress-section {
  padding: var(--space-xl) 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.progress-bar-wrapper {
  background: var(--bg-accent);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan), var(--accent-blue));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Roadmap / Modules Section --- */
.modules-section {
  padding: var(--space-3xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Level Group */
.level-group {
  margin-bottom: var(--space-3xl);
}

.level-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-color);
}

.level-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.level-badge.green { background: var(--accent-green-glow); }
.level-badge.yellow { background: var(--accent-yellow-glow); }
.level-badge.orange { background: var(--accent-orange-glow); }
.level-badge.red { background: var(--accent-red-glow); }
.level-badge.purple { background: var(--accent-purple-glow); }

.level-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
}

.level-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Module Cards Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

/* Module Card */
.module-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.module-card.green::before { background: var(--gradient-green); }
.module-card.yellow::before { background: var(--gradient-yellow); }
.module-card.orange::before { background: var(--gradient-orange); }
.module-card.red::before { background: var(--gradient-red); }
.module-card.purple::before { background: var(--gradient-purple); }

.module-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.module-card.green:hover { box-shadow: var(--shadow-glow-green); }

.module-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.05em;
}

.module-card h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
  line-height: 1.35;
}

.module-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.module-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-accent);
  color: var(--text-muted);
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.module-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.exercise-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.module-status {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.module-status.not-started {
  background: var(--bg-accent);
  color: var(--text-muted);
}

.module-status.in-progress {
  background: var(--accent-yellow-glow);
  color: var(--accent-yellow);
}

.module-status.completed {
  background: var(--accent-green-glow);
  color: var(--accent-green);
}

/* --- Module Detail Page --- */
.module-page {
  padding: var(--space-2xl) 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent-cyan);
}

.breadcrumb .separator {
  color: var(--border-light);
}

.module-hero {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
}

.module-hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: var(--space-sm);
}

.module-hero .module-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
}

.module-meta {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Content sections */
.content-section {
  margin-bottom: var(--space-2xl);
}

.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.content-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: var(--space-lg) 0 var(--space-md);
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

/* Exercise List */
.exercise-list {
  list-style: none;
  counter-reset: exercise;
}

.exercise-item {
  counter-increment: exercise;
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.exercise-item:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.exercise-checkbox {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  background: transparent;
  color: transparent;
  font-size: 0.85rem;
  margin-top: 2px;
}

.exercise-checkbox:hover {
  border-color: var(--accent-green);
}

.exercise-checkbox.checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

.exercise-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--space-xs);
}

.exercise-content h4::before {
  content: counter(exercise) ". ";
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.exercise-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Code blocks */
.code-block {
  background: var(--bg-accent);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: var(--space-md) 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.code-lang {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.code-copy {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-copy:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.code-block pre {
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.code-block code {
  font-family: var(--font-mono);
}

/* Inline code */
code:not([class]) {
  background: var(--bg-accent);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
}

/* Info / Tip / Warning boxes */
.callout {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  margin: var(--space-md) 0;
  border-left: 4px solid;
  display: flex;
  gap: var(--space-md);
}

.callout-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  margin-top: 2px;
}

.callout.info {
  background: var(--accent-blue-glow);
  border-color: var(--accent-blue);
}

.callout.tip {
  background: var(--accent-green-glow);
  border-color: var(--accent-green);
}

.callout.warning {
  background: var(--accent-yellow-glow);
  border-color: var(--accent-yellow);
}

.callout.danger {
  background: var(--accent-red-glow);
  border-color: var(--accent-red);
}

.callout p {
  font-size: 0.875rem;
  margin: 0;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* --- Search --- */
.search-wrapper {
  position: relative;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.1s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.2s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.3s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: var(--space-lg);
  }

  .hero {
    padding: var(--space-2xl) 0;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .level-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .module-card {
    padding: var(--space-lg);
  }
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.hidden { display: none !important; }
