/* ==========================================================================
   কুইজ খেলি — Modern, Distinctive, Mobile-First Bengali MCQ Practice Platform
   Design System: Royal Violet & Amethyst with Clean Glassmorphism
   ========================================================================== */

:root {
  /* Brand Theme: Royal Violet & Glowing Amethyst */
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-dark: #581c87;
  --primary-deep: #3b0764;
  --primary-light: #f5f3ff;
  --primary-subtle: #ede9fe;
  --primary-border: #ddd6fe;
  --primary-glow: rgba(124, 58, 237, 0.18);
  
  --secondary: #f59e0b;
  --secondary-light: #fef3c7;
  --secondary-dark: #b45309;

  /* Neutrals & Surfaces */
  --ink: #0f172a;
  --ink-secondary: #334155;
  --ink-muted: #64748b;
  --ink-light: #94a3b8;
  
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.85);
  --background: #faf8fe;
  --border-line: #e2e8f0;
  --border-light: #f1f5f9;
  --border-card: rgba(124, 58, 237, 0.08);

  /* Semantic Feedback */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --danger: #f43f5e;
  --danger-bg: #fff1f2;
  --danger-border: #fecdd3;
  --danger-text: #9f1239;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;
  --info-text: #0369a1;

  /* Shadows & Elevations */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(91, 33, 182, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(91, 33, 182, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 10px rgba(91, 33, 182, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 16px 32px -6px rgba(124, 58, 237, 0.15), 0 4px 12px -2px rgba(0, 0, 0, 0.05);

  /* Geometry & Radii */
  --sidebar-width: 270px;
  --topbar-height: 72px;
  --bottom-nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* ==========================================================================
   CSS Reset & Bengali Typography
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--background);
  background-image: 
    radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.035) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.035) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary);
}

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

svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon.sm { width: 16px; height: 16px; stroke-width: 2.2; }
.icon.lg { width: 24px; height: 24px; stroke-width: 1.9; }
.icon.xl { width: 32px; height: 32px; stroke-width: 1.8; }

::selection {
  background: #ddd6fe;
  color: var(--primary-deep);
}

:focus-visible {
  outline: 3px solid var(--primary-border);
  outline-offset: 2px;
}

/* ==========================================================================
   Shell Layout
   ========================================================================== */

.app-shell {
  min-height: 100vh;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  background: var(--surface);
  border-right: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  overflow-y: auto;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.15));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-word {
  font-size: 25px;
  font-weight: 800;
  color: var(--primary-deep);
  line-height: 1.15;
  letter-spacing: -0.5px;
}

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

.brand-tagline {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.nav-caption {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 8px 12px 4px;
  margin-top: 12px;
}

.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 3px 0;
  border-radius: var(--radius-md);
  color: var(--ink-secondary);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: all 0.18s ease;
  position: relative;
}

.side-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(3px);
}

.side-link.active {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ede9fe 100%);
  color: var(--primary);
  font-weight: 700;
}

.side-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--primary) 0%, #a855f7 100%);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
}

.sidebar-spacer {
  flex: 1;
  min-height: 24px;
}

.sidebar-box {
  background: linear-gradient(135deg, #fbf8ff 0%, #f3ebff 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 12px 2px 16px;
  position: relative;
  overflow: hidden;
}

.sidebar-box::after {
  content: '';
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
}

.sidebar-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 6px;
}

.sidebar-box-head .icon {
  color: var(--secondary);
}

.sidebar-box p {
  font-size: 12px;
  color: #6b21a8;
  line-height: 1.6;
  margin: 0;
}

.side-footer {
  padding: 14px 10px 0;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--ink-light);
  text-align: center;
}

.drawer-backdrop {
  display: none;
}

/* Main Area */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Topbar with Frosted Acrylic Glass */
.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.08);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  gap: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
}

.mobile-brand img {
  width: 36px;
  height: 36px;
}

.mobile-brand strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-deep);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.crumb strong {
  color: var(--ink);
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  color: var(--ink-muted);
  font-size: 14px;
  min-width: 250px;
  transition: all 0.2s ease;
}

