:root {
  --bs-primary: #8B5CF6;
  --bs-primary-rgb: 139, 92, 246;
  --bs-secondary: #F59E0B;
  --bs-secondary-rgb: 245, 158, 11;
  --bs-success: #10B981;
  --bs-success-rgb: 16, 185, 129;
  --bs-danger: #EF4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-warning: #F59E0B;
  --bs-warning-rgb: 245, 158, 11;
  --bs-info: #06B6D4;
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: 1rem;
  --bs-border-radius-xl: 1.5rem;

  --color-purple: #8B5CF6;
  --color-purple-light: #EDE9FE;
  --color-orange: #F59E0B;
  --color-orange-light: #FEF3C7;
  --color-green: #10B981;
  --color-green-light: #D1FAE5;
  --color-blue: #3B82F6;
  --color-blue-light: #DBEAFE;
  --color-pink: #EC4899;
  --color-pink-light: #FCE7F3;

  --font-main: 'Nunito', sans-serif;
}

* {
  font-family: var(--font-main);
}

body {
  background-color: #FAFAFA;
  color: #1F2937;
}

/* ── Typography ── */
.fw-black { font-weight: 900; }
.fw-extrabold { font-weight: 800; }

/* ── Buttons ── */
.btn-primary {
  background-color: var(--color-purple);
  border-color: var(--color-purple);
  font-weight: 700;
}
.btn-primary:hover {
  background-color: #7C3AED;
  border-color: #7C3AED;
}
.btn-outline-primary {
  border-color: var(--color-purple);
  color: var(--color-purple);
  font-weight: 700;
}
.btn-outline-primary:hover {
  background-color: var(--color-purple);
  border-color: var(--color-purple);
}
.btn-lg { padding: 0.75rem 2rem; font-size: 1.1rem; }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.2rem; font-weight: 800; }

/* ── Navbar ── */
.navbar { padding: 0.75rem 0; }
.navbar-brand { font-weight: 900; font-size: 1.5rem !important; color: var(--color-purple) !important; }

