/* ============================================
   TestEara — Design System
   Dark theme, glassmorphism, premium exam UI
   ============================================ */

/* ===== GOOGLE FONTS (loaded in HTML) ===== */

/* ===== CSS VARIABLES ===== */
:root {
  /* Background */
  --bg-primary: #06070f;
  --bg-secondary: #0c0e1a;
  --bg-tertiary: #111427;
  --bg-elevated: #161a30;

  /* Surface / Glass */
  --glass-bg: rgba(17, 20, 39, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.03);

  /* Primary Gradient */
  --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 30%, #d946ef 70%, #f43f5e 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4, #3b82f6, #8b5cf6);
  --gradient-success: linear-gradient(135deg, #10b981, #34d399);
  --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #f97316, #ef4444);

  /* Solid Colors */
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #6366f1;
  --accent: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #c4b5fd;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(139, 92, 246, 0.5);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
  --shadow-glow-accent: 0 0 30px rgba(34, 211, 238, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;
  --font-4xl: 2.25rem;
  --font-5xl: 3rem;
  --font-6xl: 3.75rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;

  /* Z-Index */
  --z-sidebar: 100;
  --z-topbar: 110;
  --z-modal-backdrop: 200;
  --z-modal: 210;
  --z-toast: 300;
  --z-tooltip: 400;
}


/* ===== RESET ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
}

::selection {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
}

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


/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--font-5xl); }
h2 { font-size: var(--font-4xl); }
h3 { font-size: var(--font-3xl); }
h4 { font-size: var(--font-2xl); }
h5 { font-size: var(--font-xl); }
h6 { font-size: var(--font-lg); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

.text-center { text-align: center; }
.text-right { text-align: right; }


/* ===== LAYOUT UTILITIES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

.grid {
  display: grid;
  gap: var(--space-lg);
}

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

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }
.visible { display: block; }


/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-sm);
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition-base);
}

.btn:hover::before {
  background: rgba(255, 255, 255, 0.05);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(139, 92, 246, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
}

.btn-success {
  background: var(--gradient-success);
  color: #fff;
}

.btn-lg {
  padding: 16px 36px;
  font-size: var(--font-base);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--font-xs);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

.btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}


/* ===== CARDS ===== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.card-glow:hover {
  box-shadow: var(--shadow-glow);
  border-color: rgba(139, 92, 246, 0.2);
}

.card-flat {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.card-stat {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.card-stat .stat-value {
  font-size: var(--font-4xl);
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-stat .stat-label {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}


/* ===== ICON BOX ===== */
.icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xl);
  flex-shrink: 0;
}

.icon-box-primary {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
}

.icon-box-accent {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
}

.icon-box-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.icon-box-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.icon-box-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.icon-box-lg {
  width: 64px;
  height: 64px;
  font-size: var(--font-2xl);
  border-radius: var(--radius-lg);
}


/* ===== FORMS & INPUTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  transition: all var(--transition-base);
  width: 100%;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  background: var(--bg-tertiary);
}

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

.form-input-error {
  border-color: var(--error);
}

.form-error {
  font-size: var(--font-xs);
  color: var(--error);
}

.form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  transition: all var(--transition-base);
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}


/* ===== FILE UPLOAD DROPZONE ===== */
.dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  transition: all var(--transition-base);
  cursor: pointer;
  background: rgba(139, 92, 246, 0.03);
  position: relative;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
  box-shadow: var(--shadow-glow);
}

.dropzone-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.7;
}

.dropzone-text {
  font-size: var(--font-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.dropzone-hint {
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-elevated);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.file-preview-icon {
  font-size: 28px;
}

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

.file-preview-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.file-preview-remove {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-preview-remove:hover {
  background: rgba(239, 68, 68, 0.2);
}


/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.badge-lg {
  padding: 6px 14px;
  font-size: var(--font-sm);
}


/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-bar-success .progress-bar-fill {
  background: var(--gradient-success);
}


/* ===== CIRCULAR PROGRESS ===== */
.circular-progress {
  position: relative;
  width: 120px;
  height: 120px;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress .track {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.circular-progress .fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.circular-progress .value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circular-progress .value-num {
  font-size: var(--font-2xl);
  font-weight: 800;
  color: var(--text-primary);
}

.circular-progress .value-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
}


/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-spring);
  box-shadow: var(--shadow-lg);
}

.modal-backdrop.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.modal-title {
  font-size: var(--font-xl);
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  font-size: var(--font-lg);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-xl);
}


/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-sm);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}


