/* ============================================================
   GovExam Portal — Design System
   ============================================================ */

/* CSS Custom Properties */
:root {
  --primary:        #2563EB;
  --primary-dark:   #1d4ed8;
  --primary-light:  #dbeafe;
  --secondary:      #64748b;
  --success:        #059669;
  --success-light:  #d1fae5;
  --warning:        #D97706;
  --warning-light:  #fef3c7;
  --danger:         #DC2626;
  --danger-light:   #fee2e2;
  --info:           #0ea5e9;
  --info-light:     #e0f2fe;
  --purple:         #7c3aed;
  --purple-light:   #ede9fe;
  --dark:           #1e293b;
  --darker:         #0f172a;
  --gray:           #64748b;
  --gray-100:       #f1f5f9;
  --gray-200:       #e2e8f0;
  --gray-300:       #cbd5e1;
  --light:          #f8fafc;
  --white:          #ffffff;
  --border:         #e2e8f0;
  --shadow:         0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl:      0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --transition:     all 0.2s ease;
  --transition-slow:all 0.35s ease;
  --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--dark);
  background: var(--light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
}

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

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

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

/* ============================================================
   Scrollbar
   ============================================================ */

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

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

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

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

/* ============================================================
   Cards
   ============================================================ */

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

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

.card.no-lift:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.card-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

.card-body {
  padding: 1.25rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.3);
}

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

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

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

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Status Badges
   ============================================================ */

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-upcoming {
  background: var(--primary-light);
  color: #1e40af;
}

.badge-active {
  background: var(--success-light);
  color: #065f46;
}

.badge-result {
  background: var(--purple-light);
  color: #4c1d95;
}

.badge-admitcard {
  background: #fed7aa;
  color: #92400e;
}

.badge-free {
  background: var(--success-light);
  color: #065f46;
}

.badge-premium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* ============================================================
   Form Controls
   ============================================================ */

.form-control,
.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  padding: 0.5rem 0.875rem;
  transition: var(--transition);
  color: var(--dark);
  background-color: var(--white);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--dark);
}

.input-group .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
  z-index: 1030;
}

.navbar-brand {
  font-size: 1.2rem;
  font-weight: 700;
}

.nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.navbar .nav-link:hover {
  background: var(--primary-light);
  color: var(--primary) !important;
}

.navbar .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
}

/* ============================================================
   Hero Section
   ============================================================ */

.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563EB 50%, #0ea5e9 100%);
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  color: white;
  padding: 4.5rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.hero h1 { color: white; font-size: 2.5rem; }
.hero p   { color: rgba(255,255,255,0.85); font-size: 1.1rem; }

@media (max-width: 768px) {
  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 1.75rem; }
}

/* ============================================================
   Glassmorphism Auth
   ============================================================ */

.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #2563EB 0%, #7c3aed 50%, #059669 100%);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-xl);
}

.auth-card h2 {
  color: var(--dark);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--gray);
  font-size: 0.85rem;
}

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

.btn-google {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--dark);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-google:hover {
  background: var(--gray-100);
  box-shadow: var(--shadow);
}

/* ============================================================
   Admin Layout
   ============================================================ */

.admin-body {
  background: #f1f5f9;
}

#adminWrapper {
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--dark);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1040;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.admin-main {
  margin-left: 260px;
  min-height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: var(--shadow);
}

.admin-content {
  margin-left: 260px;
  padding: 1.5rem;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  transition: margin-left 0.3s ease;
}

/* Ensure admin container stays readable on ultra-wide */
.admin-content .container-fluid {
  max-width: 1400px;
}