.top-search-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.top-search-btn .kbd {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border-line);
  color: var(--ink-light);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  color: var(--ink-secondary);
  position: relative;
  transition: all 0.18s ease;
}

.icon-button:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

.icon-button.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  background: var(--secondary);
  border: 2px solid var(--surface);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  box-shadow: var(--shadow-sm);
  margin-left: 4px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.profile-status {
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
}

/* Content Container */
.content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 36px 36px 80px;
}

/* ==========================================================================
   Typography & Buttons
   ========================================================================== */

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-heading-left {
  flex: 1;
  min-width: 280px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.page-heading h1 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.6px;
}

.page-heading p {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 6px 0 0;
}

.today-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
}

.today-chip .icon {
  color: var(--primary);
}

/* Modern Button Hierarchy */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  min-height: 46px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

.button-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6d28d9 0%, #581c87 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.38);
  transform: translateY(-2px);
}

.button-white {
  background: white;
  color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.button-white:hover:not(:disabled) {
  background: #faf5ff;
  color: var(--primary-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.button-outline {
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  color: var(--ink-secondary);
}

.button-outline:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
  transform: translateY(-1px);
}

.button-soft {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}

.button-soft:hover:not(:disabled) {
  background: var(--primary-subtle);
  color: var(--primary-dark);
}

.button-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.button-lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

/* Badges & Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.tag.neutral {
  background: var(--surface-alt);
  color: var(--ink-muted);
  border-color: var(--border-line);
}

.tag.green {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.tag.red {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.tag.orange {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

/* ==========================================================================
   Dashboard Widgets
   ========================================================================== */

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 30px;
  align-items: start;
}

.dashboard-main, .dashboard-aside {
  min-width: 0;
}

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(135deg, #3b0764 0%, #581c87 45%, #7c3aed 100%);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  color: white;
  overflow: hidden;
  box-shadow: 0 20px 40px -8px rgba(124, 58, 237, 0.35);
  margin-bottom: 32px;
}

.hero::before {
  content: '';
  position: absolute;
  left: -80px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 580px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.28;
  margin: 0 0 12px;
  letter-spacing: -0.6px;
}

.hero h2 em {
  font-style: normal;
  background: linear-gradient(120deg, #fef08a 0%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 15px;
  line-height: 1.7;
  color: #ede9fe;
  margin: 0 0 26px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 34px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--primary-border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon.purple { background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%); color: var(--primary); }
.stat-icon.green  { background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%); color: var(--success); }
.stat-icon.orange { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); color: var(--secondary); }
.stat-icon.blue   { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); color: var(--info); }

.stat-info {
  min-width: 0;
}