/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-width: 300px;
  max-width: 450px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  border-left: 3px solid var(--primary);
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-warning { border-left-color: var(--warning); }

.toast-message {
  flex: 1;
  font-size: var(--font-sm);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--font-lg);
  padding: 0;
  line-height: 1;
}


/* ===== LOADING SPINNER ===== */
.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-3xl);
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loader-text {
  font-size: var(--font-sm);
  color: var(--text-muted);
  animation: pulse 1.5s ease infinite;
}

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

.loader-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }


/* =================================================
   LANDING PAGE
   ================================================= */

/* Navbar */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-topbar);
  padding: var(--space-md) 0;
  transition: all var(--transition-base);
  background: transparent;
}

.landing-nav.scrolled {
  background: rgba(6, 7, 15, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.landing-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: var(--font-xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}


/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-4xl) 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  top: 10%;
  left: 20%;
  animation: floatBlob 8s ease-in-out infinite;
}

.hero-bg::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
  bottom: 10%;
  right: 15%;
  animation: floatBlob 10s ease-in-out infinite reverse;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  color: var(--text-accent);
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s ease;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero p {
  font-size: var(--font-lg);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  animation: fadeInUp 0.6s ease 0.3s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xl);
  margin-top: var(--space-3xl);
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-stat-num {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: var(--font-sm);
  color: var(--text-muted);
}


/* Features Section */
.section {
  padding: var(--space-4xl) 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

.section-header .section-tag {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.section-header h2 {
  margin-bottom: var(--space-md);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.section-header p {
  font-size: var(--font-lg);
}

.feature-card {
  padding: var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.feature-card .icon-box {
  margin-bottom: var(--space-lg);
}

.feature-card h4 {
  font-size: var(--font-lg);
  margin-bottom: var(--space-sm);
}

.feature-card p {
  font-size: var(--font-sm);
}

.feature-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: all var(--transition-base);
}

.feature-card:hover::after {
  opacity: 1;
  width: 80%;
}


/* How It Works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  position: relative;
}

.steps-grid::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-lg);
  margin: 0 auto var(--space-lg);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.step-card h4 {
  font-size: var(--font-base);
  margin-bottom: var(--space-sm);
}

.step-card p {
  font-size: var(--font-sm);
}


/* Exam Badges */
.exam-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.exam-badge {
  padding: 10px 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  cursor: default;
}

.exam-badge:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}


/* CTA Section */
.cta-section {
  text-align: center;
  padding: var(--space-4xl) 0;
  position: relative;
}

.cta-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-hero);
}

.cta-card h2 {
  margin-bottom: var(--space-md);
}

.cta-card p {
  margin-bottom: var(--space-2xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}


/* Footer */
.landing-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2xl) 0;
  text-align: center;
}

.landing-footer p {
  font-size: var(--font-sm);
  color: var(--text-muted);
}


/* =================================================
   APP SHELL
   ================================================= */

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-sidebar);
  transition: width var(--transition-base), transform var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-2xl);
  font-size: var(--font-lg);
  font-weight: 800;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--font-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary);
}

.sidebar-link .link-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: var(--font-lg);
}