/* Mobile sidebar toggle (hamburger) */
.admin-sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1045;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* Desktop reopen button — hidden by default, shown only when collapsed */
.admin-sidebar-open-desktop {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1045;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
@media (min-width: 992px) {
  /* Keep desktop reopen hidden unless the sidebar is collapsed */
  .admin-sidebar-open-desktop { display: none !important; }
  body.admin-sidebar-collapsed .admin-sidebar-open-desktop { display: inline-flex !important; }

  /* Collapsed: slide the sidebar away and reclaim the space */
  body.admin-sidebar-collapsed .admin-sidebar {
    transform: translateX(-100%);
  }
  body.admin-sidebar-collapsed .admin-main {
    margin-left: 0;
  }
  body.admin-sidebar-collapsed .admin-content {
    margin-left: 0;
  }
}

/* Sidebar nav links */
.admin-sidebar .nav-link {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.admin-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.admin-sidebar .nav-link.active {
  background: var(--primary);
  color: white;
}

/* Sidebar collapse btn style */
.admin-sidebar .btn.nav-link {
  background: none;
  border: none;
  color: #94a3b8;
  width: 100%;
  text-align: left;
}

.admin-sidebar .btn.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

/* Nested nav links */
.admin-sidebar .collapse .nav-link {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  color: #94a3b8;
}

.admin-sidebar-brand {
  min-height: 60px;
  display: flex;
  align-items: center;
}

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

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

/* Admin cards */
.admin-stat-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-content {
    margin-left: 0;
    padding-top: 4.25rem;
  }
}

/* ============================================================
   Tables
   ============================================================ */

.table-custom {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-custom thead th {
  background: var(--gray-100);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1rem;
}

.table-custom tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-color: var(--gray-100);
}

.table-custom tbody tr:hover {
  background: #fafafa;
}

/* ============================================================
   Exam Card
   ============================================================ */

.exam-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: white;
  transition: var(--transition);
  overflow: hidden;
}

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

.exam-card .card-body {
  padding: 1.25rem;
}

.exam-card .category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
}

.exam-card .exam-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0.5rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.exam-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 0.5rem;
}

.exam-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   Mock Test / Exam Attempt UI
   ============================================================ */

.test-layout {
  display: flex;
  gap: 1rem;
  min-height: calc(100vh - 70px);
}

.test-main {
  flex: 1;
  min-width: 0;
}

.test-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 70px;
  height: fit-content;
}

.question-container {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.question-number {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.question-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--dark);
  margin-bottom: 1.5rem;
}

/* Option buttons */
.option-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.5rem;
  background: white;
  font-size: 0.95rem;
}

.option-label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-label.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.option-label.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: #065f46;
}

.option-label.incorrect {
  border-color: var(--danger);
  background: var(--danger-light);
  color: #991b1b;
}

.option-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--gray-200);
  color: var(--dark);
  flex-shrink: 0;
}

.option-label.selected .option-key {
  background: var(--primary);
  color: white;
}

/* Question Palette */
.question-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 1rem;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-q {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-q:hover {
  transform: scale(1.1);
}

.btn-q.unattempted {
  background: var(--gray-200);
  color: var(--gray);
}

.btn-q.answered {
  background: var(--success);
  color: white;
}

.btn-q.marked {
  background: var(--warning);
  color: white;
}

.btn-q.marked-answered {
  background: var(--purple);
  color: white;
}

.btn-q.current {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}

/* Palette legend */
.palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--gray);
}

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

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

/* Timer */
.exam-timer {
  background: var(--dark);
  color: white;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: 'Inter', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

.timer-danger {
  color: var(--danger) !important;
  animation: timerPulse 1s ease infinite;
}

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

@media (max-width: 991.98px) {
  .test-layout { flex-direction: column; }
  .test-sidebar { width: 100%; position: static; }
}

/* ============================================================
   Result Page
   ============================================================ */

.result-summary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: var(--radius-lg);
  color: white;
  padding: 2.5rem;
  text-align: center;
}

.result-score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 4px solid rgba(255,255,255,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.result-score-circle .score-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.result-score-circle .score-label {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   Toast Notifications
   ============================================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.toast-item {
  pointer-events: all;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastSlideIn 0.3s ease forwards;
  border-left: 4px solid var(--primary);
  min-width: 280px;
}

.toast-item.toast-success { border-left-color: var(--success); }
.toast-item.toast-danger  { border-left-color: var(--danger); }
.toast-item.toast-warning { border-left-color: var(--warning); }
.toast-item.toast-info    { border-left-color: var(--info); }

.toast-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.toast-item.toast-success .toast-icon { color: var(--success); }
.toast-item.toast-danger  .toast-icon { color: var(--danger); }
.toast-item.toast-warning .toast-icon { color: var(--warning); }
.toast-item.toast-info    .toast-icon { color: var(--info); }

.toast-msg {
  flex: 1;
  font-size: 0.875rem;
  color: var(--dark);
  font-weight: 500;
}

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

.toast-close:hover { color: var(--dark); }

.toast-item.toast-hiding {
  animation: toastSlideOut 0.25s ease forwards;
}

@keyframes toastSlideIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

/* ============================================================
   Skeleton Loading
   ============================================================ */

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  background: white;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}

.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-25 { width: 25%; }

.skeleton-title {
  height: 22px;
  margin-bottom: 12px;
}

.skeleton-thumb {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination .page-link {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  color: var(--dark);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.4rem 0.75rem;
  transition: var(--transition);
}

.pagination .page-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.5;
}

/* ============================================================
   Blog
   ============================================================ */

.blog-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: white;
  overflow: hidden;
  transition: var(--transition);
}

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

