/* ============================================================
   AKHU Face Identity Verification System — Main CSS
   Design System: Deep Navy + Royal Blue + Gold Accent
   ============================================================ */

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

/* ── CSS VARIABLES ── */
:root {
  /* Brand Colors */
  --akhu-navy: #0A1628;
  --akhu-navy-light: #0F1F3D;
  --akhu-navy-medium: #152847;
  --akhu-blue: #1E3A8A;
  --akhu-blue-light: #2563EB;
  --akhu-blue-bright: #3B82F6;
  --akhu-gold: #F59E0B;
  --akhu-gold-light: #FCD34D;
  --akhu-gold-dark: #D97706;

  /* Status Colors */
  --akhu-success: #10B981;
  --akhu-success-bg: rgba(16, 185, 129, 0.12);
  --akhu-warning: #F59E0B;
  --akhu-warning-bg: rgba(245, 158, 11, 0.12);
  --akhu-danger: #EF4444;
  --akhu-danger-bg: rgba(239, 68, 68, 0.12);
  --akhu-info: #06B6D4;
  --akhu-info-bg: rgba(6, 182, 212, 0.12);

  /* Backgrounds */
  --bg-primary: #0A1628;
  --bg-secondary: #0F1F3D;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-border: rgba(255, 255, 255, 0.12);
  --bg-input: rgba(255, 255, 255, 0.07);

  /* Text */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #8A9EB5;
  --text-accent: #F59E0B;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.10);
  --border-focus: rgba(37, 99, 235, 0.60);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 30px rgba(37, 99, 235, 0.25);
  --shadow-glow-gold: 0 0 30px rgba(245, 158, 11, 0.20);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #0A1628 0%, #1E3A8A 50%, #0A1628 100%);
  --gradient-gold: linear-gradient(135deg, #F59E0B, #D97706);
  --gradient-blue: linear-gradient(135deg, #2563EB, #1E40AF);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));

  /* Spacing */
  --navbar-height: 70px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(245, 158, 11, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--akhu-blue); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--akhu-blue-light); }

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

.text-gold { color: var(--akhu-gold); }
.text-muted-custom { color: var(--text-secondary); }

/* ── NAVBAR ── */
.akhu-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--navbar-height);
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  transition: all var(--transition-normal);
}

.akhu-navbar.scrolled {
  background: rgba(10, 22, 40, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar-brand-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.navbar-brand-custom:hover { opacity: 0.85; }

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-blue);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: var(--shadow-glow-blue);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.brand-sub { font-size: 0.65rem; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px 6px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  letter-spacing: 0.5px;
}

.lang-btn:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.lang-btn.active {
  color: var(--akhu-gold);
  background: rgba(245, 158, 11, 0.12);
}

.lang-divider { color: var(--text-muted); font-size: 0.75rem; }

/* ── MAIN CONTENT ── */
.main-content { flex: 1; }

/* ── FLASH MESSAGES ── */
.messages-container {
  position: fixed;
  top: calc(var(--navbar-height) + 16px);
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.akhu-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid;
  backdrop-filter: blur(20px);
  animation: slideInRight 0.3s ease;
  position: relative;
}

.akhu-alert-success { background: var(--akhu-success-bg); border-color: var(--akhu-success); color: var(--akhu-success); }
.akhu-alert-error, .akhu-alert-danger { background: var(--akhu-danger-bg); border-color: var(--akhu-danger); color: var(--akhu-danger); }
.akhu-alert-warning { background: var(--akhu-warning-bg); border-color: var(--akhu-warning); color: var(--akhu-warning); }
.akhu-alert-info { background: var(--akhu-info-bg); border-color: var(--akhu-info); color: var(--akhu-info); }

.alert-close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  margin-left: auto;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
  padding: 2px;
}
.alert-close:hover { opacity: 1; }

/* ── FOOTER ── */
.akhu-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: auto;
}

.footer-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.footer-security {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── CARDS / GLASS ── */
.akhu-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.akhu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--akhu-blue-light), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.akhu-card:hover::before { opacity: 1; }
.akhu-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

/* ── BUTTONS ── */
.btn-akhu-primary {
  background: var(--gradient-blue);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-akhu-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45);
  color: white;
}

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