.sidebar-section-title {
  font-size: var(--font-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-md) 14px var(--space-sm);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-lg);
  margin-top: var(--space-lg);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-sm);
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-name {
  font-size: var(--font-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: var(--font-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


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

/* Topbar */
.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  background: rgba(6, 7, 15, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-title {
  font-size: var(--font-lg);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--font-xl);
  padding: var(--space-sm);
}


/* Content Area */
.content-area {
  padding: var(--space-xl);
}

/* App View */
.app-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.app-view.active {
  display: block;
}


/* =================================================
   CREATE TEST VIEW
   ================================================= */
.create-test-form {
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}


/* =================================================
   TEST ENGINE VIEW (Full Screen)
   ================================================= */
.test-view-container {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.test-view-container.active {
  display: flex;
}

/* Test Header */
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.test-timer {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.test-timer-icon {
  font-size: var(--font-xl);
}

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

.test-timer.danger {
  color: var(--error);
  animation: pulse 0.5s ease infinite;
}

/* Test Body */
.test-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.test-question-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2xl);
}

.question-number {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.question-text {
  font-size: var(--font-lg);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-item:hover {
  border-color: var(--border-light);
  background: var(--bg-tertiary);
}

.option-item.selected {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
}

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

.option-item.wrong {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.08);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-sm);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.option-item.selected .option-letter {
  background: var(--primary);
  color: #fff;
}

.option-item.correct .option-letter {
  background: var(--success);
  color: #fff;
}

.option-item.wrong .option-letter {
  background: var(--error);
  color: #fff;
}

.option-text {
  padding-top: 4px;
  line-height: 1.5;
}


/* Question Palette */
.test-palette {
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.palette-header {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.unattempted { background: var(--bg-elevated); border: 1px solid var(--border-light); }
.legend-dot.answered { background: var(--success); }
.legend-dot.marked { background: var(--warning); }
.legend-dot.current { background: var(--primary); }

.palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
  flex: 1;
}

.palette-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.palette-btn:hover {
  border-color: var(--border-light);
}

.palette-btn.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.palette-btn.answered {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--success);
  color: var(--success);
}

.palette-btn.marked {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--warning);
  color: var(--warning);
}

/* Test Footer */
.test-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
}

.test-nav-btns {
  display: flex;
  gap: var(--space-md);
}


/* =================================================
   RESULTS VIEW
   ================================================= */
.results-header {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.results-score-circle {
  margin: 0 auto var(--space-lg);
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.results-breakdown {
  margin-top: var(--space-2xl);
}

.result-question-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.result-question-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.result-explanation {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
}


/* =================================================
   CUTOFF ANALYSIS
   ================================================= */
.cutoff-card {
  max-width: 600px;
  margin: 0 auto;
}

.cutoff-bar-container {
  position: relative;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  margin: var(--space-xl) 0;
  overflow: hidden;
}

.cutoff-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.cutoff-bar-fill.above { background: var(--gradient-success); }
.cutoff-bar-fill.below { background: var(--gradient-danger); }

.cutoff-marker {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 3px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transform: translateX(-50%);
}

.cutoff-marker-label {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--font-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.probability-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--font-lg);
}

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

.probability-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.probability-badge.low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}


/* =================================================
   DASHBOARD VIEW
   ================================================= */
.dashboard-welcome {
  margin-bottom: var(--space-2xl);
}

.dashboard-welcome h2 {
  font-size: var(--font-3xl);
  margin-bottom: var(--space-sm);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.recent-tests-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.test-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
}

.test-history-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.test-history-info h5 {
  font-size: var(--font-base);
  margin-bottom: var(--space-xs);
}

.test-history-meta {
  display: flex;
  gap: var(--space-md);
  font-size: var(--font-xs);
  color: var(--text-muted);
}

.test-history-score {
  font-size: var(--font-xl);
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: var(--space-3xl);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state h4 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  margin-bottom: var(--space-xl);
}


/* =================================================
   ANIMATIONS
   ================================================= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

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

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

.animate-fadeIn { animation: fadeIn 0.5s ease; }
.animate-fadeInUp { animation: fadeInUp 0.5s ease; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease; }

.stagger-1 { animation-delay: 0.1s; animation-fill-mode: both; }
.stagger-2 { animation-delay: 0.2s; animation-fill-mode: both; }
.stagger-3 { animation-delay: 0.3s; animation-fill-mode: both; }
.stagger-4 { animation-delay: 0.4s; animation-fill-mode: both; }
.stagger-5 { animation-delay: 0.5s; animation-fill-mode: both; }


/* =================================================
   RESPONSIVE
   ================================================= */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid::before { display: none; }
  .results-stats { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  .test-palette {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  h1 { font-size: var(--font-4xl); }
  h2 { font-size: var(--font-3xl); }

  .container {
    padding: 0 var(--space-md);
  }

  /* Landing */
  .nav-links { display: none; }
  
  .hero-stats {
    flex-direction: column;
    gap: var(--space-lg);
  }

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

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

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

  /* App */
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .content-area {
    padding: var(--space-md);
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .results-stats {
    grid-template-columns: 1fr 1fr;
  }

  /* Test Engine */
  .test-question-area {
    padding: var(--space-lg);
  }

  .test-header,
  .test-footer {
    padding: var(--space-md);
  }

  /* Modal */
  .modal {
    padding: var(--space-lg);
    margin: var(--space-md);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: var(--font-3xl);
  }

  .test-footer {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .test-nav-btns {
    width: 100%;
    justify-content: space-between;
  }
}


/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-sidebar) - 1);
}

.sidebar-overlay.active {
  display: block;
}


/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-elevated) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-heading {
  height: 24px;
  width: 40%;
  margin-bottom: var(--space-md);
}

.skeleton-card {
  height: 200px;
}


/* ============================================
   TEST VIEW — Full-Screen Test Taking UI
   ============================================ */

.test-view-container {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 1000;
}

/* Test Header */
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-xl);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.test-timer {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--success);
  padding: var(--space-xs) var(--space-md);
  background: rgba(34, 197, 94, 0.1);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(34, 197, 94, 0.2);
  transition: all 0.3s ease;
}