.stat-info strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.stat-info span {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* Mode Selection (Practice vs Exam) */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.section-head p {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 3px 0 0;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 0;
}

.section-link:hover {
  text-decoration: underline;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 34px;
}

.mode-card {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.mode-card.practice {
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
  border: 1.5px solid var(--primary-border);
}

.mode-card.exam {
  background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
  border: 1.5px solid #fde68a;
}

.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.mode-card.practice:hover {
  border-color: var(--primary);
}

.mode-card.exam:hover {
  border-color: var(--secondary);
}

.mode-card-content {
  flex: 1;
}

.mode-card h3 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 6px;
}

.mode-card.practice h3 { color: var(--primary-deep); }
.mode-card.exam h3 { color: #92400e; }

.mode-card p {
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;
  color: var(--ink-secondary);
}

.mode-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.mode-card.practice .mode-card-cta { color: var(--primary); }
.mode-card.exam .mode-card-cta { color: #b45309; }

.mode-icon-art {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.mode-card.practice .mode-icon-art {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: var(--primary);
}

.mode-card.exam .mode-icon-art {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
}

/* Category Tabs */
.pill-tabs {
  display: inline-flex;
  gap: 6px;
  background: #ede9fe;
  border-radius: var(--radius-full);
  padding: 5px;
  margin-bottom: 14px;
  overflow-x: auto;
  max-width: 100%;
}

.pill-tab {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
  transition: all 0.18s ease;
}

.pill-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}

.group-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.group-pill {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  color: var(--ink-secondary);
  transition: all 0.18s ease;
}

.group-pill:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.group-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Subject Grid */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.subject-card {
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-xl);
  padding: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 168px;
  box-shadow: var(--shadow-card);
}

.subject-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.subject-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.subject-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.subject-icon-box.purple { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); color: #7c3aed; }
.subject-icon-box.teal   { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); color: #0d9488; }
.subject-icon-box.orange { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); color: #ea580c; }
.subject-icon-box.blue   { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #2563eb; }
.subject-icon-box.pink   { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); color: #db2777; }
.subject-icon-box.green  { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #16a34a; }

.subject-arrow-icon {
  color: var(--ink-light);
  transition: transform 0.2s ease, color 0.2s ease;
}

.subject-card:hover .subject-arrow-icon {
  color: var(--primary);
  transform: translateX(4px);
}

.subject-card h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.35;
}

.subject-meta {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.subject-progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: auto;
}

.subject-progress-bar span {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
  transition: width 0.3s ease;
}

/* Dashboard Aside Widgets */
.dashboard-aside {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.aside-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.aside-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.aside-title h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.aside-title .icon {
  color: var(--primary);
}

/* Daily Goal Widget */
.goal-widget {
  display: flex;
  align-items: center;
  gap: 18px;
}

.goal-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--progress, 0%), #ede9fe var(--progress, 0%));
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.goal-ring::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--surface);
  border-radius: 50%;
}

.goal-ring strong {
  position: relative;
  z-index: 2;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.goal-details strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.goal-details span {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.4;
  display: block;
  margin-top: 2px;
}

.goal-badge {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--warning-text);
  font-weight: 700;
}

.goal-badge .icon {
  color: var(--secondary);
}

/* Activity Feed */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.activity-icon-badge.purple { background: var(--primary-light); color: var(--primary); }
.activity-icon-badge.orange { background: var(--secondary-light); color: var(--secondary-dark); }

.activity-info strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  display: block;
  line-height: 1.35;
}

.activity-info span {
  font-size: 12px;
  color: var(--ink-muted);
  display: block;
  margin-top: 2px;
}

/* ==========================================================================
   Catalog & Chapters
   ========================================================================== */

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-card);
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 16px;
}

.filter-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.field {
  height: 46px;
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0 16px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-search {
  flex: 1;
  min-width: 260px;
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.catalog-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.catalog-card-head {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.catalog-card-head h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.catalog-card-head p {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 2px 0 0;
}

.catalog-count-pill {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.chapter-list {
  padding: 4px 24px;
}

.chapter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
}

.chapter-row:last-child {
  border-bottom: none;
}

.chapter-index {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.chapter-info span {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Practice & Exam Interface
   ========================================================================== */

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quiz-header-title h1 {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
}

.quiz-header-title p {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 4px 0 0;
}

.quiz-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
}

.quiz-pill.timer {
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  border-color: var(--primary-border);
  background: var(--primary-light);
  min-width: 120px;
  justify-content: center;
}

.quiz-pill.timer.warning {
  color: var(--danger-text);
  border-color: var(--danger-border);
  background: var(--danger-bg);
  animation: pulse-timer 1s infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(0.98); }
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 26px;
  align-items: start;
}

.quiz-primary {
  min-width: 0;
}

/* Question Card */
.question-card {
  background: var(--surface);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
}

.question-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.question-counter {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-muted);
}

.question-counter strong {
  color: var(--primary);
  font-size: 17px;
}

.question-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.question-progress {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 24px;
}

.question-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #a855f7 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.question-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.question-title {
  font-size: clamp(20px, 2.3vw, 25px);
  font-weight: 800;
  line-height: 1.62;
  color: var(--ink);
  margin: 0 0 26px;
  letter-spacing: -0.2px;
}

/* MCQ Options */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.answer-option {
  width: 100%;
  min-height: 60px;
  background: var(--surface);
  border: 2px solid var(--border-line);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.answer-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

.answer-option:active:not(:disabled) {
  transform: scale(0.99);
}

.option-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border-line);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink-secondary);
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.option-text {
  flex: 1;
  line-height: 1.5;
}

