/* ═══════════════════════════════════════════════════
   EduAI — Main Stylesheet
   Design: Glassmorphism Dark/Light with gradient accent
   ═══════════════════════════════════════════════════ */

/* ── CSS Custom Properties ────────────────────────── */
:root {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Accent / Brand */
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.35);

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

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Dark Theme (default) ─────────────────────────── */
[data-theme="dark"] {
  --bg: #0f0f1a;
  --bg-2: #13131f;
  --bg-3: #1a1a2e;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --glass: rgba(20, 20, 40, 0.75);
  --glass-border: rgba(255, 255, 255, 0.10);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.10);
}

/* ── Light Theme ──────────────────────────────────── */
[data-theme="light"] {
  --bg: #f5f5fa;
  --bg-2: #ffffff;
  --bg-3: #eef0f9;
  --surface: rgba(0, 0, 0, 0.04);
  --surface-hover: rgba(0, 0, 0, 0.07);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(0, 0, 0, 0.08);
  --text: #1e293b;
  --text-muted: #64748b;
  --border: rgba(0, 0, 0, 0.10);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

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

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

img {
  max-width: 100%;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── Typography ───────────────────────────────────── */
h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 700;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), #c084fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glass Card ───────────────────────────────────── */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), transform var(--transition);
}

.glass-card:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
  color: #fff;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Form Elements ────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 16px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  appearance: none;
  cursor: pointer;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-control {
  padding-right: 44px;
}

.pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.pwd-toggle:hover {
  color: var(--accent);
}

/* Password strength */
.pwd-strength {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}

.pwd-bar {
  height: 100%;
  border-radius: 99px;
  transition: all var(--transition);
  width: 0%;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.checkbox-label input:checked~.checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked~.checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* ── Navbar ───────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

/* User menu */
.user-menu {
  position: relative;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 200px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 200;
}

.user-menu:hover .user-dropdown {
  display: block;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
}

.user-info strong {
  font-size: 0.9rem;
}

.user-info small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  color: var(--text);
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--surface-hover);
}

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

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 99px;
  transition: all var(--transition);
}

/* ── Flash Messages ───────────────────────────────── */
.flash-container {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  width: 90vw;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.flash-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.flash-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.flash-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.flash-info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: inherit;
  opacity: 0.6;
  padding: 0;
}

.flash-close:hover {
  opacity: 1;
}

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

  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
  }

  to {
    transform: translateX(100px);
    opacity: 0;
  }
}

/* ── Main Content ─────────────────────────────────── */
.main-content {
  min-height: calc(100vh - 60px);
}

/* ── Auth Pages ───────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
}

.auth-header h1 {
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Background shapes */
.auth-bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: float 8s ease-in-out infinite alternate;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -200px;
  left: -100px;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: #c084fc;
  bottom: -150px;
  right: -100px;
  animation-delay: -3s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: #38bdf8;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -6s;
}

@keyframes float {
  0% {
    transform: scale(1) translate(0, 0);
  }

  100% {
    transform: scale(1.1) translate(20px, 20px);
  }
}

/* ── Dashboard Page ───────────────────────────────── */
.dashboard-page {
  padding: 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.start-session-hero {
  text-align: center;
  padding: 48px 24px 36px;
}

.hero-content {
  margin-bottom: 28px;
}

.hero-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 8px;
}

.course-form {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.course-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 8px 8px 8px 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.course-icon {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.course-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-sans);
}

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

.btn-start {
  border-radius: var(--radius-xl) !important;
  flex-shrink: 0;
}

.autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.autocomplete-item:hover {
  background: var(--surface-hover);
}

.autocomplete-item i {
  color: var(--accent);
}

