/* ==========================================
   LEAN SIX SIGMA ACADEMY - DESIGN SYSTEM
   ========================================== */

/* CSS Variables - Design Tokens */
/* Light Mode (Default) */
:root {
  /* Colors */
  --color-primary: #1E3A5F;
  --color-primary-light: #2a4a73;
  --color-secondary: #0D9488;
  --color-secondary-light: #14B8A6;
  --color-accent: #F59E0B;
  --color-accent-light: #FBBF24;

  /* Light theme backgrounds */
  --bg-dark: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-light: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.9);

  /* Light theme text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
  --gradient-accent: linear-gradient(135deg, #0D9488 0%, #14B8A6 100%);
  --gradient-hero: linear-gradient(135deg, #1E3A5F 0%, #134E4A 50%, #0F766E 100%);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-blur: blur(12px);

  /* Quiz options - Light mode */
  --option-bg: #FFFFFF;
  --option-border: #CBD5E1;
  --option-hover-bg: #F1F5F9;
  --option-hover-border: #0D9488;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --fs-5xl: 3rem;
  --fs-6xl: 3.75rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Layout */
  --container-max: 1280px;
  --header-height: 72px;
}

/* Dark Mode */
[data-theme="dark"] {
  --color-secondary: #2DD4BF;
  --color-secondary-light: #5EEAD4;

  --bg-dark: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-light: #334155;
  --bg-card: rgba(30, 41, 59, 0.8);

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --gradient-hero: linear-gradient(135deg, #1E3A5F 0%, #0F172A 50%, #1E293B 100%);

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);

  /* Quiz options - Dark mode */
  --option-bg: #1E293B;
  --option-border: #475569;
  --option-hover-bg: #334155;
  --option-hover-border: #2DD4BF;

  --shadow-glow: 0 0 40px rgba(45, 212, 191, 0.3);
}

/* ==========================================
   RESET & BASE
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: var(--fs-5xl);
}

h2 {
  font-size: var(--fs-4xl);
}

h3 {
  font-size: var(--fs-3xl);
}

h4 {
  font-size: var(--fs-2xl);
}

h5 {
  font-size: var(--fs-xl);
}

h6 {
  font-size: var(--fs-lg);
}

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

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

a:hover {
  color: var(--color-secondary-light);
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
}

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

.nav-link {
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--color-secondary);
  border-radius: var(--radius-full);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--fs-2xl);
  cursor: pointer;
  padding: var(--space-2);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Theme toggle */
.theme-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--bg-surface-light);
  transform: scale(1.05);
}

/* Light mode: show sun, hide moon */
.theme-icon-dark {
  display: none;
}

/* Dark mode: show moon, hide sun */
[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: inline;
}

/* Auth button */
.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--gradient-accent);
  color: var(--bg-dark);
  font-weight: 600;
  font-size: var(--fs-sm);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
}

.auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
}

/* User menu - when logged in */
.user-menu {
  display: none;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  color: var(--bg-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--fs-sm);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  display: none;
  z-index: 1001;
}

.user-dropdown.open {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-surface-light);
  color: var(--text-primary);
}

.dropdown-item.danger {
  color: var(--error);
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-2) 0;
}

@media (max-width: 768px) {
  .user-name {
    display: none;
  }
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: var(--bg-dark);
  box-shadow: var(--shadow-md), 0 0 20px rgba(45, 212, 191, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(45, 212, 191, 0.4);
  color: var(--bg-dark);
}

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

.btn-secondary:hover {
  background: var(--bg-surface-light);
  border-color: var(--color-secondary);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--color-secondary);
  border: 2px solid var(--color-secondary);
}

.btn-outline:hover {
  background: var(--color-secondary);
  color: var(--bg-dark);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}

/* ==========================================
   CARDS
   ========================================== */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(45, 212, 191, 0.3);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
}

.card-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-2);
}

