/* ==========================================================================
   منصة "سهلنا عليكم" للتدريب على الاختبارات - Stylesheet System
   Design System: Modern Arabic Premium Aesthetic, Salla-Style Mobile Layout, Fluid UI
   ========================================================================== */

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

:root {
  /* Color Palette - Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Brand Gradient Accents */
  --brand-primary: #0d9488; /* Emerald Teal */
  --brand-secondary: #4f46e5; /* Royal Indigo */
  --brand-accent: #f59e0b; /* Golden Amber */
  --brand-rose: #e11d48;

  --grad-emerald: linear-gradient(135deg, #0d9488 0%, #059669 100%);
  --grad-indigo: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-purple: linear-gradient(135deg, #9333ea 0%, #6b21a8 100%);
  --grad-hero: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 27, 75, 0.82) 50%, rgba(6, 78, 59, 0.85) 100%);

  /* Quiz Feedback Colors */
  --correct-bg: #ecfdf5;
  --correct-border: #10b981;
  --correct-text: #065f46;

  --wrong-bg: #fef2f2;
  --wrong-border: #ef4444;
  --wrong-text: #991b1b;

  --flagged-bg: #fffbeb;
  --flagged-border: #f59e0b;

  /* Shadows & Radius */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 25px rgba(13, 148, 136, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.9);
  --border-color: #374151;
  --border-hover: #4b5563;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-light: #6b7280;

  --correct-bg: rgba(6, 78, 59, 0.4);
  --correct-border: #10b981;
  --correct-text: #a7f3d0;

  --wrong-bg: rgba(127, 29, 29, 0.4);
  --wrong-border: #ef4444;
  --wrong-text: #fecaca;

  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
}

/* Reset & General Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-main);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
  padding-bottom: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Glass Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.45rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--grad-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: var(--shadow-glow);
  transform: rotate(-3deg);
  transition: var(--transition);
}

.brand-logo:hover .brand-icon {
  transform: rotate(0deg) scale(1.06);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-primary);
  background: rgba(13, 148, 136, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-emerald);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(13, 148, 136, 0.05);
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

.btn-icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
}

.btn-icon-only:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* User Badge in Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-indigo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.role-tag-admin {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 800;
}

/* Hero Banner with Student Study Background */
.hero-section {
  position: relative;
  padding: 4.5rem 0;
  background: var(--grad-hero), url('assets/hero_students_bg.jpg') center/cover no-repeat;
  color: #ffffff;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  overflow: hidden;
}

.hero-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
}