.btn-akhu-gold {
  background: var(--gradient-gold);
  color: var(--akhu-navy);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-akhu-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45);
  color: var(--akhu-navy);
}

.btn-akhu-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-akhu-outline:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
}

/* ── FORM INPUTS ── */
.form-control-akhu {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.form-control-akhu:focus {
  outline: none;
  border-color: var(--akhu-blue-light);
  background: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  color: var(--text-primary);
}

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

/* Override Bootstrap form controls */
.form-control {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 12px 16px !important;
  font-family: 'Inter', sans-serif !important;
}

.form-control:focus {
  background: rgba(37, 99, 235, 0.05) !important;
  border-color: var(--akhu-blue-light) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  color: var(--text-primary) !important;
}

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

select option {
  background-color: #0f1f3d !important; /* matches --bg-secondary */
  color: #f8fafc !important; /* matches --text-primary */
}

.form-label { color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; margin-bottom: 6px; }

/* ── STEP PROGRESS ── */
.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 32px 0;
  padding: 0 16px;
  flex-wrap: nowrap;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 120px;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-normal);
  z-index: 1;
  position: relative;
}

.step-item.active .step-circle {
  border-color: var(--akhu-blue-light);
  background: var(--akhu-blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2), var(--shadow-glow-blue);
}

.step-item.completed .step-circle {
  border-color: var(--akhu-success);
  background: var(--akhu-success);
  color: white;
}

.step-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--akhu-blue-light); }
.step-item.completed .step-label { color: var(--akhu-success); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  margin-top: -20px;
  transition: background var(--transition-normal);
}

.step-connector.completed { background: var(--akhu-success); }

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.verified { background: var(--akhu-success-bg); color: var(--akhu-success); border: 1px solid var(--akhu-success); }
.status-badge.review_required { background: var(--akhu-warning-bg); color: var(--akhu-warning); border: 1px solid var(--akhu-warning); }
.status-badge.rejected { background: var(--akhu-danger-bg); color: var(--akhu-danger); border: 1px solid var(--akhu-danger); }
.status-badge.pending { background: rgba(100, 116, 139, 0.15); color: var(--text-secondary); border: 1px solid var(--text-muted); }

/* ── STAT CARDS ── */
.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.stat-card.blue::after { background: var(--gradient-blue); }
.stat-card.gold::after { background: var(--gradient-gold); }
.stat-card.success::after { background: var(--akhu-success); }
.stat-card.danger::after { background: var(--akhu-danger); }

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.stat-icon.blue { background: rgba(37, 99, 235, 0.15); color: var(--akhu-blue-bright); }
.stat-icon.gold { background: rgba(245, 158, 11, 0.12); color: var(--akhu-gold); }
.stat-icon.success { background: rgba(16, 185, 129, 0.12); color: var(--akhu-success); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.12); color: var(--akhu-danger); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── TABLE ── */
.akhu-table {
  width: 100%;
  border-collapse: collapse;
}

.akhu-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.akhu-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: var(--text-secondary) !important;
  transition: background var(--transition-fast);
}

.akhu-table tr:hover td { background: var(--bg-card-hover); }
.akhu-table tr:last-child td { border-bottom: none; }
.akhu-table td strong { color: var(--text-primary); }

/* ── WEBCAM CONTAINER ── */
.camera-container {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  max-width: 480px;
  margin: 0 auto;
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-xl);
  transform: scaleX(-1); /* Mirror effect */
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.face-guide-oval {
  width: 220px;
  height: 290px;
  border: 3px solid rgba(37, 99, 235, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3);
  animation: pulse-border 2s ease-in-out infinite;
}

.face-guide-oval.active {
  border-color: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3), 0 0 30px rgba(16, 185, 129, 0.4);
}

/* ── LIVENESS CHALLENGE ── */
.challenge-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  transition: all var(--transition-normal);
}

.challenge-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  border: 2px solid var(--akhu-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
  animation: bounce-icon 1.5s ease infinite;
}

.challenge-instruction {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.challenge-timer {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--akhu-blue-light);
  line-height: 1;
}

.challenge-timer.urgent { color: var(--akhu-danger); animation: flash 0.5s ease infinite; }

.progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all var(--transition-normal);
}

.progress-dot.completed { background: var(--akhu-success); }
.progress-dot.active { background: var(--akhu-blue-light); box-shadow: 0 0 8px var(--akhu-blue-light); }

/* ── RESULT PAGE ── */
.result-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
  position: relative;
}

.result-circle.verified {
  background: var(--akhu-success-bg);
  border: 3px solid var(--akhu-success);
  color: var(--akhu-success);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.25);
}

.result-circle.review_required {
  background: var(--akhu-warning-bg);
  border: 3px solid var(--akhu-warning);
  color: var(--akhu-warning);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.25);
}

.result-circle.rejected {
  background: var(--akhu-danger-bg);
  border: 3px solid var(--akhu-danger);
  color: var(--akhu-danger);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.25);
}

.score-display {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* ── ADMIN SIDEBAR ── */
.admin-layout { display: flex; min-height: calc(100vh - var(--navbar-height)); }

.admin-sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  padding: 24px 0;
}

.admin-content {
  flex: 1;
  padding: 32px;
  max-width: 100%;
  overflow-x: auto;
}

.sidebar-section { margin-bottom: 24px; }

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  border-radius: 0;
  position: relative;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--akhu-blue-light);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(37, 99, 235, 0.10);
  color: var(--akhu-blue-light);
}

.sidebar-link.active::before { transform: scaleY(1); }

/* ── INDICATOR LIGHTS (EXAM DAY) ── */
.indicator-light {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-light 1.5s ease-in-out infinite;
}

.indicator-light.green { background: var(--akhu-success); box-shadow: 0 0 12px var(--akhu-success); }
.indicator-light.yellow { background: var(--akhu-warning); box-shadow: 0 0 12px var(--akhu-warning); }
.indicator-light.red { background: var(--akhu-danger); box-shadow: 0 0 12px var(--akhu-danger); }

/* ── ANIMATIONS ── */
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

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

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3), 0 0 20px rgba(37, 99, 235, 0.4); }
}

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

@keyframes bounce-icon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

.animate-slide-up { animation: slideInUp 0.4s ease; }
.animate-fade-in { animation: fadeIn 0.4s ease; }
.spin { animation: spin 1s linear infinite; }

/* ── SEARCH BAR ── */
.search-bar {
  position: relative;
  max-width: 500px;
}

.search-bar input {
  padding-left: 44px !important;
  background: var(--bg-glass) !important;
}

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

/* ── PAGINATION ── */
.pagination-akhu {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 24px;
}

.pagination-akhu a, .pagination-akhu span {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.pagination-akhu a { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-secondary); }
.pagination-akhu a:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.pagination-akhu span.current { background: var(--gradient-blue); color: white; border: 1px solid transparent; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 20px; }
  .step-progress { gap: 0; }
  .step-label { display: none; }
  .brand-sub { display: none; }
  .stat-value { font-size: 1.6rem; }
}

/* ── LOADING SPINNER ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--akhu-blue-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── QR CODE DISPLAY ── */
.qr-container {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: inline-block;
  box-shadow: var(--shadow-glow-blue);
}

.qr-container img { display: block; width: 200px; height: 200px; }

/* ── SUPERVISOR RESULT BANNER ── */
.result-banner {
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  border: 2px solid;
  transition: all var(--transition-slow);
}

.result-banner.green {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--akhu-success);
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.15);
}

.result-banner.yellow {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--akhu-warning);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.15);
}

.result-banner.red {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--akhu-danger);
  box-shadow: 0 0 60px rgba(239, 68, 68, 0.15);
}

.result-banner-icon { font-size: 4rem; margin-bottom: 16px; }
.result-banner-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.result-banner-sub { font-size: 1rem; opacity: 0.8; }

/* ============================================================
   LIGHT THEME OVERRIDES
   ============================================================ */