.card-description {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  background: var(--gradient-hero);
  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(45, 212, 191, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(30, 58, 95, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 40% 80%, rgba(45, 212, 191, 0.05) 0%, transparent 40%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-secondary);
  margin-bottom: var(--space-6);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, #F1F5F9 0%, #2DD4BF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--fs-xl);
  color: #94A3B8;
  margin-bottom: var(--space-8);
  max-width: 600px;
}

/* Text gradient utility - always white to teal for dark backgrounds */
.text-gradient {
  background: linear-gradient(135deg, #F1F5F9 0%, #2DD4BF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Animated background shapes */
.hero-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(45, 212, 191, 0.05));
  animation: float 20s ease-in-out infinite;
}

.shape-1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  bottom: -50px;
  left: 10%;
  animation-delay: -5s;
}

.shape-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  right: 20%;
  animation-delay: -10s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(20px, -20px) rotate(5deg);
  }

  50% {
    transform: translate(-10px, 20px) rotate(-5deg);
  }

  75% {
    transform: translate(15px, 10px) rotate(3deg);
  }
}

/* ==========================================
   FEATURES GRID
   ========================================== */
.features {
  background: var(--bg-dark);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.feature-card {
  text-align: center;
  padding: var(--space-8);
}

.feature-card .card-icon {
  margin: 0 auto var(--space-6);
  width: 64px;
  height: 64px;
  font-size: var(--fs-3xl);
}

/* ==========================================
   SECTION HEADERS
   ========================================== */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12);
}

.section-subtitle {
  color: var(--color-secondary);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-4);
}

.section-description {
  font-size: var(--fs-lg);
  color: var(--text-muted);
}

/* ==========================================
   QUIZ STYLES
   ========================================== */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.quiz-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.quiz-progress-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.quiz-question-card {
  padding: var(--space-8);
}

.quiz-category-badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: rgba(45, 212, 191, 0.1);
  color: var(--color-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.quiz-question {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-8);
  color: var(--text-primary);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--option-bg);
  border: 2px solid var(--option-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.quiz-option:hover {
  border-color: var(--option-hover-border);
  background: var(--option-hover-bg);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.quiz-option.selected {
  border-color: var(--color-secondary);
  background: rgba(13, 148, 136, 0.1);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

[data-theme="dark"] .quiz-option.selected {
  background: rgba(45, 212, 191, 0.15);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.quiz-option.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.quiz-option-letter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.quiz-option.selected .quiz-option-letter,
.quiz-option.correct .quiz-option-letter {
  background: var(--color-secondary);
  color: var(--bg-dark);
}

.quiz-option.incorrect .quiz-option-letter {
  background: var(--error);
  color: white;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-8);
}

.quiz-explanation {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
}

.quiz-explanation-title {
  font-weight: 700;
  color: var(--success);
  margin-bottom: var(--space-2);
}

/* Quiz Results */
.quiz-results {
  text-align: center;
  padding: var(--space-12);
}

.quiz-score-circle {
  width: 180px;
  height: 180px;
  margin: 0 auto var(--space-8);
  position: relative;
}

.quiz-score-circle svg {
  transform: rotate(-90deg);
}

.quiz-score-bg {
  fill: none;
  stroke: var(--bg-surface);
  stroke-width: 12;
}

.quiz-score-fill {
  fill: none;
  stroke: var(--color-secondary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1s ease-out;
}

.quiz-score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================
   COURSE STYLES
   ========================================== */

/* Courses Page Header */
.courses-header {
  background: var(--gradient-hero);
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-12);
  text-align: center;
  position: relative;
}

.courses-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(45, 212, 191, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Courses Main Content */
.courses-main {
  padding: var(--space-12) 0;
  background: var(--bg-dark);
  min-height: 60vh;
}

/* Learning Path Overview */
.learning-path {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-10);
  text-align: center;
}

.path-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.path-progress {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  max-width: 500px;
  margin: var(--space-6) auto 0;
}

.path-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.path-progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.path-progress-text {
  font-weight: 700;
  color: var(--color-secondary);
  font-size: var(--fs-lg);
  min-width: 50px;
}

/* Course Modules Container */
.course-modules {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Individual Course Module */
.course-module {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.course-module:hover {
  border-color: var(--color-secondary);
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.1);
}

/* Module Header */
.module-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.module-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.module-number {
  width: 48px;
  height: 48px;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xl);
  color: var(--bg-dark);
  flex-shrink: 0;
}

.module-info {
  flex: 1;
}

.module-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.module-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.module-toggle {
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: var(--fs-lg);
}

.module-toggle:hover {
  background: var(--bg-surface-light);
  color: var(--color-secondary);
}

/* Module Content (Expandable) */
.module-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--space-6);
  border-top: 1px solid transparent;
  transition: all 0.3s ease;
}

.module-content.active {
  max-height: 1000px;
  padding: var(--space-6);
  padding-top: var(--space-4);
  border-top-color: var(--glass-border);
}

/* Lesson List */
.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  transition: all var(--transition-fast);
}