.shape-1 {
  width: 450px;
  height: 450px;
  background: #0d9488;
  top: -100px;
  right: -50px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: #4f46e5;
  bottom: -150px;
  left: -80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  padding: 0.45rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.hero-title span {
  background: linear-gradient(135deg, #2dd4bf 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: #e2e8f0;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: #2dd4bf;
}

.stat-label {
  font-size: 0.85rem;
  color: #cbd5e1;
}

/* Glassmorphism Auth Card inside Hero Banner */
.hero-auth-card {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

.hero-auth-card .admin-input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.hero-auth-card .admin-input::placeholder {
  color: #94a3b8;
}

.hero-auth-card .admin-input:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: #2dd4bf;
}

.hero-auth-card .admin-form-label {
  color: #e2e8f0;
}

/* Mobile Salla-Style Dedicated Student Image Card */
.mobile-hero-banner {
  display: none;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.mobile-hero-banner img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.mobile-hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.mobile-hero-banner-title {
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* Category Filters Bar */
.filter-bar-wrapper {
  margin: -2rem auto 2.5rem;
  position: relative;
  z-index: 10;
}

.filter-bar {
  background: var(--bg-card);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-btn {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-btn:hover {
  color: var(--brand-primary);
  background: rgba(13, 148, 136, 0.06);
}

.filter-btn.active {
  background: var(--grad-emerald);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* Category Grid Header */
.section-title-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Locked Protection Card */
.locked-exams-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 3rem;
}

.locked-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem;
}

/* Exams Card Grid */
.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.exam-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(13, 148, 136, 0.1);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.card-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(79, 70, 229, 0.1);
  color: var(--brand-secondary);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-card-start {
  flex: 1;
}

/* Salla-Style Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
  padding: 0.35rem 0;
}

.mobile-nav-item i {
  font-size: 1.2rem;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  color: var(--brand-primary);
}

/* ==========================================================================
   INTERACTIVE QUIZ ENGINE VIEW
   ========================================================================== */
.quiz-wrapper {
  display: none;
  min-height: calc(100vh - 76px);
  background: var(--bg-primary);
  padding: 2rem 0 4rem;
}

.quiz-wrapper.active {
  display: block;
}

.quiz-header-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}

.quiz-title-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
}

.quiz-title-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quiz-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timer-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--brand-primary);
}

.timer-box.warning {
  color: #ef4444;
  border-color: #ef4444;
  animation: pulse 1s infinite;
}

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

/* Quiz Main Layout Grid */
.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.question-num-tag {
  background: rgba(13, 148, 136, 0.1);
  color: var(--brand-primary);
  font-weight: 800;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
}

.btn-flag {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-weight: 600;
  transition: var(--transition);
}

.btn-flag.flagged {
  color: var(--brand-accent);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Options Container */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 2rem;
}

.option-item {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.option-item:hover {
  border-color: var(--brand-primary);
  background: rgba(13, 148, 136, 0.03);
}

.option-item.selected {
  border-color: var(--brand-primary);
  background: rgba(13, 148, 136, 0.08);
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

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

.option-text {
  font-weight: 600;
  font-size: 1.05rem;
  flex: 1;
}

/* Immediate Explanation Box (Practice Mode) */
.explanation-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-right: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
  display: none;
}

.explanation-box.show {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

.explanation-title {
  font-weight: 800;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Question Action Footer */
.quiz-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Sidebar Question Navigator */
.quiz-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 96px;
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.question-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.nav-grid-btn {
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-grid-btn.current {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.nav-grid-btn.answered {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

.nav-grid-btn.flagged {
  border-color: var(--brand-accent);
  background: #fffbebf0;
  color: #d97706;
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* ==========================================================================
   RESULTS & ANALYTICS VIEW
   ========================================================================== */
.results-wrapper {
  display: none;
  padding: 3rem 0 5rem;
}

.results-wrapper.active {
  display: block;
}

.result-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.score-badge-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--grad-emerald);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-glow);
}

.score-percent {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.score-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.result-title {
  font-size: 1.85rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.result-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.results-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.breakdown-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.breakdown-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.breakdown-card.correct .breakdown-num { color: #10b981; }
.breakdown-card.wrong .breakdown-num { color: #ef4444; }
.breakdown-card.time .breakdown-num { color: #3b82f6; }

/* Detailed Solutions List */
.solutions-section-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.solution-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.solution-card.is-correct {
  border-right: 5px solid #10b981;
}

.solution-card.is-wrong {
  border-right: 5px solid #ef4444;
}

.sol-question-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.sol-options-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sol-option {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--bg-primary);
}

.sol-option.user-correct {
  background: var(--correct-bg);
  color: var(--correct-text);
  border: 1px solid var(--correct-border);
}

.sol-option.user-wrong {
  background: var(--wrong-bg);
  color: var(--wrong-text);
  border: 1px solid var(--wrong-border);
}

.sol-option.actual-correct {
  background: var(--correct-bg);
  color: var(--correct-text);
  border: 1px solid var(--correct-border);
}

.sol-explanation-text {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   ADMIN CONTROL PANEL VIEW (#adminSection)
   ========================================================================== */
.admin-wrapper {
  display: none;
  padding: 2.5rem 0 5rem;
  background: var(--bg-primary);
  min-height: calc(100vh - 76px);
}

.admin-wrapper.active {
  display: block;
}

.admin-header-card {
  background: var(--grad-hero);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.admin-tabs-nav {
  display: flex;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.admin-tab-btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.admin-tab-btn:hover {
  color: var(--brand-primary);
  background: rgba(13, 148, 136, 0.05);
}

.admin-tab-btn.active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

/* Admin Data Tables */
.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.95rem;
}

.admin-table th, .admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background: var(--bg-primary);
  font-weight: 800;
  color: var(--text-main);
}

.admin-table tr:hover {
  background: rgba(13, 148, 136, 0.02);
}

.status-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
}

.status-badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
}

/* Form Styles for Exam Builder */
.admin-form-group {
  margin-bottom: 1.25rem;
}

.admin-form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.admin-input, .admin-select, .admin-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Dynamic Question Builder Cards */
.builder-question-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.builder-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* Footer */
.app-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0 5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Media Queries & Salla-Style Mobile Optimization */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-desc {
    margin: 0 auto 2rem;
  }
  .hero-stats {
    justify-content: center;
  }
  .quiz-grid {
    grid-template-columns: 1fr;
  }
  .quiz-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 64px;
  }
  .header-content {
    height: 64px;
  }
  .nav-links {
    display: none;
  }
  .hero-section {
    padding: 2rem 0;
    background: var(--grad-hero);
  }
  .mobile-hero-banner {
    display: block;
  }
  .hero-title {
    font-size: 2rem;
  }
  .results-breakdown-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .exams-grid {
    grid-template-columns: 1fr;
  }
}