.blog-card .blog-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gray-100);
}

.blog-card .blog-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.blog-card .blog-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   Section Headings
   ============================================================ */

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
}

.section-subtitle {
  font-size: 1rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.section-divider {
  width: 48px;
  height: 4px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 2px;
  margin: 0.75rem 0 1.5rem;
}

/* ============================================================
   Alert / Notice Boxes
   ============================================================ */

.alert {
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.875rem 1rem;
  border-left: 4px solid;
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
  border-left-color: var(--success);
}

.alert-danger {
  background: var(--danger-light);
  color: #991b1b;
  border-left-color: var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: #78350f;
  border-left-color: var(--warning);
}

.alert-info {
  background: var(--info-light);
  color: #0369a1;
  border-left-color: var(--info);
}

/* ============================================================
   Pricing Cards
   ============================================================ */

.pricing-card {
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: 2rem;
  background: white;
  transition: var(--transition);
  text-align: center;
  position: relative;
}

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

.pricing-card .popular-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.pricing-price {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.pricing-price sup {
  font-size: 1.25rem;
  vertical-align: super;
}

.pricing-price sub {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray);
}

/* ============================================================
   Confirm Modal
   ============================================================ */

.confirm-modal .modal-header {
  border-bottom: 1px solid var(--border);
}

.confirm-modal .btn-danger {
  min-width: 90px;
}

/* ============================================================
   Homepage Improvements
   ============================================================ */

/* Stat icons in the bar — proper sizing */
.stats-bar .stat-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border-radius: var(--radius-sm);
}

/* Category pills in hero — wrap nicely on mobile */
.hero .category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* Homepage cards should fill height uniformly */
.exam-card.h-100 .card-body,
.pricing-card.h-100,
.blog-card.h-100 {
  display: flex;
  flex-direction: column;
}

/* Prevent admin cards from lifting (confusing hover on tables/forms) */
.admin-content .card:hover {
  transform: none;
  box-shadow: var(--shadow);
}

/* ============================================================
   Desktop Improvements
   ============================================================ */

/* Container max-width for readability on very wide screens */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* Navbar spacing on desktop */
@media (min-width: 992px) {
  .navbar .nav-link {
    padding: 0.5rem 1rem !important;
  }
}

/* ============================================================
   Mobile / Responsive Fixes
   ============================================================ */

@media (max-width: 576px) {
  .section-title { font-size: 1.35rem; }
  .section-divider { margin-bottom: 1rem; }

  .hero { padding: 2rem 0; }
  .hero h1 { font-size: 1.5rem; line-height: 1.3; }
  .hero p { font-size: 0.9rem; margin-bottom: 1rem !important; }
  .hero .input-group-lg .form-control { font-size: 0.9rem; padding: 0.5rem 0.75rem; }
  .hero .input-group-lg .btn { font-size: 0.85rem; padding: 0.5rem 0.75rem; }
  .hero .input-group-lg .input-group-text { padding: 0.5rem; }

  /* Stats bar: 2x2 grid with tighter layout */
  .stats-bar .stat-icon {
    width: 36px; height: 36px; min-width: 36px; font-size: 1rem;
  }
  .stats-bar .fs-4 { font-size: 1.25rem !important; }

  .auth-card { padding: 1.75rem 1.25rem; }
  .pricing-card { padding: 1.25rem; }
  .pricing-price { font-size: 2rem; }

  /* Exam cards: tighter padding */
  .exam-card .card-body { padding: 1rem; }
  .exam-card .exam-title { font-size: 0.9rem; }
  .exam-meta { font-size: 0.75rem; }

  /* Blog cards */
  .blog-card .blog-image { height: 140px; }
  .blog-card .blog-title { font-size: 0.9rem; }
}