[data-theme="light"] {
  /* Backgrounds */
  --bg-primary: #F1F5F9;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #E2E8F0;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-glass-border: rgba(15, 23, 42, 0.08);
  --bg-input: #FFFFFF;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-accent: #D97706;

  /* Borders */
  --border-color: rgba(15, 23, 42, 0.12);
  --border-focus: rgba(37, 99, 235, 0.60);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-glow-blue: 0 0 30px rgba(37, 99, 235, 0.1);
  --shadow-glow-gold: 0 0 30px rgba(245, 158, 11, 0.08);

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #F1F5F9 0%, #DBEAFE 50%, #F1F5F9 100%);
  --gradient-card: linear-gradient(145deg, #FFFFFF, #F8FAFC);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 60%);
}

[data-theme="light"] .akhu-navbar {
  background: rgba(255, 255, 255, 0.88);
}

[data-theme="light"] .akhu-navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  width: 34px;
  height: 34px;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  color: var(--akhu-gold);
  border-color: var(--akhu-gold);
}

/* Logo toggling on theme change */
[data-theme="light"] .logo-theme-light {
  display: none !important;
}
[data-theme="light"] .logo-theme-dark {
  display: block !important;
}
[data-theme="dark"] .logo-theme-light {
  display: block !important;
}
[data-theme="dark"] .logo-theme-dark {
  display: none !important;
}


/* General Input Visibility Fix in Light Mode */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  color: #0F172A !important;
  background-color: #FFFFFF !important;
  border-color: #CBD5E1 !important;
}

[data-theme="light"] select option {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
}

[data-theme="light"] .score-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

[data-theme="light"] .akhu-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
}

[data-theme="light"] .sidebar-link {
  color: #475569 !important;
}

[data-theme="light"] .sidebar-link.active,
[data-theme="light"] .sidebar-link:hover {
  background: #F1F5F9 !important;
  color: #1E3A8A !important;
}

[data-theme="light"] .supervisor-sidebar,
[data-theme="light"] .admin-sidebar {
  background: #FFFFFF !important;
  border-right-color: #E2E8F0 !important;
}

[data-theme="light"] .akhu-table td,
[data-theme="light"] .akhu-table th {
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

/* ============================================================
   RESPONSIVE LAYOUT & MOBILE SIDEBAR OVERRIDES
   ============================================================ */
@media (max-width: 992px) {
  /* Sidebars as slide-out drawer on mobile */
  .admin-sidebar,
  .supervisor-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 1050 !important;
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-color) !important;
    transition: transform var(--transition-normal), visibility var(--transition-normal) !important;
    visibility: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding-top: calc(var(--navbar-height) + 16px) !important;
  }

  .admin-sidebar.active,
  .supervisor-sidebar.active {
    transform: translateX(280px) !important;
    visibility: visible !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6) !important;
  }

  /* Layout container fixes */
  .admin-layout,
  .supervisor-layout {
    flex-direction: column !important;
    min-height: calc(100vh - var(--navbar-height)) !important;
  }

  .admin-content,
  .supervisor-main {
    padding: 20px 16px !important;
    width: 100% !important;
  }

  .supervisor-sidebar {
    /* Supervisor sidebar doesn't have an outer layout wrapper on some views, standardizing */
    display: none !important;
  }
  .supervisor-sidebar.active {
    display: flex !important;
  }
}

/* Sidebar Backdrop overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

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

/* Glassmorphism visual enhancements */
.akhu-card, .stat-card, .challenge-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
}

/* Table Responsive wrapper */
.table-responsive,
.table-responsive-akhu {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  margin-bottom: 20px;
}

.table-responsive .akhu-table,
.table-responsive-akhu .akhu-table {
  margin-bottom: 0;
}

/* General Layout spacing for Mobile header */
@media (max-width: 576px) {
  .navbar-brand-custom img {
    height: 32px !important;
  }
  .brand-name {
    font-size: 0.95rem !important;
  }
  .brand-sub {
    font-size: 0.55rem !important;
  }
  .theme-toggle-btn {
    width: 30px !important;
    height: 30px !important;
  }
}

/* Hide mobile toggle by default, show it only if a sidebar is present on the page */
#mobileMenuBtn {
  display: none !important;
}

@media (max-width: 992px) {
  body:has(.admin-sidebar) #mobileMenuBtn,
  body:has(.supervisor-sidebar) #mobileMenuBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* Force Bootstrap text utilities to follow our custom theme-aware CSS variables */
.text-muted,
.form-text {
  color: var(--text-muted) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-primary {
  color: var(--text-primary) !important;
}




