/* Fonts loaded via CDN in layout */

/* ─── CSS Variables ────────────────────────────────────────────────────────── */
:root {
  --bg-base:        #0a0a14;
  --bg-surface:     #111124;
  --bg-card:        #16162a;
  --bg-card-hover:  #1d1d38;
  --bg-input:       #1e1e35;
  --border:         rgba(255,255,255,0.08);
  --border-accent:  rgba(102,126,234,0.4);

  --accent:         #667eea;
  --accent-2:       #764ba2;
  --accent-light:   rgba(102,126,234,0.15);
  --accent-glow:    rgba(102,126,234,0.35);

  --success:        #22c55e;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;

  --text-primary:   #f0f0ff;
  --text-secondary: #9090b8;
  --text-muted:     #5c5c80;

  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow:     0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow:0 0 30px rgba(102,126,234,0.25);

  --sidebar-w:  260px;
  --header-h:   64px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

code, pre, .code { font-family: 'Fira Code', monospace; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #8fa8ff; }

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

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: var(--radius-full); }

/* ─── Gradient Text ────────────────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2), #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Gradient BG ──────────────────────────────────────────────────────────── */
.gradient-bg {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

/* ─── Glassmorphism ────────────────────────────────────────────────────────── */
.glass {
  background: rgba(22,22,42,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* ─── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-accent); box-shadow: var(--shadow-glow); }
.card-sm { padding: 16px; border-radius: var(--radius); }
.card-header { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
  color: #fff;
}
.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--border-accent); color: var(--text-primary); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 11px 16px;
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control option { background: var(--bg-card); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; }

/* ─── Badge ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-primary  { background: var(--accent-light); color: var(--accent); }
.badge-success  { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning  { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger   { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-muted    { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ─── Alerts / Toast ────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  animation: slideDown 0.3s ease;
}
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.25); color: #86efac; }
.alert-danger   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; }
.alert-info     { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.25); color: #93c5fd; }
.alert-warning  { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.25); color: #fcd34d; }

@keyframes slideDown { from { opacity:0; transform: translateY(-10px); } to { opacity:1; transform: translateY(0); } }

/* ─── Table ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-card); }
th { padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Progress Bar ──────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(200%); } }

/* ─── Sidebar Layout ────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.sidebar-logo-text .app-name { font-size: 16px; font-weight: 800; background: linear-gradient(135deg, var(--accent), #f093fb); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-logo-text .app-sub  { font-size: 11px; color: var(--text-muted); margin-top: -2px; }

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 8px 4px; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--accent-light); color: var(--accent); }
.sidebar-link.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.sidebar-link i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-link .badge { margin-left: auto; }

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-user img { width: 38px; height: 38px; border-radius: var(--radius-full); border: 2px solid var(--border-accent); }
.sidebar-user-info .name { font-size: 13px; font-weight: 600; }
.sidebar-user-info .role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; }

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: rgba(17,17,36,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 32px; flex: 1; }

/* ─── Stats Grid ────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); border-color: var(--border-accent); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.purple { background: rgba(102,126,234,0.15); color: var(--accent); }
.stat-icon.green  { background: rgba(34,197,94,0.12);   color: var(--success); }
.stat-icon.amber  { background: rgba(245,158,11,0.12);  color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,0.12);   color: var(--danger); }
.stat-icon.blue   { background: rgba(59,130,246,0.12);  color: var(--info); }

.stat-info .label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-info .value { font-size: 28px; font-weight: 800; line-height: 1; }

/* ─── Course Cards ──────────────────────────────────────────────────────────── */
.courses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), var(--shadow-glow); border-color: var(--border-accent); }
.course-card-thumb { position: relative; height: 180px; overflow: hidden; }
.course-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .course-card-thumb img { transform: scale(1.05); }
.course-card-thumb .level-badge { position: absolute; top: 12px; left: 12px; }
.course-card-thumb .free-badge { position: absolute; top: 12px; right: 12px; background: rgba(34,197,94,0.9); color: #fff; }

.course-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.course-card-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.course-card-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.course-card-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.course-card-guru { display: flex; align-items: center; gap: 8px; }
.course-card-guru img { width: 28px; height: 28px; border-radius: var(--radius-full); }
.course-card-guru span { font-size: 12px; color: var(--text-secondary); }

/* ─── Learning Layout ───────────────────────────────────────────────────────── */
.learn-layout { display: flex; height: 100vh; overflow: hidden; }

.learn-sidebar {
  width: 320px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.learn-content { flex: 1; overflow-y: auto; }

.chapter-item { border-bottom: 1px solid var(--border); }
.chapter-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: var(--bg-card);
  user-select: none;
  transition: background var(--transition);
}
.chapter-header:hover { background: var(--bg-card-hover); }
.chapter-header .chapter-title { font-size: 13px; font-weight: 700; flex: 1; }
.chapter-header .timer-badge { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.sub-chapter-list { padding: 4px 0; }
.sub-chapter-item {
  padding: 10px 16px 10px 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}
.sub-chapter-item:hover:not(.locked) { background: var(--accent-light); color: var(--accent); }
.sub-chapter-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; border-right: 3px solid var(--accent); }
.sub-chapter-item.completed .check-icon { color: var(--success); }
.sub-chapter-item.locked { opacity: 0.4; cursor: not-allowed; }
.sub-chapter-item .status-icon { width: 18px; flex-shrink: 0; }

/* ─── Content Player ────────────────────────────────────────────────────────── */
.content-player { padding: 32px; max-width: 900px; margin: 0 auto; }
.content-player iframe { width: 100%; height: 480px; border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }
.content-text { line-height: 1.9; color: var(--text-primary); }
.content-text h1, .content-text h2, .content-text h3 { margin: 1.5em 0 0.5em; }
.content-text h2 { font-size: 22px; color: var(--accent); }
.content-text p { margin-bottom: 1em; }
.content-text ul, .content-text ol { margin: 1em 0 1em 1.5em; }
.content-text li { margin-bottom: 0.4em; }
.content-text pre { background: #0d0d1a; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; overflow-x: auto; margin: 1.5em 0; }
.content-text code { background: rgba(102,126,234,0.15); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: #8fa8ff; }
.content-text pre code { background: none; padding: 0; color: #e0e0ff; }

/* ─── Timer Widget ──────────────────────────────────────────────────────────── */
.timer-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
}
.timer-widget.warning { border-color: rgba(245,158,11,0.5); color: var(--warning); }
.timer-widget.danger  { border-color: rgba(239,68,68,0.5);  color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ─── Quiz ──────────────────────────────────────────────────────────────────── */
.quiz-container { max-width: 800px; margin: 0 auto; padding: 32px; }
.quiz-header { margin-bottom: 32px; }
.quiz-progress { margin-bottom: 24px; }
.quiz-question-num { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.question-text { font-size: 18px; font-weight: 600; margin-bottom: 24px; line-height: 1.5; }
.question-type-badge { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
}
.option-item:hover { border-color: var(--accent); background: var(--accent-light); }
.option-item.selected { border-color: var(--accent); background: var(--accent-light); }
.option-item.correct  { border-color: var(--success); background: rgba(34,197,94,0.1); }
.option-item.incorrect { border-color: var(--danger); background: rgba(239,68,68,0.1); }
.option-item input { display: none; }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drag-zone { min-height: 80px; background: var(--bg-input); border: 2px dashed var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; transition: border-color var(--transition); }
.drag-zone.drag-over { border-color: var(--accent); background: var(--accent-light); }
.drag-item { background: var(--bg-card-hover); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; cursor: grab; font-size: 14px; transition: all var(--transition); }
.drag-item:hover, .drag-item:active { border-color: var(--accent); cursor: grabbing; }

/* ─── Code Editor ───────────────────────────────────────────────────────────── */
.code-editor {
  background: #0d0d1a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  color: #e0e0ff;
  padding: 20px;
  width: 100%;
  min-height: 200px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}
.code-editor:focus { border-color: var(--accent); }

/* ─── Avatar ────────────────────────────────────────────────────────────────── */
.avatar { border-radius: var(--radius-full); object-fit: cover; border: 2px solid var(--border); }
.avatar-sm  { width: 32px;  height: 32px; }
.avatar-md  { width: 44px;  height: 44px; }
.avatar-lg  { width: 64px;  height: 64px; }
.avatar-xl  { width: 96px;  height: 96px; }

/* ─── Pagination ────────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.pagination a:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.pagination .active span { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 560px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-title { font-size: 18px; font-weight: 700; }

/* ─── Quiz Builder ──────────────────────────────────────────────────────────── */
.quiz-builder { }
.question-builder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
}
.question-builder .qb-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.question-builder .qb-num { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }

.option-builder { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.option-builder input[type="text"] { flex: 1; }
.option-builder input[type="checkbox"], .option-builder input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ─── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--bg-input); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
}
.tab-btn.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px var(--accent-glow); }
.tab-btn:hover:not(.active) { color: var(--text-primary); background: rgba(255,255,255,0.05); }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-grid { grid-template-columns: 1fr; }
  .learn-layout { flex-direction: column; }
  .learn-sidebar { width: 100%; height: auto; max-height: 50vh; }
  .quiz-container { padding: 16px; }
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.fade-in  { animation: fadeIn  0.4s ease; }
.fade-up  { animation: fadeUp  0.4s ease; }

/* ─── Utilities ─────────────────────────────────────────────────────────────── */
.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-col    { display: flex; flex-direction: column; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.gap-4       { gap: 16px; }
.grid-2      { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mt-4        { margin-top: 16px; }
.mb-4        { margin-bottom: 16px; }
.mt-6        { margin-top: 24px; }
.text-sm     { font-size: 13px; }
.text-muted  { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold   { font-weight: 700; }
.w-full      { width: 100%; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pointer     { cursor: pointer; }
.hidden      { display: none !important; }