/* Selected Option State (Exam) */
.answer-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-deep);
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.answer-option.selected .option-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Correct Option State (Practice & Review) */
.answer-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.answer-option.correct .option-badge {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

/* Incorrect Option State (Practice & Review) */
.answer-option.incorrect {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger-text);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.answer-option.incorrect .option-badge {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.option-status-icon {
  margin-left: auto;
  flex-shrink: 0;
}

.answer-option.correct .option-status-icon { color: var(--success); }
.answer-option.incorrect .option-status-icon { color: var(--danger); }

/* Explanation Box */
.feedback-box {
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius-xl);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: slideDown 0.25s ease;
}

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

.feedback-box.success {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid var(--success-border);
  color: var(--success-text);
}

.feedback-box.error {
  background: linear-gradient(135deg, #fff1f2 0%, #fef2f2 100%);
  border: 1.5px solid var(--danger-border);
  color: var(--danger-text);
}

.feedback-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.feedback-body strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.feedback-body p {
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  color: var(--ink-secondary);
}

/* Quiz Navigation Controls */
.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
}

.quiz-footer-hint {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Navigator Grid */
.navigator {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 92px;
}

.navigator h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.navigator p {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0 0 18px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.question-dot {
  aspect-ratio: 1;
  border: 1.5px solid var(--border-line);
  background: var(--surface-alt);
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  position: relative;
  transition: all 0.15s ease;
}

.question-dot:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.question-dot.current {
  outline: 3px solid var(--primary-border);
  outline-offset: 1px;
  border-color: var(--primary);
  color: var(--primary);
}

.question-dot.answered {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.question-dot.correct {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.question-dot.wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.question-dot.flagged::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--secondary);
}

.navigator-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 700;
}

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

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
}

.legend-swatch.blank {
  background: var(--surface-alt);
  border-color: var(--border-line);
}

.legend-swatch.flagged {
  background: var(--secondary);
  border: none;
}

/* ==========================================================================
   Exam Setup & Modal
   ========================================================================== */

.exam-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.8fr);
  gap: 26px;
}

.setup-card, .rules-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.setup-card h2, .rules-card h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}

.setup-card p, .rules-card p {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 24px;
}

.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-group .field {
  width: 100%;
}

.form-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
}

.segmented-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-line);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 800;
  transition: all 0.18s ease;
}

.segmented-btn:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.segmented-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.rules-list {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.rules-list li:last-child {
  border-bottom: none;
}

.rules-list .icon {
  color: var(--primary);
  margin-top: 2px;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeInModal 0.2s ease;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: min(100%, 480px);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid var(--border-card);
}

.modal-box h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
}

.modal-box p {
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.65;
  margin: 0 0 22px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.modal-stat-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
}

.modal-stat-pill strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.modal-stat-pill span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  display: block;
  margin-top: 2px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   Results & Review Page
   ========================================================================== */

.result-hero {
  background: linear-gradient(135deg, #3b0764 0%, #581c87 40%, #7c3aed 100%);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  box-shadow: 0 20px 40px -8px rgba(124, 58, 237, 0.35);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.result-hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
}

.result-hero-text h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin: 6px 0;
}

.result-hero-text p {
  font-size: 14px;
  color: #ede9fe;
  margin: 0;
  max-width: 500px;
}

.result-score-circle {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-xl);
  padding: 22px 32px;
  text-align: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.result-score-circle strong {
  display: block;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
}

.result-score-circle span {
  font-size: 14px;
  color: #ede9fe;
  font-weight: 600;
  display: block;
  margin-top: 4px;
}

.result-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
}

