/* ============================================================
   BILIM ZIRVASI — Premium Dark-Mode Design System
   A stunning glassmorphism UI for Uzbek school testing platform
   ============================================================ */

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

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

/* ── Root Variables ── */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-tertiary: #1a1a3e;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --school-primary: #4f8cff;
  --school-secondary: #ffd700;
  --school-gradient: linear-gradient(135deg, #4f8cff, #6c5ce7);
  --success: #00e676;
  --danger: #ff5252;
  --warning: #ffab40;
  --info: #40c4ff;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ── Light Mode Variables ── */
body[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e4e6eb;
  --text-primary: #1c1e21;
  --text-secondary: rgba(0, 0, 0, 0.7);
  --text-muted: rgba(0, 0, 0, 0.5);
  --border-color: rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ── Custom App Themes Overrides ── */
body[data-color-theme="neon"] {
  --school-primary: #ff00ff;
  --school-secondary: #00ffff;
  --school-gradient: linear-gradient(135deg, #ff00ff, #00ffff);
}

body[data-color-theme="ocean"] {
  --school-primary: #00b4db;
  --school-secondary: #0083b0;
  --school-gradient: linear-gradient(135deg, #00b4db, #0083b0);
}

body[data-color-theme="sunset"] {
  --school-primary: #ff512f;
  --school-secondary: #dd2476;
  --school-gradient: linear-gradient(135deg, #ff512f, #dd2476);
}

/* ── Body ── */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Headings ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  line-height: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--school-gradient);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

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

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

.btn-outline:hover {
  background: var(--school-primary);
  color: white;
}

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

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn-block {
  width: 100%;
}

/* ── Grid System ── */
.grid {
  display: grid;
  gap: 20px;
}

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

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

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

/* ── Form Elements ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--school-primary);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

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

.input-group textarea {
  min-height: 100px;
  resize: vertical;
}

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

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

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

.modal-header h2 {
  font-size: 22px;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  color: white;
  background: var(--glass-bg);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
}

.badge-danger {
  background: rgba(255, 82, 82, 0.15);
  color: var(--danger);
}

.badge-warning {
  background: rgba(255, 171, 64, 0.15);
  color: var(--warning);
}

.badge-info {
  background: rgba(64, 196, 255, 0.15);
  color: var(--info);
}

/* ── Progress Bar ── */
.progress-bar {
  height: 8px;
  background: var(--glass-bg);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--school-gradient);
  transition: width 1s ease;
}

/* ── Stat Cards ── */
.stat-card {
  text-align: center;
  padding: 20px;
}

.stat-card .stat-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 36px;
  font-weight: 800;
  font-family: var(--font-heading);
  background: var(--school-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Navigation ── */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  background: var(--school-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
  background: var(--glass-bg);
}

/* ── Tables ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--glass-bg);
  padding: 4px;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.tab {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 14px;
  white-space: nowrap;
}

.tab.active {
  background: var(--school-primary);
  color: white;
}

.tab:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

/* ── Avatar ── */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--school-gradient);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 32px;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  max-width: 400px;
  margin: 0 auto;
}

/* ── Toast Notifications ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  z-index: 2000;
  animation: slideUp 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast-success {
  background: var(--success);
  color: #000;
}

.toast-error {
  background: var(--danger);
}

.toast-info {
  background: var(--info);
  color: #000;
}

/* ── Search Box ── */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 44px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding-top: 12px;
  padding-bottom: 12px;
  padding-right: 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: var(--school-primary);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

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

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Hero Section ── */
.hero-section {
  padding: 80px 0;
  text-align: center;
}

.hero-title {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  font-family: var(--font-heading);
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* ── School Cards ── */
.school-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--glass-shadow);
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.school-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--school-gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.school-card:hover::before {
  opacity: 0.1;
}

.school-card:hover {
  transform: translateY(-8px);
  border-color: var(--school-primary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.school-card .school-icon {
  font-size: 64px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

.school-card .school-name {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.school-card .school-slogan {
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
  z-index: 1;
  font-style: italic;
}

/* ── Subject Cards ── */
.subject-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.subject-card:hover {
  border-color: var(--school-primary);
  transform: translateY(-2px);
}

.subject-card .subject-icon {
  font-size: 36px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.subject-card .subject-info {
  flex: 1;
}

.subject-card .subject-name {
  font-weight: 600;
  font-size: 16px;
}

.subject-card .subject-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Test Page ── */
.test-container {
  max-width: 900px;
  margin: 0 auto;
}

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

.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--warning);
}

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

.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.question-nav .q-num {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s ease;
}

.question-nav .q-num:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.question-nav .q-num.current {
  border-color: var(--school-primary);
  background: var(--school-primary);
  color: white;
}

.question-nav .q-num.answered {
  background: rgba(0, 230, 118, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.question-nav .q-num.flagged {
  background: rgba(255, 171, 64, 0.2);
  border-color: var(--warning);
  color: var(--warning);
}

.question-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--glass-shadow);
}

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

.question-number {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
}

.option:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.option.selected {
  border-color: var(--school-primary);
  background: rgba(79, 140, 255, 0.1);
}

.option.correct {
  border-color: var(--success);
  background: rgba(0, 230, 118, 0.1);
}

.option.wrong {
  border-color: var(--danger);
  background: rgba(255, 82, 82, 0.1);
}

.option-letter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--glass-bg);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

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

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

.option.wrong .option-letter {
  background: var(--danger);
  color: white;
}

.test-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
}

.test-progress {
  margin-bottom: 24px;
}

.test-progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Results Page ── */
.result-hero {
  text-align: center;
  padding: 40px;
  margin-bottom: 32px;
}

.result-score {
  font-size: 80px;
  font-weight: 900;
  font-family: var(--font-heading);
  background: var(--school-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.result-percentage {
  font-size: 24px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.result-grade {
  display: inline-flex;
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 700;
}

.grade-a {
  background: rgba(0, 230, 118, 0.15);
  color: var(--success);
}

.grade-b {
  background: rgba(64, 196, 255, 0.15);
  color: var(--info);
}

.grade-c {
  background: rgba(255, 171, 64, 0.15);
  color: var(--warning);
}

.grade-f {
  background: rgba(255, 82, 82, 0.15);
  color: var(--danger);
}

.review-item {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  padding: 20px;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
}

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

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

.review-item.skipped {
  border-left: 4px solid var(--text-muted);
}

.explanation-box {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(64, 196, 255, 0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--info);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.donut-chart {
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
}

/* ── Admin Page ── */
.admin-layout {
  display: flex;
  gap: 24px;
}

.admin-sidebar {
  position: sticky;
  top: 80px;
  min-width: 240px;
  align-self: flex-start;
}

.admin-content {
  flex: 1;
  min-width: 0;
}

.question-item {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s ease;
}

.question-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.question-item .q-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.question-item .q-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Profile Modal ── */
.profile-avatars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.profile-avatar-option {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  background: var(--glass-bg);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.profile-avatar-option.selected {
  border-color: var(--school-primary);
  box-shadow: 0 0 16px rgba(79, 140, 255, 0.3);
}

.profile-avatar-option:hover {
  transform: scale(1.1);
}

/* ── Particles Canvas ── */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.landing-content {
  position: relative;
  z-index: 1;
}

/* ── Section Titles ── */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  font-family: var(--font-heading);
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 20px;
}

/* ── Utility Classes ── */
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.text-center { text-align: center; }

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

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.hidden { display: none; }

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── Selection ── */
::selection {
  background: var(--school-primary);
  color: white;
}

/* ── Keyframe Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

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

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(79, 140, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(79, 140, 255, 0.5); }
}

/* ── Animation Utilities ── */
.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.5s ease; }
.slide-down { animation: slideDown 0.5s ease; }
.scale-in { animation: scaleIn 0.3s ease; }


@media print { body { background: #fff !important; color: #000 !important; } .glass-card { background: #fff !important; color: #000 !important; border: 1px solid #ccc !important; box-shadow: none !important; } nav, #action-buttons, footer, .modal-overlay, #theme-toggle { display: none !important; } .result-hero, #review-section { page-break-inside: avoid; } #tab-content-all, #tab-content-wrong { display: block !important; } }

/* ── Modern Aesthetics & Hover Effects ── */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  transition: transform 0.5s;
}

.btn:active::after {
  transform: translate(-50%, -50%) scale(1);
  transition: 0s;
}

.glass-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.2);
}

/* ── Responsive Media Queries ── */
@media (max-width: 768px) {
  /* Layout adjustments */
  body {
    padding: 10px;
  }
  
  .navbar-container {
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }
  
  .navbar-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .main-content {
    padding: 15px 10px;
  }
  
  /* Hero & Headings */
  .hero-title {
    font-size: 36px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  /* Grids */
  .schools-grid, 
  .subjects-grid, 
  .stats-grid, 
  .leaderboard-list {
    grid-template-columns: 1fr;
  }
  
  /* Dashboard Header */
  .dashboard-header {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .welcome-details {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  /* Test Interface */
  .test-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .question-card {
    padding: 20px;
  }
  
  .question-text {
    font-size: 16px;
  }
  
  .option {
    padding: 12px 15px;
    font-size: 14px;
  }
  
  .test-actions {
    flex-direction: column;
  }
  
  .test-actions .btn {
    width: 100%;
  }
  
  /* Result Page */
  .result-score {
    font-size: 60px;
  }
  
  /* Modals */
  .modal-container {
    padding: 20px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .form-group input, 
  .form-group select {
    padding: 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }
  
  .stat-value {
    font-size: 32px;
  }
  
  .option-letter {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
}