.test-timer.timer-warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  animation: pulse 1s infinite;
}

.test-timer.timer-critical {
  color: var(--error);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  animation: pulse 0.5s infinite;
}

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

/* Test Body */
.test-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.test-question-area {
  flex: 1;
  padding: var(--space-2xl);
  overflow-y: auto;
}

.question-number {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.question-text {
  font-size: var(--font-lg);
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--space-xl);
  white-space: pre-wrap;
}

/* Option Items */
.options-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.option-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(4px);
}

.option-item.selected {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.option-letter {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tertiary);
  font-weight: 700;
  font-size: var(--font-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.option-item.selected .option-letter {
  background: var(--gradient-primary);
  color: white;
}

.option-text {
  padding-top: 6px;
  line-height: 1.5;
}


/* Question Palette */
.test-palette {
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
  padding: var(--space-lg);
  overflow-y: auto;
  flex-shrink: 0;
}

.palette-header {
  font-weight: 700;
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  font-size: var(--font-xs);
  color: var(--text-muted);
}

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

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.current { background: var(--primary); }
.legend-dot.answered { background: var(--success); }
.legend-dot.marked { background: var(--warning); }
.legend-dot.unattempted { background: var(--bg-tertiary); border: 1px solid var(--border-light); }

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

.palette-btn {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-weight: 700;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.palette-btn.unattempted {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border-color: var(--border-light);
}

.palette-btn.visited {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.3);
}

.palette-btn.current {
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

.palette-btn.answered {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
}

.palette-btn.marked {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.4);
}

.palette-btn.marked.answered {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(245, 158, 11, 0.15));
  border-color: var(--warning);
}

/* Test Footer */
.test-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-xl);
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.test-nav-btns {
  display: flex;
  gap: var(--space-sm);
}

.btn-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: var(--warning) !important;
  color: var(--warning) !important;
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  border: none;
}


/* ============================================
   RESULTS VIEW
   ============================================ */

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.results-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid;
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid;
  opacity: 0.3;
}

.score-value {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
}

.score-label {
  font-size: var(--font-sm);
  font-weight: 600;
  margin-top: var(--space-xs);
}