.metric-card strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.metric-card span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  display: block;
  margin-top: 4px;
}

.metric-card.correct strong { color: var(--success); }
.metric-card.wrong strong { color: var(--danger); }
.metric-card.skipped strong { color: var(--warning); }
.metric-card.percent strong { color: var(--primary); }

.review-item {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.review-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.review-item h3 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.62;
  color: var(--ink);
  margin: 0 0 16px;
}

.review-answer-row {
  font-size: 14px;
  margin: 6px 0;
  color: var(--ink-secondary);
}

.review-answer-row b {
  font-weight: 800;
}

.review-answer-row.correct b { color: var(--success-text); }
.review-answer-row.wrong b { color: var(--danger-text); }

.review-expl {
  background: linear-gradient(135deg, #faf7ff 0%, #f4ecff 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-secondary);
}

.review-expl strong {
  color: var(--primary-dark);
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.history-card:hover {
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.history-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-info h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}

.history-info p {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
}

.history-score-badge {
  text-align: right;
}

.history-score-badge strong {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.history-score-badge span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  display: block;
}

/* ==========================================================================
   Empty States & Toast
   ========================================================================== */

.empty-state {
  background: var(--surface);
  border: 2px dashed var(--border-line);
  border-radius: var(--radius-xl);
  padding: 60px 24px;
  text-align: center;
  margin: 20px 0;
}

.empty-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
}

.empty-state h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px;
}

.empty-state p {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 400px;
  margin: 0 auto 22px;
  line-height: 1.65;
}

/* Toast */
.toast-notice {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  z-index: 200;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Boot screen */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #faf8fe;
  text-align: center;
}

.boot-screen img {
  width: 150px;
  height: auto;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 12px rgba(124, 58, 237, 0.18));
}

.boot-screen h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-deep);
  margin: 0 0 4px;
}

.boot-screen p {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 18px;
}

.boot-spinner {
  width: 32px;
  height: 32px;
  border: 3.5px solid #ede9fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.noscript-message {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary-deep);
  color: white;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  z-index: 300;
}

.mobile-bottom-nav {
  display: none;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1100px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  
  .dashboard-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  
  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 40px rgba(0, 0, 0, 0.18);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .drawer-backdrop.show {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 55;
  }
  
  .main-wrap {
    margin-left: 0;
  }
  
  .topbar {
    padding: 0 20px;
    height: 64px;
  }
  
  .mobile-brand {
    display: flex;
  }
  
  .crumb {
    display: none;
  }
  
  .top-search-btn {
    min-width: 0;
    padding: 8px 12px;
  }
  
  .top-search-btn span, .top-search-btn .kbd {
    display: none;
  }
  
  .profile-chip {
    display: none;
  }
  
  .content {
    padding: 22px 20px 88px;
  }
  
  .quiz-layout {
    grid-template-columns: 1fr;
  }
  
  .navigator {
    position: static;
    margin-top: 20px;
  }
  
  .question-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-line);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 4px 6px max(6px, env(safe-area-inset-bottom));
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  }
  
  .bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 50px;
    height: 100%;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
  }
  
  .bottom-nav-btn.active {
    color: var(--primary);
    font-weight: 800;
  }
  
  .bottom-nav-btn .icon {
    width: 22px;
    height: 22px;
  }
  
  .bottom-nav-btn.active .icon {
    stroke-width: 2.4;
  }
}