@media (max-width: 768px) {
  .test-layout { flex-direction: column; }
  .question-palette { grid-template-columns: repeat(8, 1fr); }

  /* Hero search: full width, remove search button text */
  .hero .input-group { max-width: 100%; }

  /* d-flex sections: stack alignment */
  .d-flex.justify-content-between.align-items-end {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
}

/* ============================================================
   Dark mode: intentionally disabled
   The site uses a fixed light theme; an automatic dark override
   was removed because it inverted the designed palette on
   dark-mode phones and made the UI look broken.
   ============================================================ */

/* ============================================================
   Utilities
   ============================================================ */

.text-primary   { color: var(--primary)  !important; }
.text-success   { color: var(--success)  !important; }
.text-warning   { color: var(--warning)  !important; }
.text-danger    { color: var(--danger)   !important; }
.text-muted     { color: var(--gray)     !important; }

.bg-primary-light { background: var(--primary-light) !important; }
.bg-success-light { background: var(--success-light) !important; }
.bg-danger-light  { background: var(--danger-light)  !important; }

.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-md { border-radius: var(--radius)    !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }

.shadow-card { box-shadow: var(--shadow)    !important; }
.shadow-pop  { box-shadow: var(--shadow-lg) !important; }

.transition  { transition: var(--transition); }

.hover-lift {
  transition: var(--transition);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/* ============================================================
   MODERN UI 2.0 — Homepage & Global Polish
   ============================================================ */

/* ---- Modern Hero with mesh gradient + floating blobs ---- */
.hero {
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(124, 58, 237, 0.55), transparent 60%),
    radial-gradient(820px 520px at 88% 26%, rgba(14, 165, 233, 0.50), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(5, 150, 105, 0.35), transparent 60%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563EB 100%);
  padding: 5.5rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.hero-blob-1 {
  width: 320px; height: 320px;
  background: #7c3aed;
  top: -80px; left: -60px;
  animation: blobFloat 14s ease-in-out infinite;
}
.hero-blob-2 {
  width: 260px; height: 260px;
  background: #0ea5e9;
  bottom: -90px; right: -40px;
  animation: blobFloat 18s ease-in-out infinite reverse;
}
.hero-blob-3 {
  width: 220px; height: 220px;
  background: #ec4899;
  top: 30%; right: 22%;
  opacity: 0.35;
  animation: blobFloat 22s ease-in-out infinite;
}

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

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

/* Eyebrow glass badge */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
}
.hero-eyebrow i { color: #fcd34d; }

.hero-title {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.hero-gradient-text {
  background: linear-gradient(90deg, #fcd34d 0%, #f9a8d4 50%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Glass category pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  transition: var(--transition);
}
.hero-pill i { color: #fcd34d; }
.hero-pill:hover {
  background: #fff;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.hero-pill:hover i { color: var(--primary); }

/* Hero CTA buttons */
.hero-cta { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); }
.hero-cta:hover { transform: translateY(-2px); }

.btn-gradient-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
  color: #fff;
  border: none;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.35);
  transition: var(--transition);
}
.btn-gradient-accent:hover,
.btn-gradient-accent:focus {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(236, 72, 153, 0.5);
  filter: brightness(1.05);
}

/* ---- Modern Stat Cards ---- */
.stats-bar {
  background: var(--light);
  margin-top: -2.5rem;
  position: relative;
  z-index: 2;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.25);
  transition: var(--transition);
  height: 100%;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.3);
}
.stat-card-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
}
.stat-grad-blue   { background: linear-gradient(135deg, #2563EB, #0ea5e9); box-shadow: 0 8px 18px -6px rgba(37, 99, 235, 0.6); }
.stat-grad-green  { background: linear-gradient(135deg, #059669, #34d399); box-shadow: 0 8px 18px -6px rgba(5, 150, 105, 0.6); }
.stat-grad-purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); box-shadow: 0 8px 18px -6px rgba(124, 58, 237, 0.6); }
.stat-grad-orange { background: linear-gradient(135deg, #d97706, #fbbf24); box-shadow: 0 8px 18px -6px rgba(217, 119, 6, 0.6); }
.stat-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--dark);
}
.stat-card-label {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 2px;
}

/* ---- Modern card accent (gradient top line on hover) ---- */
.exam-card, .blog-card, .pricing-card {
  position: relative;
}
.exam-card::after, .blog-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.exam-card:hover::after, .blog-card:hover::after {
  transform: scaleX(1);
}

/* ---- Section heading modern accent ---- */
.section-title {
  letter-spacing: -0.02em;
}
.section-divider {
  height: 4px;
  width: 52px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
}

/* ---- Smooth entrance animation on load ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > .row > div > * {
  animation: fadeUp 0.6s ease both;
}
.hero-eyebrow   { animation-delay: 0.02s; }
.hero-title     { animation-delay: 0.08s; }
.hero-subtitle  { animation-delay: 0.16s; }
.category-pills { animation-delay: 0.24s; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-blob, .hero-content > .row > div > * { animation: none !important; }
}

/* ---- Mobile tuning for the modern hero/stats ---- */
@media (max-width: 576px) {
  .hero { padding: 3rem 0 3.5rem; }
  .hero-blob { filter: blur(40px); }
  .stats-bar { margin-top: -1.5rem; }
  .stat-card { padding: 0.85rem 0.9rem; gap: 0.6rem; }
  .stat-card-icon { width: 42px; height: 42px; min-width: 42px; font-size: 1.05rem; border-radius: 12px; }
  .stat-card-value { font-size: 1.2rem; }
  .stat-card-label { font-size: 0.72rem; }
}


/* ============================================================
   MODERN STUDENT DASHBOARD
   ============================================================ */

/* Hero / welcome banner */
.dash-hero {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 90% -10%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(135deg, #2563EB 0%, #4f46e5 50%, #7c3aed 100%);
  color: #fff;
}
.dash-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.dash-hero .dash-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.7);
  object-fit: cover;
  background: #fff;
}
.dash-avatar-fallback {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.6);
}