/* ── Hero section ── */
.hero-section {
  background: linear-gradient(135deg, #EDE9FE 0%, #FEF3C7 50%, #DBEAFE 100%);
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

/* ── Stats section ── */
.stats-section { background: var(--color-purple); padding: 40px 0; }
.stat-item h3 { font-size: 2.5rem; font-weight: 900; color: #fff; }
.stat-item p { color: rgba(255,255,255,0.8); font-weight: 600; }

/* ── Category cards ── */
.category-card {
  border: none;
  border-radius: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
  overflow: hidden;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}
.category-card .card-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ── Course cards ── */
.course-card {
  border: 2px solid #E5E7EB;
  border-radius: 1rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.course-card:hover {
  border-color: var(--color-purple);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(139,92,246,0.15);
  color: inherit;
}

/* ── Lesson list ── */
.lesson-item {
  border: 2px solid #E5E7EB;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
  display: flex; align-items: center; gap: 1rem;
  color: inherit;
}
.lesson-item:hover { border-color: var(--color-purple); background: var(--color-purple-light); color: inherit; }
.lesson-item.completed { border-color: var(--color-green); background: var(--color-green-light); }

/* ── Exercise player ── */
.exercise-player {
  max-width: 700px;
  margin: 0 auto;
}
.exercise-card {
  border: none;
  border-radius: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  padding: 2rem;
}
.exercise-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #E5E7EB;
  overflow: hidden;
  margin-bottom: 2rem;
}
.exercise-progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-purple), var(--color-pink));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.question-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1F2937;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

/* ── MCQ choices ── */
.choice-btn {
  display: block; width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid #E5E7EB;
  border-radius: 1rem;
  background: #fff;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 0.75rem;
}
.choice-btn:hover:not(:disabled) {
  border-color: var(--color-purple);
  background: var(--color-purple-light);
  color: var(--color-purple);
}
.choice-btn.selected {
  border-color: var(--color-purple);
  background: var(--color-purple-light);
  color: var(--color-purple);
}
.choice-btn.correct {
  border-color: var(--color-green);
  background: var(--color-green-light);
  color: #065F46;
}
.choice-btn.incorrect {
  border-color: var(--color-danger, #EF4444);
  background: #FEE2E2;
  color: #991B1B;
}

/* ── Drag & Drop ── */
.drag-items-zone, .drop-targets-zone {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  padding: 1rem;
  border-radius: 1rem;
  min-height: 60px;
}
.drag-items-zone { background: #F3F4F6; }
.drag-item {
  padding: 0.5rem 1rem;
  background: var(--color-purple);
  color: #fff;
  border-radius: 0.5rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
  transition: opacity 0.2s, transform 0.15s;
}
.drag-item:active { cursor: grabbing; transform: scale(1.05); }
.drag-item.dragging { opacity: 0.5; }
.drop-target {
  flex: 1; min-width: 100px;
  border: 2px dashed #D1D5DB;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  color: #9CA3AF;
  transition: border-color 0.2s, background 0.2s;
  min-height: 50px;
  position: relative;
}
.drop-target.drag-over {
  border-color: var(--color-purple);
  background: var(--color-purple-light);
}
.drop-target .label { font-size: 0.8rem; color: #6B7280; margin-bottom: 0.25rem; }
.drop-target .dropped-item {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: var(--color-purple);
  color: #fff;
  border-radius: 0.4rem;
  font-weight: 700;
  cursor: pointer;
}
.drop-target.correct { border-color: var(--color-green); background: var(--color-green-light); }
.drop-target.incorrect { border-color: #EF4444; background: #FEE2E2; }

/* ── Input exercise ── */
.input-exercise input {
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid #E5E7EB;
  border-radius: 1rem;
  padding: 0.875rem 1.25rem;
  width: 100%;
  transition: border-color 0.2s;
}
.input-exercise input:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.input-exercise input.correct { border-color: var(--color-green); background: var(--color-green-light); }
.input-exercise input.incorrect { border-color: #EF4444; background: #FEE2E2; }

/* ── Feedback box ── */
.feedback-box {
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  display: none;
}
.feedback-box.correct {
  background: var(--color-green-light);
  border-left: 4px solid var(--color-green);
  color: #065F46;
}
.feedback-box.incorrect {
  background: #FEE2E2;
  border-left: 4px solid #EF4444;
  color: #991B1B;
}

/* ── Submit button ── */
.btn-submit {
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0.875rem 2.5rem;
  border-radius: 1rem;
  min-width: 200px;
}

/* ── Result screen ── */
.result-screen {
  text-align: center;
  padding: 2rem;
}
.result-stars { font-size: 3rem; }
.result-score { font-size: 3rem; font-weight: 900; color: var(--color-purple); }

/* ── Progress bar (course detail) ── */
.progress { border-radius: 0.5rem; height: 8px; }
.progress-bar { background: linear-gradient(90deg, var(--color-purple), var(--color-pink)); }

/* ── Dashboard cards ── */
.dashboard-stat {
  border-radius: 1.25rem;
  padding: 1.5rem;
  text-align: center;
  border: none;
}
.dashboard-stat .stat-number { font-size: 2.5rem; font-weight: 900; }
.dashboard-stat.purple { background: var(--color-purple-light); color: var(--color-purple); }
.dashboard-stat.green { background: var(--color-green-light); color: var(--color-green); }
.dashboard-stat.orange { background: var(--color-orange-light); color: #B45309; }

/* ── How it works steps ── */
.step-circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--color-purple);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}

/* ── Auth forms ── */
.auth-card {
  max-width: 480px;
  margin: 0 auto;
  border: none;
  border-radius: 1.5rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  padding: 2.5rem;
}
.form-control, .form-select {
  border-radius: 0.75rem;
  border: 2px solid #E5E7EB;
  padding: 0.75rem 1rem;
  font-weight: 600;
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.form-label { font-weight: 700; color: #374151; }

/* ── Difficulty stars ── */
.difficulty-stars { color: var(--color-orange); font-size: 0.85rem; }

/* ── Badges ── */
.badge-category {
  padding: 0.4rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Animations ── */
@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.bounce-in { animation: bounceIn 0.4s ease forwards; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.shake { animation: shake 0.4s ease; }

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
  .hero-section { padding: 50px 0 40px; }
  .question-text { font-size: 1.1rem; }
  .exercise-card { padding: 1.25rem; }
  .auth-card { padding: 1.5rem; }
}