@media (max-width: 680px) {
  .hero {
    padding: 28px 22px;
    border-radius: var(--radius-lg);
  }
  
  .hero h2 {
    font-size: 24px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px 14px;
  }
  
  .stat-icon {
    width: 40px;
    height: 40px;
  }
  
  .stat-info strong {
    font-size: 20px;
  }
  
  .mode-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .mode-card {
    padding: 20px;
  }
  
  .mode-icon-art {
    width: 54px;
    height: 54px;
  }
  
  .subject-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-aside {
    grid-template-columns: 1fr;
  }
  
  .question-card {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }
  
  .question-title {
    font-size: 19px;
    line-height: 1.58;
  }
  
  .answer-option {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 54px;
  }
  
  .option-badge {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
  
  .question-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .exam-setup-grid {
    grid-template-columns: 1fr;
  }
  
  .result-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 22px;
  }
  
  .result-score-circle {
    width: 100%;
  }
  
  .result-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 420px) {
  .content {
    padding: 18px 14px 84px;
  }
  
  .page-heading h1 {
    font-size: 22px;
  }
  
  .question-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .quiz-pill {
    padding: 6px 14px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   সিলেবাস ও পরিসংখ্যান (Syllabus & Statistics Overview)
   ========================================================================== */

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warning-bg);
  border: 1.5px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.notice .icon {
  color: var(--secondary);
  flex-shrink: 0;
}

.syllabus-level {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
  overflow: hidden;
}

.syllabus-level-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, #faf7ff 0%, #f3ebff 100%);
  border-bottom: 1px solid var(--border-card);
}

.syllabus-level-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.syllabus-level-title h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary-deep);
  margin: 0 0 3px;
  line-height: 1.3;
}

.syllabus-level-title p {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}

.syllabus-group {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
}

.syllabus-group:last-child {
  border-bottom: none;
}

.syllabus-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.syllabus-group-head h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.syllabus-group-head h3::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary) 0%, #a855f7 100%);
}

.syllabus-subjects {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.syllabus-subject {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border-line);
  border-radius: var(--radius-lg);
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.syllabus-subject:hover {
  border-color: var(--primary-border);
  background: var(--primary-light);
  transform: translateX(3px);
}

.syllabus-subject.open {
  border-color: var(--primary);
  background: var(--primary-light);
}

.syllabus-subject .subject-icon-box {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.syllabus-subject-info {
  flex: 1;
  min-width: 0;
}

.syllabus-subject-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
}

.syllabus-subject-info span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: 2px;
}

.syllabus-subject .subject-arrow-icon {
  color: var(--ink-light);
  transition: transform 0.22s ease, color 0.2s ease;
  flex-shrink: 0;
}

.syllabus-subject:hover .subject-arrow-icon,
.syllabus-subject.open .subject-arrow-icon {
  color: var(--primary);
}

.syllabus-subject .subject-arrow-icon.rotated {
  transform: rotate(180deg);
}

.syllabus-chapters {
  margin: 8px 0 2px;
  padding: 6px 4px 6px 16px;
  border-left: 3px solid var(--primary-border);
  animation: slideDown 0.22s ease;
}

.syllabus-chapter {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-light);
}

.syllabus-chapter:last-of-type {
  border-bottom: none;
}

.syllabus-chapter .chapter-index {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.syllabus-chapter-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.syllabus-start {
  margin-top: 12px;
}

@media (max-width: 680px) {
  .syllabus-level-head {
    padding: 18px 16px;
    gap: 12px;
  }

  .syllabus-level-icon {
    width: 42px;
    height: 42px;
  }

  .syllabus-level-title h2 {
    font-size: 17px;
  }

  .syllabus-level-title p {
    font-size: 12px;
  }

  .syllabus-group {
    padding: 14px 16px;
  }

  .syllabus-group-head {
    margin-bottom: 12px;
  }

  .syllabus-subject {
    padding: 12px 13px;
    gap: 11px;
  }

  .syllabus-subject .subject-icon-box {
    width: 38px;
    height: 38px;
  }

  .syllabus-subject-info strong {
    font-size: 14px;
  }

  .syllabus-subject-info span {
    font-size: 11px;
  }

  .syllabus-chapters {
    padding-left: 10px;
  }

  .syllabus-chapter {
    gap: 10px;
    padding: 10px 2px;
  }

  .syllabus-chapter-count {
    font-size: 11px;
    padding: 3px 9px;
  }
}

@media (max-width: 420px) {
  .bottom-nav-btn {
    min-width: 0;
    font-size: 10px;
  }

  .bottom-nav-btn .icon {
    width: 20px;
    height: 20px;
  }
}