/* Summary stat cards */
.dash-stat {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 8px 24px -14px rgba(15, 23, 42, 0.3);
  transition: var(--transition);
  height: 100%;
}
.dash-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px -16px rgba(15, 23, 42, 0.4);
}
.dash-stat-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
}
.dash-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--dark);
}
.dash-stat-label {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 3px;
}

/* Modern pill tabs */
.dash-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.35rem;
  box-shadow: var(--shadow);
}
.dash-tabs .dash-tab {
  border: none;
  background: transparent;
  color: var(--gray);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  transition: var(--transition);
  white-space: nowrap;
}
.dash-tabs .dash-tab:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.dash-tabs .dash-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.6);
}

/* Purchased test card */
.dash-test-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: var(--transition);
  height: 100%;
}
.dash-test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

@media (max-width: 576px) {
  .dash-stat { padding: 0.85rem 0.9rem; gap: 0.6rem; }
  .dash-stat-icon { width: 42px; height: 42px; min-width: 42px; font-size: 1.05rem; border-radius: 12px; }
  .dash-stat-value { font-size: 1.3rem; }
  .dash-hero .dash-avatar, .dash-avatar-fallback { width: 64px; height: 64px; }
  .dash-tabs { width: 100%; justify-content: center; }
}

/* ============================================================
   MOBILE NAVBAR / HAMBURGER POLISH
   ============================================================ */

/* Nicer hamburger button */
.navbar-toggler {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  transition: var(--transition);
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}
.navbar-toggler:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* On mobile, the collapsed menu becomes a clean dropdown panel */
@media (max-width: 991.98px) {
  #navbarMain {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    margin-top: 0.6rem;
  }
  #navbarMain .navbar-nav .nav-link {
    padding: 0.65rem 0.85rem !important;
    border-radius: var(--radius-sm);
  }
  #navbarMain .navbar-nav .nav-item + .nav-item {
    border-top: 1px solid var(--gray-100);
  }
  #navbarMain .dropdown-menu {
    border: none;
    box-shadow: none;
    padding-left: 1rem;
    background: var(--light);
    border-radius: var(--radius-sm);
  }
  /* Right-side actions: full width, spaced out */
  #navbarMain .d-flex.align-items-center {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }
  #navbarMain .d-flex.align-items-center > .btn,
  #navbarMain .d-flex.align-items-center > .dropdown {
    flex: 1 1 auto;
  }
  #navbarMain .d-flex.align-items-center .dropdown > .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   LEGAL / POLICY PAGES
   ============================================================ */

.legal-page {
  max-width: 880px;
}
.legal-page h1 {
  font-size: 1.9rem;
  font-weight: 800;
}
.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  color: var(--dark);
}
.legal-page p,
.legal-page li {
  color: #475569;
  line-height: 1.75;
}
.legal-updated {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
}
