@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1629;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --warning: #f59e0b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --sidebar-width: 240px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 60%);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── LAYOUT ── */
#app { display: flex; height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-logo span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.exam-badge {
  font-size: 11px;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.exam-badge:hover { background: rgba(99, 102, 241, 0.2); }

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .nav-item {
  padding: 9px 8px;
  font-size: 13px;
}

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  flex: 1;
  padding: 32px;
  animation: fadeIn 0.3s ease;
}

.view.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.card:hover { border-color: rgba(255,255,255,0.12); }

.card-accent {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── STAT CARDS ── */
.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5); }

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 15px var(--success-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 4px 15px var(--danger-glow);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.15); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── INPUTS ── */
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

select { appearance: none; cursor: pointer; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group { margin-bottom: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ── TAGS / BADGES ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tag-accent { background: rgba(99, 102, 241, 0.15); color: var(--accent-light); }
.tag-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.tag-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.tag-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ── DIVIDER ── */
.divider {
  height: 1px; background: var(--border); margin: 20px 0;
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}

.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ── ONBOARDING MODAL ── */
#onboarding-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}

.onboarding-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 560px; width: 90%;
  box-shadow: 0 0 80px rgba(99, 102, 241, 0.2);
  animation: fadeIn 0.4s ease;
}

.onboarding-logo {
  text-align: center;
  margin-bottom: 28px;
}

.onboarding-logo .big-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 20px rgba(99,102,241,0.5));
}

.onboarding-logo h1 {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboarding-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
}

.step-indicator {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 28px;
}

.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s;
}

.step-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.step-dot.done { background: var(--success); }

.onboarding-step { display: none; }
.onboarding-step.active { display: block; }

.onboarding-step h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.onboarding-step p {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.exam-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}

.suggestion-chip {
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  font-size: 12px;
  color: var(--accent-light);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── DASHBOARD ── */
.quick-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 24px;
}

.welcome-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 20px;
}

.welcome-banner .exam-icon { font-size: 40px; }

.welcome-banner h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-banner p {
  color: var(--text-secondary);
  font-size: 13.5px;
}

/* ── CONTENT LIBRARY ── */
.content-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
}

.content-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.content-tab.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
  border-color: rgba(99, 102, 241, 0.2);
}

.content-tab:hover:not(.active) { color: var(--text-primary); }

.content-panel { display: none; }
.content-panel.active { display: block; }

.content-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: all 0.2s;
}

.content-item:hover { border-color: rgba(255,255,255,0.12); }

.content-item-icon {
  font-size: 20px; margin-top: 2px;
}

.content-item-body { flex: 1; min-width: 0; }
.content-item-body h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.content-item-body p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.content-item-actions { display: flex; gap: 6px; align-items: center; }

/* ── QUESTION BANK ── */
.qb-filters {
  display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}

.question-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: all 0.2s;
  cursor: pointer;
}

.question-item:hover { border-color: rgba(99, 102, 241, 0.3); background: var(--bg-card-hover); }

.question-item-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  margin-bottom: 8px;
}

.question-item-q {
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
}

.question-item-footer {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}

.question-preview {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
  display: none;
}

.question-preview.open { display: block; }

.preview-option {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 4px 0; color: var(--text-secondary);
}

.preview-option.correct { color: var(--success); font-weight: 600; }

/* ── MOCK EXAM ── */
.exam-config {
  max-width: 600px;
}

.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.config-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.option-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.option-chip {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.option-chip.selected {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
}

/* ── ACTIVE EXAM ── */
#exam-active { display: none; }

.exam-topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  position: sticky; top: 0; z-index: 5;
}

.exam-progress-text { font-size: 13px; color: var(--text-secondary); }

.timer-display {
  font-size: 20px; font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px;
}

.timer-display.warning { color: var(--warning); }
.timer-display.danger { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.exam-progress-bar {
  height: 3px; background: var(--border);
  position: relative;
}

.exam-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

.exam-body {
  padding: 32px;
  max-width: 760px;
  margin: 0 auto;
  flex: 1;
}

.question-number {
  font-size: 12px; font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 17px; font-weight: 600;
  line-height: 1.6;
  margin-bottom: 24px;
}

.options-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 28px;
}

.option-btn {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  font-size: 14px; line-height: 1.5;
}

.option-btn:hover { border-color: rgba(99, 102, 241, 0.4); background: var(--bg-card-hover); }

.option-btn.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.option-btn.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.option-letter {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.option-btn.selected .option-letter { background: var(--accent); color: white; }
.option-btn.correct .option-letter { background: var(--success); color: white; }
.option-btn.wrong .option-letter { background: var(--danger); color: white; }

.explanation-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: none;
}

.explanation-box.show { display: block; }
.explanation-box strong { color: var(--accent-light); }

.exam-nav { display: flex; gap: 10px; align-items: center; }

/* ── RESULTS ── */
.results-hero {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.score-circle {
  width: 140px; height: 140px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  margin: 0 auto 20px;
  position: relative;
}

.score-circle svg {
  position: absolute; top: 0; left: 0;
  transform: rotate(-90deg);
}

.score-circle-inner { position: relative; z-index: 1; text-align: center; }

.score-number {
  font-size: 32px; font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.results-pass { color: var(--success); }
.results-fail { color: var(--danger); }
.results-ok { color: var(--warning); }

.review-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}

.review-item.wrong {
  border-left: 3px solid var(--danger);
}

.review-item.correct {
  border-left: 3px solid var(--success);
}

.review-q {
  font-size: 14px; font-weight: 600;
  margin-bottom: 8px;
}

.review-answer {
  font-size: 13px;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}

.review-explanation {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

/* ── SETTINGS ── */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}

.settings-section p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.api-key-row {
  display: flex; gap: 10px; align-items: flex-end;
}

.api-key-row .form-group { flex: 1; margin-bottom: 0; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 14px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; max-width: 300px; margin: 0 auto 16px; }

/* ── AI GENERATING ── */
.ai-generating {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  margin-top: 12px;
  font-size: 14px;
  color: var(--accent-light);
  display: none;
}

.ai-generating.show { display: flex; }

/* ── EXAM PALETTE ── */
.question-palette {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
}

.palette-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.palette-btn.answered { background: rgba(99, 102, 241, 0.3); border-color: var(--accent); color: var(--text-primary); }
.palette-btn.current { background: var(--accent); color: white; box-shadow: 0 0 10px var(--accent-glow); }

/* ── TOPIC BREAKDOWN ── */
.topic-row {
  margin-bottom: 12px;
}

.topic-row-header {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 5px;
}

.topic-bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.topic-bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 1s ease;
  background: linear-gradient(90deg, var(--accent), #a855f7);
}

.topic-bar-fill.high { background: linear-gradient(90deg, var(--success), #059669); }
.topic-bar-fill.med { background: linear-gradient(90deg, var(--warning), #d97706); }
.topic-bar-fill.low { background: linear-gradient(90deg, var(--danger), #dc2626); }

/* ── SCROLLABLE AREAS ── */
.scroll-area { overflow-y: auto; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  display: none;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 500px; width: 90%;
  animation: fadeIn 0.3s ease;
}

.modal-box h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal-box p { font-size: 13.5px; color: var(--text-secondary); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