.quick-courses {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.quick-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.quick-chip {
  padding: 5px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.quick-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

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

.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.1rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
}

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

/* Sessions Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.session-card {
  padding: 20px;
}

.session-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent-light);
}

.domain-badge.sm {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.status-badge {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.session-course {
  margin-bottom: 10px;
  font-size: 1rem;
}

.session-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.session-meta i {
  color: var(--accent);
}

.session-actions {
  display: flex;
  gap: 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite alternate;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 24px;
}

/* ── Badges / Labels ──────────────────────────────── */
.level-badge {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Progress Page ────────────────────────────────── */
.progress-page {
  padding: 32px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 32px;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 6px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.back-link:hover {
  color: var(--accent);
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  padding: 24px;
}

.chart-card h3 {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.progress-table-card {
  padding: 24px;
}

.table-header {
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.progress-table th {
  padding: 10px 12px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.progress-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.progress-table tr:last-child td {
  border-bottom: none;
}

.progress-table tr:hover td {
  background: var(--surface);
}

.course-col {
  display: flex;
  align-items: center;
  gap: 10px;
}

.course-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.score-bar {
  height: 6px;
  border-radius: 99px;
  transition: width var(--transition);
}

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

/* ── Quiz Page ────────────────────────────────────── */
.quiz-page {
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.quiz-generator {
  padding: 32px;
  margin-bottom: 24px;
}

.quiz-generator h2 {
  margin-bottom: 8px;
}

.quiz-generator p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 20px;
  align-items: end;
}

.num-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.num-btn {
  padding: 11px 14px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
  transition: background var(--transition);
}

.num-btn:hover {
  background: var(--surface-hover);
}

.num-input {
  width: 50px;
  text-align: center;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
}

.quiz-questions-panel {
  margin-bottom: 24px;
}

.quiz-questions-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.quiz-progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 12px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #c084fc);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.question-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}

.question-number {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.question-text {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--accent-light);
  font-weight: 600;
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

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

.option-key {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.option-btn.selected .option-key {
  background: var(--accent);
  color: white;
}

.quiz-submit-row {
  text-align: center;
  padding: 16px;
}

/* Results */
.quiz-results-panel {
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
}

.result-score-circle {
  width: 160px;
  height: 160px;
  position: relative;
  margin: 0 auto 24px;
}

.score-ring {
  transform: rotate(-90deg);
}

.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}

.score-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.answer-review-item {
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.answer-review-item.correct-ans {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.07);
}

.answer-review-item.wrong-ans {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.07);
}

.answer-review-item .question-text {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.answer-review-item .explanation {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.past-quizzes {
  padding: 24px;
  margin-bottom: 24px;
}

.past-quiz-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.past-quiz-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.past-quiz-item:last-child {
  border-bottom: none;
}

.past-quiz-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.past-quiz-date {
  font-size: 0.85rem;
}

.past-quiz-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.past-quiz-score {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
}

.past-quiz-score.good {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.past-quiz-score.ok {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.past-quiz-score.poor {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.past-quiz-incomplete {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-page {
    padding: 16px;
  }

  .quiz-page,
  .progress-page {
    padding: 16px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--glass);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px;
  }

  .nav-links.open {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .course-input-wrap {
    flex-wrap: wrap;
  }

  .btn-start {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════
   Landing Page
   ═══════════════════════════════════════════════ */
.landing-page {
  overflow-x: hidden;
}

/* ── Hero ─────────────────────────────────────── */
.hero-section {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 60px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-section .shape-1 {
  width: 700px;
  height: 700px;
  top: -300px;
  left: -200px;
  opacity: 0.12;
}

.hero-section .shape-2 {
  width: 500px;
  height: 500px;
  bottom: -200px;
  right: -100px;
  opacity: 0.12;
}

.hero-section .shape-3 {
  width: 400px;
  height: 400px;
  top: 40%;
  left: 40%;
  opacity: 0.08;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-light);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-badge i {
  color: #fbbf24;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-social-proof {
  display: flex;
  align-items: center;
  gap: 12px;
}

.proof-avatars {
  display: flex;
}

.proof-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  margin-left: -10px;
}

.proof-avatar:first-child {
  margin-left: 0;
}

.hero-social-proof p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Chat Preview Card */
.hero-preview {
  position: relative;
  z-index: 1;
  overflow: hidden;
  max-width: 440px;
  width: 100%;
  animation: previewFloat 5s ease-in-out infinite alternate;
}

@keyframes previewFloat {
  0% {
    transform: translateY(0px) rotate(-1deg);
  }

  100% {
    transform: translateY(-14px) rotate(1deg);
  }
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.preview-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.preview-messages {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow: hidden;
}

.preview-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.preview-msg.user-msg {
  flex-direction: row-reverse;
}

.preview-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #c084fc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
}

.preview-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.user-msg .preview-bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  border-radius: 12px 4px 12px 12px;
}

.ai-msg .preview-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px 12px 12px 12px;
}

.preview-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
}

/* ── Features ─────────────────────────────────── */
.features-section {
  padding: 100px 80px;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.section-title {
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  padding: 28px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ── How It Works ─────────────────────────────── */
.how-section {
  padding: 80px 80px;
  background: var(--bg-2);
}

.steps-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.step-card {
  flex: 1;
  min-width: 220px;
  padding: 28px 24px;
  position: relative;
}

.step-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent-glow);
  -webkit-text-stroke: 2px var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 12px;
}

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.step-card h3 {
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.87rem;
  line-height: 1.6;
}

.step-arrow {
  font-size: 1.2rem;
  color: var(--border);
  flex-shrink: 0;
  padding-bottom: 20px;
}

/* ── CTA ──────────────────────────────────────── */
.cta-section {
  padding: 80px;
}

.cta-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(192, 132, 252, 0.08));
  border-color: rgba(99, 102, 241, 0.3);
}

.cta-card h2 {
  margin-bottom: 12px;
}

.cta-card p {
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Landing Responsive ───────────────────────── */
@media (max-width: 1024px) {
  .hero-section {
    grid-template-columns: 1fr;
    padding: 40px 32px;
    min-height: auto;
    gap: 40px;
  }

  .hero-preview {
    max-width: 100%;
  }

  .features-section,
  .how-section,
  .cta-section {
    padding: 60px 32px;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 32px 20px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .features-section,
  .cta-section {
    padding: 48px 20px;
  }

  .how-section {
    padding: 48px 20px;
  }

  .steps-row {
    flex-direction: column;
  }

  .step-arrow {
    display: none;
  }

  .cta-card {
    padding: 36px 24px;
  }
}