.lesson-item:hover {
  background: var(--bg-surface-light);
}

.lesson-item:last-child {
  margin-bottom: 0;
}

.lesson-check {
  width: 24px;
  height: 24px;
  background: rgba(45, 212, 191, 0.1);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  color: var(--color-secondary);
  flex-shrink: 0;
}

.lesson-title {
  flex: 1;
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.lesson-duration {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--bg-surface-light);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

/* Module Badges */
.available-badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.locked-badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

/* Locked Module Styling */
.course-module.locked {
  opacity: 0.7;
}

.course-module.locked .module-number {
  background: var(--bg-surface);
  color: var(--text-muted);
}

/* Responsive Courses */
@media (max-width: 768px) {
  .module-header {
    padding: var(--space-4);
  }
  
  .module-number {
    width: 40px;
    height: 40px;
    font-size: var(--fs-base);
  }
  
  .module-title {
    font-size: var(--fs-base);
  }
  
  .module-meta {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  
  .lesson-item {
    padding: var(--space-2) var(--space-3);
  }
}

/* Course Cards Grid (for alternative layouts) */
.courses-grid {

  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.course-card {
  overflow: hidden;
}

.course-card-image {
  height: 160px;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-5xl);
  margin: calc(var(--space-6) * -1);
  margin-bottom: var(--space-6);
}

.course-card-content {
  padding-top: var(--space-4);
}

.course-card-meta {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.course-card-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.course-progress {
  margin-top: var(--space-4);
}

.course-progress-bar {
  height: 6px;
  background: var(--bg-dark);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.course-progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.course-progress-text {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ==========================================
   BLOG STYLES
   ========================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

.blog-card {
  overflow: hidden;
}

.blog-card-image {
  height: 200px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-light) 100%);
  margin: calc(var(--space-6) * -1);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-5xl);
}

.blog-card-category {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: rgba(45, 212, 191, 0.1);
  color: var(--color-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}

.blog-card-title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.blog-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ==========================================
   TEMPLATES STYLES
   ========================================== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.template-card {
  text-align: center;
}

.template-preview {
  height: 180px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 4rem;
  transition: transform var(--transition-base);
}

.template-card:hover .template-preview {
  transform: scale(1.02);
}

.template-format {
  display: inline-flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.template-format span {
  padding: var(--space-1) var(--space-2);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .logo {
  margin-bottom: var(--space-4);
}

.footer-brand p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.footer-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}

.footer-social a {
  color: var(--text-muted);
  font-size: var(--fs-xl);
  transition: color var(--transition-fast);
}

.footer-social a:hover {
  color: var(--color-secondary);
}

/* ==========================================
   UTILITIES
   ========================================== */
.text-center {
  text-align: center;
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-8 {
  margin-bottom: var(--space-8);
}

.hidden {
  display: none !important;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  padding: var(--space-4) var(--space-6);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: slideIn 0.3s ease;
  min-width: 300px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================
   MOBILE RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: var(--space-4);
    border-bottom: 1px solid var(--glass-border);
  }

  .nav.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: var(--space-4);
  }

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

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-lg {
    width: 100%;
  }

  h1 {
    font-size: var(--fs-4xl);
  }

  h2 {
    font-size: var(--fs-3xl);
  }

  h3 {
    font-size: var(--fs-2xl);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .quiz-question {
    font-size: var(--fs-xl);
  }

  .quiz-actions {
    flex-direction: column;
    gap: var(--space-3);
  }

  .quiz-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }

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

  .section {
    padding: var(--space-12) 0;
  }

  .quiz-question-card {
    padding: var(--space-4);
  }
}

/* ==========================================
   PAGE HEADERS - Force light text on dark backgrounds
   ========================================== */
/* These sections always have dark gradient backgrounds,
   so text must always be light regardless of theme */

.hero,
.quiz-page-header,
.courses-header,
.blog-header,
.templates-header {
  /* Force light text colors in headers that use dark gradients */
  --header-text-primary: #F1F5F9;
  --header-text-secondary: #94A3B8;
}

.hero p,
.quiz-page-header p,
.courses-header p,
.blog-header p,
.templates-header p {
  color: #94A3B8 !important;
}

.hero h1,
.quiz-page-header h1,
.courses-header h1,
.blog-header h1,
.templates-header h1 {
  background: linear-gradient(135deg, #F1F5F9 0%, #2DD4BF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================
   ACCESS CONTROL SYSTEM
   ========================================== */

/* Quiz Counter */
.quiz-counter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  position: relative;
  overflow: hidden;
}

.quiz-counter .counter-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: rgba(245, 158, 11, 0.1);
  transition: width var(--transition-base);
}

.quiz-counter.exhausted .counter-progress {
  background: rgba(239, 68, 68, 0.1);
}

.quiz-counter.authenticated {
  border-color: var(--color-secondary);
  background: rgba(45, 212, 191, 0.1);
}

.quiz-counter .counter-icon {
  font-size: 1.25rem;
  position: relative;
  z-index: 1;
}

.quiz-counter .counter-text {
  position: relative;
  z-index: 1;
  font-weight: 500;
}

.quiz-counter .counter-cta {
  position: relative;
  z-index: 1;
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
  margin-left: var(--space-2);
}

.quiz-counter .counter-cta:hover {
  text-decoration: underline;
}

/* Access Modal */
.access-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.access-modal.open {
  opacity: 1;
  pointer-events: all;
}

.access-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.access-modal-content {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  max-width: 480px;
  width: 100%;
  text-align: center;
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.access-modal.open .access-modal-content {
  transform: translateY(0);
}

.access-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  font-size: var(--fs-2xl);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.access-modal-close:hover {
  color: var(--text-primary);
}

.access-modal-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.access-modal-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.access-modal-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.access-modal-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  text-align: left;
  margin-bottom: var(--space-6);
}

.benefit-item {
  padding: var(--space-3);
  background: var(--bg-surface-light);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.access-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.access-modal-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-sm);
}

.access-modal-link:hover {
  color: var(--color-secondary);
}

.access-modal-note {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--glass-border);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Module Lock Overlay */
.module-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.course-module.locked:hover .module-lock-overlay {
  opacity: 1;
}

.course-module.locked {
  position: relative;
  pointer-events: auto;
  opacity: 0.8;
}

.lock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: white;
  text-align: center;
  padding: var(--space-4);
}

.lock-icon {
  font-size: 2rem;
}

.lock-text {
  font-weight: 600;
  font-size: var(--fs-sm);
}

/* Template Preview Badge */
.template-preview-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--warning);
  color: var(--bg-dark);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
}

@media (max-width: 480px) {
  .access-modal-content {
    padding: var(--space-6);
  }

  .access-modal-benefits {
    grid-template-columns: 1fr;
  }
}