.grade-excellent { border-color: #22c55e; color: #22c55e; background: rgba(34, 197, 94, 0.08); }
.grade-excellent::before { border-color: #22c55e; }
.grade-great { border-color: #3b82f6; color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.grade-great::before { border-color: #3b82f6; }
.grade-good { border-color: #8b5cf6; color: #8b5cf6; background: rgba(139, 92, 246, 0.08); }
.grade-good::before { border-color: #8b5cf6; }
.grade-average { border-color: #f59e0b; color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.grade-average::before { border-color: #f59e0b; }
.grade-poor { border-color: #ef4444; color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.grade-poor::before { border-color: #ef4444; }

/* Stats List */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: var(--font-sm);
}

.stat-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-value.correct { color: var(--success); }
.stat-value.wrong { color: var(--error); }

/* Cutoff Grid */
.cutoff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: var(--space-sm);
}

.cutoff-item {
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

.cutoff-item.passed { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.05); }
.cutoff-item.failed { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }

.cutoff-category {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cutoff-range {
  font-weight: 800;
  font-size: var(--font-lg);
  margin-bottom: 4px;
}

.cutoff-status {
  font-size: var(--font-xs);
  font-weight: 600;
}

/* Question-wise Review */
.review-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.review-item {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

.review-item.correct { border-left: 4px solid var(--success); }
.review-item.wrong { border-left: 4px solid var(--error); }
.review-item.unattempted { border-left: 4px solid var(--text-muted); }

.review-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.review-qno {
  font-weight: 800;
  font-size: var(--font-sm);
  color: var(--text-muted);
}

.review-status-badge {
  font-size: var(--font-xs);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.review-status-badge.correct { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.review-status-badge.wrong { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.review-status-badge.unattempted { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

.review-topic {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-left: auto;
}

.review-question {
  font-weight: 500;
  margin-bottom: var(--space-md);
  line-height: 1.6;
  white-space: pre-wrap;
}

.review-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.review-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
}

.review-option-key {
  font-weight: 700;
  min-width: 20px;
  color: var(--text-muted);
}

.review-option.correct-option {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  font-weight: 600;
}

.review-option.wrong-option {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  text-decoration: line-through;
  opacity: 0.8;
}

.review-explanation {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  background: rgba(139, 92, 246, 0.05);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  line-height: 1.5;
}


/* ============================================
   RESPONSIVE — Test View
   ============================================ */

@media (max-width: 768px) {
  .test-header {
    padding: var(--space-xs) var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-xs);
  }

  .test-timer {
    font-size: var(--font-md);
    order: -1;
    width: 100%;
    justify-content: center;
  }

  .test-body {
    flex-direction: column;
  }

  .test-question-area {
    padding: var(--space-lg);
  }

  .test-palette {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    max-height: 200px;
  }

  .palette-grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .test-footer {
    padding: var(--space-xs) var(--space-md);
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .score-circle {
    width: 140px;
    height: 140px;
  }

  .score-value {
    font-size: 32px;
  }
}


/* ============================================
   DASHBOARD & MY TESTS
   ============================================ */

/* Test History Cards */
.test-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.test-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s ease;
}

.test-history-card:hover {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.test-history-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.test-history-score {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: var(--font-sm);
  flex-shrink: 0;
  border: 2px solid;
}

.test-history-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.test-history-meta {
  font-size: var(--font-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

.test-history-right {
  flex-shrink: 0;
}

/* My Tests Summary */
.my-tests-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: center;
}

.summary-item {
  padding: var(--space-sm);
}

.summary-value {
  font-size: var(--font-2xl);
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-label {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-xs);
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 768px) {
  .my-tests-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .test-history-left {
    gap: var(--space-md);
  }

  .test-history-score {
    width: 44px;
    height: 44px;
    font-size: var(--font-xs);
  }
}


/* ============================================
   POLISH — Micro-Animations & Transitions
   ============================================ */

/* Smooth View Transitions */
.app-view {
  animation: viewFadeIn 0.3s ease-out;
}

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

/* Test Start Animation */
.test-view-container[style*="flex"] {
  animation: testSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes testSlideIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* Card Hover Lift */
.card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Stat Cards Shimmer */
.card-stat {
  position: relative;
  overflow: hidden;
}

.card-stat::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Spinner (used in buttons) */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* Score Circle Appear Animation */
.score-circle {
  animation: scoreReveal 0.6s ease-out;
}

@keyframes scoreReveal {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Option select ripple */
.option-item:active {
  transform: scale(0.98);
}

/* Badge */
.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Focus styles for accessibility */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.option-item:focus-visible,
.palette-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 3px;
}

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

/* Selection color */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

/* Social Auth Buttons Grid */
.social-auth-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.social-auth-grid .btn {
  font-size: var(--font-sm);
  padding: var(--space-sm) var(--space-md);
}
