/* ═══════════════════════════════════════════════════════════════════
   BRIGHT QUIZZES — STYLE SHEET (MASTER)
   الهيكل: الأساسيات ← المكونات ← التنقل ← الصفحات ← الاستجابة
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────
   PART 1: FOUNDATION (الأساسيات)
   ───────────────────────────────────────────────────────────────────── */

/* ===== 1. THEMES (7 Themes) ===== */
:root {
  /* الثيم الداكن (الافتراضي) */
  --bg-body: #0B0F1C;
  --bg-nav: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-side: #020617;
  --bg-surface: #111827;
  --bg-hover: #1F2937;
  --bg-sunken: #0F1525;
  --text-primary: #F9FAFB;
  --text-secondary: #E5E7EB;
  --text-muted: #9CA3AF;
  --accent-primary: #A855F7;
  --accent-deep: #7C3AED;
  --accent-tint: rgba(168, 85, 247, 0.15);
  --accent-pink: #EC4899;
  --accent-cyan: #22D3EE;
  --accent-lime: #A3E635;
  --border-light: rgba(249, 250, 251, 0.12);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 16px rgba(34, 211, 238, 0.5);
  --grad-primary: linear-gradient(135deg, #A855F7, #7C3AED, #4C1D95);
  --grad-olympiad: linear-gradient(135deg, #7C3AED, #4C1D95);
  --grad-grade9: linear-gradient(135deg, #A855F7, #EC4899);
  --grad-outstanding: linear-gradient(135deg, #7C3AED, #22D3EE);
  --btn-olympiad: linear-gradient(90deg, #7C3AED, #22D3EE);
  --btn-grade9: linear-gradient(90deg, #A855F7, #EC4899);
  --btn-outstanding: linear-gradient(90deg, #4C1D95, #A3E635);
  --btn-discover: linear-gradient(90deg, #22D3EE, #A855F7);
  --nav-h: 72px;
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

/* 1. Dark Elegant */
body.theme-dark {
  --bg-body: #0B0F1C;
  --bg-nav: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-side: #020617;
  --bg-surface: #111827;
  --bg-hover: #1F2937;
  --bg-sunken: #0F1525;
  --text-primary: #F9FAFB;
  --text-secondary: #E5E7EB;
  --text-muted: #9CA3AF;
  --accent-primary: #A855F7;
  --accent-deep: #7C3AED;
  --accent-tint: rgba(168, 85, 247, 0.15);
  --accent-pink: #EC4899;
  --accent-cyan: #22D3EE;
  --accent-lime: #A3E635;
  --border-light: rgba(249, 250, 251, 0.12);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 16px rgba(34, 211, 238, 0.5);
  --grad-primary: linear-gradient(135deg, #A855F7, #7C3AED, #4C1D95);
  --grad-olympiad: linear-gradient(135deg, #7C3AED, #4C1D95);
  --grad-grade9: linear-gradient(135deg, #A855F7, #EC4899);
  --grad-outstanding: linear-gradient(135deg, #7C3AED, #22D3EE);
  --btn-olympiad: linear-gradient(90deg, #7C3AED, #22D3EE);
  --btn-grade9: linear-gradient(90deg, #A855F7, #EC4899);
  --btn-outstanding: linear-gradient(90deg, #4C1D95, #A3E635);
  --btn-discover: linear-gradient(90deg, #22D3EE, #A855F7);
}

/* 2. Light Luxury */
body.theme-light {
  --bg-body: #F3F4F6;
  --bg-nav: rgba(255, 255, 255, 0.9);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-side: #FFFFFF;
  --bg-surface: #FFFFFF;
  --bg-hover: #F9FAFB;
  --bg-sunken: #F0F0F5;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --accent-primary: #8B5CF6;
  --accent-deep: #6D28D9;
  --accent-tint: rgba(139, 92, 246, 0.12);
  --accent-pink: #DB2777;
  --accent-cyan: #06B6D4;
  --accent-lime: #65A30D;
  --border-light: rgba(0, 0, 0, 0.08);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 16px rgba(139, 92, 246, 0.3);
  --grad-primary: linear-gradient(135deg, #C084FC, #A855F7, #7C3AED);
  --grad-olympiad: linear-gradient(135deg, #8B5CF6, #6D28D9);
  --grad-grade9: linear-gradient(135deg, #F472B6, #DB2777);
  --grad-outstanding: linear-gradient(135deg, #38BDF8, #0EA5E9);
  --btn-olympiad: linear-gradient(90deg, #7C3AED, #06B6D4);
  --btn-grade9: linear-gradient(90deg, #EC4899, #BE185D);
  --btn-outstanding: linear-gradient(90deg, #6D28D9, #84CC16);
  --btn-discover: linear-gradient(90deg, #06B6D4, #C084FC);
}

/* 3. Neon Vibrant */
body.theme-neon {
  --bg-body: #0A0A0F;
  --bg-nav: rgba(0, 0, 0, 0.75);
  --bg-card: rgba(20, 20, 35, 0.9);
  --bg-side: #000000;
  --bg-surface: #111122;
  --bg-hover: #1E1E3A;
  --bg-sunken: #0A0A1A;
  --text-primary: #F0F0FF;
  --text-secondary: #D1D5FF;
  --text-muted: #94A3B8;
  --accent-primary: #B388FF;
  --accent-deep: #E0AAFF;
  --accent-tint: rgba(179, 136, 255, 0.2);
  --accent-pink: #FF44FF;
  --accent-cyan: #00FFFF;
  --accent-lime: #AAFF00;
  --border-light: #22D3EE;
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-2: 0 8px 26px rgba(179, 136, 255, 0.16);
  --shadow-3: 0 20px 50px rgba(179, 136, 255, 0.24);
  --shadow-glow: 0 0 20px #FF00FF, 0 0 10px #00FFFF;
  --grad-primary: linear-gradient(135deg, #FF00FF, #00FFFF, #FF44AA);
  --grad-olympiad: linear-gradient(135deg, #FF00FF, #7000FF);
  --grad-grade9: linear-gradient(135deg, #FF44AA, #FF00FF);
  --grad-outstanding: linear-gradient(135deg, #00FFFF, #FF00FF);
  --btn-olympiad: linear-gradient(90deg, #FF00FF, #00FFFF);
  --btn-grade9: linear-gradient(90deg, #FF44AA, #FF00FF);
  --btn-outstanding: linear-gradient(90deg, #00FFAA, #00FFFF);
  --btn-discover: linear-gradient(90deg, #00FFFF, #FF00FF);
}

/* 4. Green Oasis */
body.theme-green {
  --bg-body: #0A1A0F;
  --bg-nav: rgba(10, 26, 15, 0.9);
  --bg-card: rgba(20, 45, 28, 0.9);
  --bg-side: #050F08;
  --bg-surface: #1E3D2A;
  --bg-hover: #2A5238;
  --bg-sunken: #0F1F14;
  --text-primary: #D4EDD4;
  --text-secondary: #88B888;
  --text-muted: #5A8A5A;
  --accent-primary: #81C784;
  --accent-deep: #66BB6A;
  --accent-tint: rgba(129, 199, 132, 0.15);
  --accent-pink: #F48FB1;
  --accent-cyan: #4DD0E1;
  --accent-lime: #AED581;
  --border-light: rgba(129, 199, 132, 0.25);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 16px rgba(129, 199, 132, 0.4);
  --grad-primary: linear-gradient(135deg, #81C784, #66BB6A, #388E3C);
  --grad-olympiad: linear-gradient(135deg, #4CAF50, #2E7D32);
  --grad-grade9: linear-gradient(135deg, #81C784, #A5D6A7);
  --grad-outstanding: linear-gradient(135deg, #66BB6A, #4DD0E1);
  --btn-olympiad: linear-gradient(90deg, #4CAF50, #2E7D32);
  --btn-grade9: linear-gradient(90deg, #81C784, #A5D6A7);
  --btn-outstanding: linear-gradient(90deg, #388E3C, #4DD0E1);
  --btn-discover: linear-gradient(90deg, #66BB6A, #A5D6A7);
}

/* 5. Pink Dream */
body.theme-pink {
  --bg-body: #1A0A1A;
  --bg-nav: rgba(26, 10, 26, 0.9);
  --bg-card: rgba(46, 20, 46, 0.9);
  --bg-side: #0F0510;
  --bg-surface: #421E42;
  --bg-hover: #5A2A5A;
  --bg-sunken: #1A0A1A;
  --text-primary: #F5D4F5;
  --text-secondary: #D488D4;
  --text-muted: #A05AA0;
  --accent-primary: #F48FB1;
  --accent-deep: #F06292;
  --accent-tint: rgba(244, 143, 177, 0.2);
  --accent-pink: #F48FB1;
  --accent-cyan: #CE93D8;
  --accent-lime: #AED581;
  --border-light: rgba(244, 143, 177, 0.25);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 16px rgba(244, 143, 177, 0.4);
  --grad-primary: linear-gradient(135deg, #F48FB1, #F06292, #AD1457);
  --grad-olympiad: linear-gradient(135deg, #EC407A, #AD1457);
  --grad-grade9: linear-gradient(135deg, #F48FB1, #F06292);
  --grad-outstanding: linear-gradient(135deg, #F06292, #CE93D8);
  --btn-olympiad: linear-gradient(90deg, #EC407A, #AD1457);
  --btn-grade9: linear-gradient(90deg, #F48FB1, #F06292);
  --btn-outstanding: linear-gradient(90deg, #AD1457, #CE93D8);
  --btn-discover: linear-gradient(90deg, #F06292, #CE93D8);
}

/* 6. Yellow Sun */
body.theme-yellow {
  --bg-body: #1A1408;
  --bg-nav: rgba(26, 20, 8, 0.9);
  --bg-card: rgba(46, 36, 16, 0.9);
  --bg-side: #0F0B05;
  --bg-surface: #423418;
  --bg-hover: #5A4420;
  --bg-sunken: #1A1408;
  --text-primary: #F5EDD4;
  --text-secondary: #D4C888;
  --text-muted: #A09A5A;
  --accent-primary: #FFD54F;
  --accent-deep: #FFC107;
  --accent-tint: rgba(255, 213, 79, 0.2);
  --accent-pink: #FF8A65;
  --accent-cyan: #4DD0E1;
  --accent-lime: #AED581;
  --border-light: rgba(255, 213, 79, 0.25);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 16px rgba(255, 213, 79, 0.4);
  --grad-primary: linear-gradient(135deg, #FFD54F, #FFC107, #F57F17);
  --grad-olympiad: linear-gradient(135deg, #FFC107, #F57F17);
  --grad-grade9: linear-gradient(135deg, #FFD54F, #FFB300);
  --grad-outstanding: linear-gradient(135deg, #FFB300, #4DD0E1);
  --btn-olympiad: linear-gradient(90deg, #FFC107, #F57F17);
  --btn-grade9: linear-gradient(90deg, #FFD54F, #FFB300);
  --btn-outstanding: linear-gradient(90deg, #F57F17, #4DD0E1);
  --btn-discover: linear-gradient(90deg, #FFB300, #FFD54F);
}

/* 7. Blue Ocean */
body.theme-blue {
  --bg-body: #0A0A1A;
  --bg-nav: rgba(10, 10, 26, 0.9);
  --bg-card: rgba(15, 26, 46, 0.9);
  --bg-side: #05050F;
  --bg-surface: #1A2A42;
  --bg-hover: #2A3A5A;
  --bg-sunken: #0A0F1A;
  --text-primary: #D4E4F5;
  --text-secondary: #88AAD4;
  --text-muted: #5A7AA0;
  --accent-primary: #4FC3F7;
  --accent-deep: #42A5F5;
  --accent-tint: rgba(79, 195, 247, 0.2);
  --accent-pink: #F48FB1;
  --accent-cyan: #4DD0E1;
  --accent-lime: #AED581;
  --border-light: rgba(79, 195, 247, 0.25);
  --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 16px rgba(79, 195, 247, 0.4);
  --grad-primary: linear-gradient(135deg, #4FC3F7, #42A5F5, #0D47A1);
  --grad-olympiad: linear-gradient(135deg, #42A5F5, #0D47A1);
  --grad-grade9: linear-gradient(135deg, #4FC3F7, #1E88E5);
  --grad-outstanding: linear-gradient(135deg, #1E88E5, #4DD0E1);
  --btn-olympiad: linear-gradient(90deg, #42A5F5, #0D47A1);
  --btn-grade9: linear-gradient(90deg, #4FC3F7, #1E88E5);
  --btn-outstanding: linear-gradient(90deg, #0D47A1, #4DD0E1);
  --btn-discover: linear-gradient(90deg, #1E88E5, #4FC3F7);
}

/* ===== 2. RESET & BASE (إعادة التعيين) ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.2s ease;
  opacity: 1;
  animation: fadeInPage 0.25s ease-out;
  overflow-x: hidden;
}

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

img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-deep); }

/* ===== 3. TYPOGRAPHY (الطباعة) ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.375rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }

p { color: var(--text-secondary); margin-bottom: 1rem; max-width: 62ch; }

a { color: var(--accent-primary); transition: color 0.2s ease; }
a:hover { color: var(--accent-deep); }

::selection { background: var(--accent-tint); color: var(--accent-deep); }
:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 3px; border-radius: 0.5rem; }

/* ===== 4. UTILITIES (الأدوات المساعدة) ===== */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.text-center { text-align: center; }
.d-flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3.25rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.screen {
  display: none;
}
.screen.active-screen {
  display: block;
}
/* ─────────────────────────────────────────────────────────────────────
   PART 2: SHARED COMPONENTS (المكونات المشتركة) - مُعدّل
   ───────────────────────────────────────────────────────────────────── */

/* ===== 5. BUTTONS (الأزرار) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.13s var(--ease, cubic-bezier(0.22, 0.61, 0.36, 1)),
              box-shadow 0.24s var(--ease),
              background 0.24s var(--ease),
              opacity 0.24s var(--ease);
  min-height: 48px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-1);
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink, var(--text-primary));
  border-color: var(--line-strong, var(--border-light));
}
.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-deep);
  background: var(--accent-tint);
}

.btn-gradient {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-2);
}
.btn-gradient:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.625rem 1.25rem;
  border-radius: 999px;
  font-weight: 500;
}
.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-danger {
  background: var(--accent-red, #ff6b6b);
  color: #fff;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 999px;
  font-weight: 500;
}
.btn-danger:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

.btn-large {
  width: 100%;
  justify-content: center;
  font-size: 1.1rem;
  padding: 1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  min-height: 36px;
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===== Discover Button (خاص بالروابط الرئيسية) ===== */
.discover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  background: var(--btn-discover);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff !important;
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease);
  border: 2px solid transparent;
  min-height: 40px;
}
.discover-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  color: #fff !important;
}

/* ===== Back Button (الرجوع للخلف) ===== */
.back-button {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.625rem 1.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  min-height: 44px;
}
.back-button:hover {
  background: var(--accent-cyan);
  color: #000;
  transform: translateX(-5px);
}

/* ===== 6. CARDS (البطاقات) ===== */
.card,
.section-card,
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius, 16px);
  padding: 1.75rem;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.24s var(--ease),
              transform 0.24s var(--ease),
              border-color 0.24s var(--ease);
}

.card:hover,
.section-card:hover,
.info-card:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong, var(--border-light));
  transform: translateY(-3px);
}

/* ===== Section Card (البطاقات الرئيسية في الصفحة الرئيسية) ===== */
.section-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--grad-olympiad);
  color: #fff;
  padding: 1.75rem;
  margin-bottom: 2rem;
}
.section-card.grade9-card { background: var(--grad-grade9); }
.section-card.outstanding-card { background: var(--grad-outstanding); }

.section-text { flex: 1 1 280px; }
.section-text h2 { font-size: 1.6rem; margin-bottom: 0.5rem; color: #fff; }
.section-text p { opacity: 0.9; margin-bottom: 1rem; color: rgba(255,255,255,0.9); }
.section-text .discover-btn { margin-top: 0.25rem; }

/* ===== Subject Icons Grid (شبكة الأيقونات) ===== */
.subject-icons-grid {
  display: flex;
  gap: 0.75rem;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.subject-icons-grid i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.95rem;
  transition: 0.2s;
}
.subject-icons-grid i:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.25);
}

/* ===== Info Card (بطاقات المعلومات في الصفحة الرئيسية) ===== */
.info-card {
  border-right: 6px solid var(--accent-primary);
  margin-bottom: 1.5rem;
  padding: 1.5rem;
}
.info-card h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.info-card p { color: var(--text-secondary); margin-bottom: 0.75rem; font-size: 0.95rem; }

/* ===== Random Quiz Card (بطاقة الاختبار العشوائي) ===== */
.random-quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  transition: 0.2s;
  cursor: pointer;
}
.random-quiz-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}
.random-quiz-card i {
  font-size: 2.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}
.random-quiz-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}
.random-quiz-card p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.random-quiz-card .discover-btn {
  background: var(--btn-discover);
  display: inline-flex;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  min-height: 38px;
}
.random-quiz-card .discover-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ===== 7. FORMS (النماذج) ===== */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.form-group .required {
  color: var(--accent-red, #ff6b6b);
}

input,
textarea,
select {
  width: 100%;
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.875rem 1rem;
  background: var(--bg-body);
  border: 2px solid var(--border-light);
  border-radius: 0.75rem;
  color: var(--text-primary);
  transition: border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-tint);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.field-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ===== Options Grid (شبكة الخيارات في نماذج الأسئلة) ===== */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.options-grid input {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid var(--border-light);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 0.95rem;
}
.options-grid-5 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  .options-grid-5 {
    grid-template-columns: 1fr;
  }
}

/* ===== 8. GRIDS (الشبكات العامة) ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin: 2.5rem 0;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
  padding: 0.625rem;
  border-radius: 1.75rem;
  background: rgba(0, 0, 0, 0.05);
}

.model-card {
  background: linear-gradient(135deg, var(--bg-surface), var(--accent-tint));
  border-radius: 1.25rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  min-height: 120px;
}
.model-card.random {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  border: none;
}
.model-card.random .model-name {
  color: #000;
}
.model-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-cyan);
}
.model-icon {
  font-size: 2.5rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}
.model-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* ===== Loading & No Models Messages ===== */
.loading-message {
  text-align: center;
  padding: 2.5rem;
  grid-column: 1 / -1;
  color: var(--text-muted);
}
.loading-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-cyan);
  animation: spin 1s linear infinite;
}

.no-models-message {
  text-align: center;
  padding: 2.5rem;
  grid-column: 1 / -1;
}
.no-models-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-pink);
}
.no-models-message p {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-muted);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Hero Section (عام) ===== */
.hero-section {
  background: var(--grad-primary);
  border-radius: 2rem;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  animation: waveShift 8s infinite alternate ease-in-out;
  background-size: 200% 200%;
}
@keyframes waveShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.hero-content h1 {
  font-size: clamp(1.75rem, 5vw, 2.625rem);
  max-width: 600px;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: #fff;
}
.hero-content p {
  max-width: 500px;
  opacity: 0.85;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
}

/* ===== Quick Buttons ===== */
.quick-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 200px;
  width: 100%;
  max-width: 280px;
}
.quick-btn {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-weight: 700;
  background: var(--btn-olympiad);
  color: #fff;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.quick-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}
.quick-btn:nth-child(2) { background: var(--btn-grade9); }
.quick-btn:nth-child(3) { background: var(--btn-outstanding); }

/* ===== ⭐ SUGGESTIONS STRIP (معدل: عرض عمودي) ===== */
.suggestions-strip {
  background: var(--bg-card);
  border-radius: 1.75rem;
  padding: 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border-light);
}
.suggestions-strip h3 { 
  margin-bottom: 0.75rem; 
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* ★ جعل الاقتراحات عمودية */
.strip-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
}

.strip-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border-radius: 1rem;
  border-left: 4px solid var(--accent-cyan);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: center;
}
.strip-card:hover {
  transform: translateY(-2px);
  background: var(--bg-hover);
  box-shadow: var(--shadow-glow);
}
/* ─────────────────────────────────────────────────────────────────────
   PART 3: NAVIGATION & LAYOUT (النافبار، السايدبار، الفوتر)
   ───────────────────────────────────────────────────────────────────── */

/* ============================================================
   9. NAVBAR (شريط التنقل العلوي) — ثابت في الأعلى
   ============================================================ */

/* نافبار ثابت في الأعلى */
/* ============================================================
   9. NAVBAR (شريط التنقل العلوي) — ثابت في الأعلى
   ============================================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h, 72px);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  z-index: 1000;
  gap: 0.5rem;
}

/* ===== ترتيب العناصر في النافبار ===== */

/* 1. الجزء الأيمن: الهامبرغر + البحث + البروفايل (في أقصى اليمين) */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-right: 0;
  margin-left: auto; /* يدفع الجزء الأيمن إلى أقصى اليمين */
}

/* 2. الجزء الأيسر: الصورة + اسم الموقع (في أقصى اليسار) */
.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0; /* يمنع تقلص المساحة */
  max-width: 70%; /* يمنع التمدد الزائد */
}

/* اسم الموقع (يظهر أولاً في التدفق) */
.logo-text {
  font-weight: 800;
  font-size: 25px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  order: 1; /* يظهر في البداية (يسار) */
}

/* الصورة (تظهر ثانياً) */
.nav-right-image {
  height: 40px;
  width: auto;
  border-radius: 0%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  order: 2; /* يظهر بعد النص (يمين) */
}

/* 3. زر الهامبرغر + البحث + البروفايل */
.hamburger-btn {
  width: 44px;
  height: 40px;
  background: var(--grad-primary);
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.hamburger-btn span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}
.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.search-trigger {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.search-trigger:hover {
  color: var(--accent-primary);
  background: var(--accent-tint);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.profile-avatar-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
}
.nav-profile-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  transition: all 0.25s ease;
  cursor: pointer;
  display: block;
}
.nav-profile-img:hover {
  transform: scale(1.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan);
}

/* ===== إصلاح تغطية النافبار للمحتوى ===== */
main {
  padding-top: var(--nav-h, 72px);
}

/* ===== استجابة النافبار للشاشات الصغيرة ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 0 3%;
    height: 64px;
  }
  .nav-profile-img { width: 34px; height: 34px; }
  .search-trigger { width: 36px; height: 36px; font-size: 0.9rem; }
  .nav-right-image { height: 36px; }
  .logo-text { font-size: 20px; }
  .hamburger-btn { width: 40px; height: 36px; }
  .hamburger-btn span { width: 20px; }
  .navbar-actions { gap: 4px; }
  .logo-area { gap: 6px; }
  main { padding-top: 64px; }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 2.5%;
    height: 58px;
  }
  .nav-profile-img { width: 30px; height: 30px; }
  .search-trigger { width: 32px; height: 32px; font-size: 0.8rem; }
  .nav-right-image { height: 30px; }
  .logo-text { font-size: 16px; }
  .hamburger-btn { width: 38px; height: 34px; }
  .hamburger-btn span { width: 18px; }
  .navbar-actions { gap: 3px; }
  .logo-area { gap: 4px; }
  main { padding-top: 58px; }
}

@media (max-width: 380px) {
  .navbar {
    padding: 0 2%;
    height: 54px;
  }
  .nav-profile-img { width: 26px; height: 26px; }
  .search-trigger { width: 28px; height: 28px; font-size: 0.7rem; }
  .nav-right-image { height: 28px; }
  .logo-text { font-size: 14px; }
  .hamburger-btn { width: 34px; height: 30px; }
  .hamburger-btn span { width: 16px; height: 2px; }
  .navbar-actions { gap: 2px; }
  .logo-area { gap: 3px; }
  main { padding-top: 54px; }
}
/* ============================================================
   10. SIDEBAR (القائمة الجانبية) — فخم ومقسم بوضوح
   ============================================================ */

.side-menu {
  position: fixed;
  top: var(--nav-h, 72px);
  left: 0;
  width: min(340px, 85vw);
  height: calc(100% - var(--nav-h, 72px));
  background: var(--bg-side);
  border-right: 1px solid var(--border-light);
  z-index: 1100;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  padding: 0;
  transform: translateX(-100%);
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.25);
}
.side-menu.open {
  transform: translateX(0);
}

.side-menu-inner {
  padding: 1.5rem 1.25rem 2.5rem;
}

/* ===== قائمة الروابط ===== */
.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  margin-bottom: 2px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
}
.menu-list li:hover {
  background: var(--accent-tint);
  color: var(--text-primary);
  transform: translateX(4px);
}
.menu-list li:active {
  transform: scale(0.97);
}

.menu-list li a {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.menu-list li i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
  color: var(--accent-cyan);
  transition: 0.2s;
  flex-shrink: 0;
}
.menu-list li:hover i {
  color: var(--accent-primary);
  transform: scale(1.1);
}

.menu-list li span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== الفواصل بين المجموعات ===== */
.menu-list .divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.5rem 0.75rem;
  padding: 0;
  cursor: default;
  opacity: 0.5;
}

/* ===== العنصر النشط ===== */
.menu-list li.active {
  background: var(--accent-tint);
  color: var(--text-primary);
  border-right: 3px solid var(--accent-cyan);
}
.menu-list li.active i {
  color: var(--accent-primary);
}

/* ===== عنصر Dashboard (للمشرفين) ===== */
.menu-list li#dashboardMenuItem {
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid var(--accent-tint);
  border-radius: 12px;
  margin-bottom: 4px;
}
.menu-list li#dashboardMenuItem i {
  color: var(--accent-pink);
}
.menu-list li#dashboardMenuItem:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-primary);
}

/* ===== ⭐ لوحة الثيمات (مع أزرار دائرية صغيرة) ===== */
.theme-panel {
  margin-top: 2rem;
  padding: 1.25rem 1rem;
  background: var(--bg-sunken);
  border-radius: 14px;
  border: 1px solid var(--border-light);
}
.theme-panel h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.theme-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: 0.15s;
}
.theme-option:last-child {
  border-bottom: none;
}
.theme-option:hover {
  color: var(--text-primary);
}
.theme-option label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ⭐ زر الراديو الدائري الصغير (تم إصلاحه) */
.theme-option input[type="radio"] {
  appearance: none;
  width: 14px; /* أصغر */
  height: 14px; /* أصغر */
  border: 2px solid var(--border-light);
  border-radius: 50% !important; /* دائري تماماً */
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
  background: transparent;
  margin: 0;
}
.theme-option input[type="radio"]:checked {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-tint), 0 0 6px rgba(var(--accent-cyan-rgb, 34, 211, 238), 0.3); /* ضوء خفيف دائري */
}
.theme-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #000;
}
.theme-option input[type="radio"]:hover {
  border-color: var(--accent-cyan);
}

/* ===== Overlay الخلفية ===== */
.overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay-bg.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===== شريط التمرير في السايدبار ===== */
.side-menu::-webkit-scrollbar {
  width: 4px;
}
.side-menu::-webkit-scrollbar-track {
  background: transparent;
}
.side-menu::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 999px;
}
.side-menu::-webkit-scrollbar-thumb:hover {
  background: var(--accent-deep);
}

/* ===== استجابة السايدبار ===== */
@media (max-width: 768px) {
  .side-menu {
    width: min(320px, 85vw);
  }
  .side-menu-inner {
    padding: 1rem 1rem 2rem;
  }
  .menu-list li {
    padding: 9px 12px;
    font-size: 0.9rem;
  }
  .menu-list li i {
    width: 18px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .side-menu {
    width: 90vw;
  }
  .menu-list li {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .menu-list li i {
    width: 16px;
    font-size: 0.9rem;
  }
  .theme-option {
    font-size: 0.8rem;
  }
  .theme-option input[type="radio"] {
    width: 13px;
    height: 13px;
  }
}


/* ============================================================
   11. FOOTER (التذييل) — يلتصق بالأسفل دون استخدام fixed
   ============================================================ */

/* ===== ضبط الهيكل العام ===== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 0 auto; /* يأخذ كل المساحة المتبقية */
  padding-top: var(--nav-h, 72px); /* إصلاح تغطية النافبار للمحتوى */
}

/* ===== الفوتر ===== */
.main-footer {
  flex-shrink: 0;
  background: var(--bg-side);
  border-top: 1px solid var(--border-light);
  padding: 0.75rem 5%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  min-height: 56px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  margin-top: auto;
  transition: all 0.3s ease;
}

/* ===== صفوف الفوتر ===== */
.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

/* ===== الروابط الرئيسية ===== */
.footer-links-primary a {
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 40px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  position: relative;
}
.footer-links-primary a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}
.footer-links-primary a:hover {
  color: var(--accent-cyan);
  background: var(--accent-tint);
}
.footer-links-primary a:hover::after {
  width: 60%;
}
.footer-links-primary a i {
  margin-left: 6px;
  color: var(--accent-primary);
}

/* ===== الروابط الثانوية ===== */
.footer-links-secondary a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
  padding: 0.25rem 0.5rem;
  border-radius: 20px;
}
.footer-links-secondary a:hover {
  color: var(--accent-primary);
  background: var(--accent-tint);
}
.footer-links-secondary a i {
  margin-left: 4px;
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

/* ===== الشعار + وسائل التواصل + حقوق النشر ===== */
.footer-bottom {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-logo i {
  font-size: 1.1rem;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.social-links {
  display: flex;
  gap: 8px;
}
.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.social-links a:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--accent-primary);
}
.social-links a[href*="instagram"]:hover {
  color: #E4405F;
  background: rgba(228, 64, 95, 0.12);
  border-color: #E4405F;
}
.social-links a[href*="facebook"]:hover {
  color: #1877F2;
  background: rgba(24, 119, 242, 0.12);
  border-color: #1877F2;
}
.social-links a[href*="whatsapp"]:hover {
  color: #25D366;
  background: rgba(37, 211, 102, 0.12);
  border-color: #25D366;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== استجابة الفوتر ===== */
@media (max-width: 992px) {
  .main-footer {
    padding: 0.6rem 4%;
    min-height: 50px;
  }
  .footer-links-primary a { font-size: 0.8rem; padding: 0.2rem 0.6rem; }
  .footer-links-secondary a { font-size: 0.75rem; }
}

@media (max-width: 768px) {
  .main-footer {
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 3%;
    min-height: auto;
    gap: 0.3rem;
  }
  .footer-row {
    justify-content: center;
    gap: 0.3rem 0.6rem;
  }
  .footer-links-primary a { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
  .footer-links-secondary a { font-size: 0.7rem; padding: 0.2rem 0.4rem; }
  .footer-bottom {
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
  }
  .social-links { justify-content: center; }
}

@media (max-width: 480px) {
  .main-footer {
    padding: 0.4rem 2%;
    gap: 0.2rem;
  }
  .footer-links-primary a { font-size: 0.7rem; padding: 0.15rem 0.4rem; }
  .footer-links-secondary a { font-size: 0.65rem; padding: 0.15rem 0.3rem; }
  .social-links a { width: 30px; height: 30px; font-size: 0.85rem; }
  .footer-logo { font-size: 0.85rem; }
  .footer-copy { font-size: 0.6rem; }
}

/* ===== تأثير ظهور الفوتر ===== */
@keyframes footerFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.main-footer {
  animation: footerFadeIn 0.4s ease-out;
}
/* ─────────────────────────────────────────────────────────────────────
   PART 4: MAIN PAGES (الصفحات الرئيسية)
   ───────────────────────────────────────────────────────────────────── */

/* ============================================================
   12. OLYMPIAD, GRADE9 & OUTSTANDING PAGES (صفحات الاختبارات)
   ============================================================ */

/* ===== شاشات التبديل (screen) ===== */
.screen {
  display: none;
}
.screen.active-screen {
  display: block;
}

/* ===== بطاقات المراحل (الأولمبياد) ===== */
.category-card {
  background: var(--bg-card);
  border-radius: 2rem;
  padding: 1.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
}
.category-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}
.category-icon {
  font-size: 4rem;
  margin-bottom: 1.25rem;
  color: var(--accent-cyan);
}
.category-card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.625rem;
}

/* ===== بطاقات المواد (divisions) ===== */
.division-card {
  background: var(--bg-card);
  border-radius: 1.75rem;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  border-left: 6px solid var(--accent-cyan);
  transition: 0.2s;
}
.division-card:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-glow);
}
.division-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.division-card p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* ===== أزرار الاختبارات داخل المواد ===== */
.quiz-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.quiz-btn {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid var(--accent-cyan);
  padding: 0.5rem 1.25rem;
  border-radius: 40px;
  color: var(--accent-cyan);
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}
.quiz-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  transform: translateY(-2px);
}

/* ===== تبويبات الصفوف (مدارس المتفوقين) ===== */
.grade-tabs {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 1.875rem 0 1.25rem;
  flex-wrap: wrap;
}
.grade-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.75rem 2rem;
  border-radius: 60px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  color: var(--text-primary);
}
.grade-tab.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

/* ===== بطاقات المواد في مدارس المتفوقين ===== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin: 2.5rem 0;
}
.subject-card {
  background: var(--bg-card);
  border-radius: 1.75rem;
  padding: 1.5rem;
  text-align: center;
  border-left: 6px solid var(--accent-cyan);
  transition: 0.2s;
  cursor: pointer;
}
.subject-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

/* ===== نماذج الاختبارات (مشتركة بين الأولمبياد، التاسع، المتفوقين) ===== */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
  padding: 0.625rem;
  border-radius: 1.75rem;
  background: rgba(0, 0, 0, 0.05);
}
.model-card {
  background: linear-gradient(135deg, var(--bg-surface), var(--accent-tint));
  border-radius: 1.25rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  min-height: 120px;
}
.model-card.random {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-pink));
  border: none;
}
.model-card.random .model-name {
  color: #000;
}
.model-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-cyan);
}
.model-icon {
  font-size: 2.5rem;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}
.model-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* ===== أزرار الرجوع ===== */
.back-button {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.625rem 1.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 1.25rem;
  display: inline-block;
  font-weight: 500;
}
.back-button:hover {
  background: var(--accent-cyan);
  color: #000;
  transform: translateX(-5px);
}

/* ===== رسائل التحميل وعدم وجود نماذج ===== */
.loading-message {
  text-align: center;
  padding: 2.5rem;
  grid-column: 1 / -1;
  color: var(--text-muted);
}
.loading-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-cyan);
  animation: spin 1s linear infinite;
}
.no-models-message {
  text-align: center;
  padding: 2.5rem;
  grid-column: 1 / -1;
}
.no-models-message i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-pink);
}
.no-models-message p {
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-muted);
}


/* ============================================================
   13. RANDOM QUIZ PAGE (صفحة الاختبار العشوائي)
   ============================================================ */

.random-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 2.5rem 0 3.75rem;
}
.random-card {
  background: var(--bg-card);
  border-radius: 1.75rem;
  padding: 1.75rem;
  text-align: center;
  width: 260px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid var(--border-light);
}
.random-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}
.random-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--accent-cyan);
}
.random-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.random-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}


/* ============================================================
   14. QUIZ PAGE (صفحة الاختبار الفردي)
   ============================================================ */

.quiz-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.875rem 6.25rem;
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
}

/* ===== الشريط العلوي ===== */
.top-bar {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: 60px;
  padding: 0.375rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9375rem;
  overflow-x: auto;
  flex-shrink: 0;
}
.quiz-name {
  display: none;
}
.controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}
.eval-buttons {
  display: flex;
  background: var(--bg-hover);
  border-radius: 60px;
  padding: 2px;
  gap: 4px;
}
.eval-btn {
  padding: 1px 4px;
  font-size: 0.7rem;
  border-radius: 60px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  background: transparent;
  color: var(--text-secondary);
}
.eval-btn.active {
  background: var(--accent-cyan);
  color: #000;
}
.finish-exam {
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
  border: none;
  padding: 0.375rem 1.25rem;
  border-radius: 60px;
  font-weight: bold;
  cursor: pointer;
  color: #000;
}
.progress-indicator {
  background: var(--bg-hover);
  padding: 0.3125rem 0.875rem;
  border-radius: 60px;
  font-size: 0.8rem;
  display: none;
}

/* ===== شريط التقدم ===== */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 20px;
  margin-bottom: 1.875rem;
  overflow: hidden;
  flex-shrink: 0;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-pink));
  border-radius: 20px;
  transition: width 0.3s ease;
}

/* ===== بطاقة السؤال ===== */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 2rem;
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  width: 100%;
}
.question-image {
  text-align: center;
  margin-bottom: 1.5rem;
}
.question-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 1.5rem;
  object-fit: contain;
}
.question-text {
  font-weight: 700;
  line-height: 1.4;
  word-break: break-word;
  font-size: 1.1rem;
}

/* ===== بطاقة الخيارات ===== */
.options-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 2rem;
  padding: 1.75rem;
  width: 100%;
}
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.option {
  background: var(--bg-hover);
  padding: 0.75rem 1.125rem;
  border-radius: 1.75rem;
  cursor: pointer;
  transition: 0.15s;
  font-weight: 500;
  border: 1px solid transparent;
}
.option:hover:not(.locked) {
  background: var(--bg-side);
  border-left: 5px solid var(--accent-cyan);
  transform: translateX(5px);
}
.option.correct {
  background: #16A34A;
  color: white;
}
.option.wrong {
  background: #DC2626;
  color: white;
}
.option.locked {
  cursor: default;
}

/* ===== منطقة التفسير ===== */
.explanation-area {
  background: var(--bg-side);
  border-left: 5px solid var(--accent-cyan);
  border-radius: 1.5rem;
  padding: 1.25rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===== شريط التنقل السفلي للاختبار ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  padding: 0.75rem 1.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  z-index: 1000;
  flex-wrap: wrap;
}
.bottom-nav .nav-btn {
  background: var(--btn-discover);
  border: none;
  padding: 0.75rem 1.875rem;
  border-radius: 60px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  color: white;
  flex: 1;
  min-width: 120px;
  max-width: 200px;
}
.bottom-nav .nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bottom-nav .nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.bottom-nav .nav-btn.finish-btn {
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
}

/* ===== شاشة النتيجة ===== */
.result-container {
  background: var(--bg-card);
  border-radius: 2rem;
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1.875rem;
}
.big-score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 1.25rem 0;
}
.review-wrapper {
  max-height: 500px;
  overflow-y: auto;
  text-align: left;
  margin-top: 1.25rem;
}
.review-item {
  background: var(--bg-hover);
  border-radius: 1.5rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.result-buttons {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}
.result-btn {
  padding: 0.625rem 1.75rem;
  border-radius: 60px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  border: none;
  font-size: 0.9rem;
}
.result-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
#restartQuiz {
  background: var(--accent-cyan);
  color: #000;
}
#showReview {
  background: var(--accent-pink);
  color: #fff;
}

/* ===== الإشعار العلوي (Toast) ===== */
.toast-notification {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-40px);
  z-index: 99999;
  width: 460px;
  max-width: 92vw;
  padding: 0;
  border-radius: 28px;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
}
.toast-content {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 28px;
  position: relative;
}
.toast-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.toast-notification.correct .toast-icon-wrapper {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
}
.toast-notification.wrong .toast-icon-wrapper {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}
.toast-text-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toast-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.3;
}
.toast-notification.correct .toast-title { color: #22c55e; }
.toast-notification.wrong .toast-title { color: #ef4444; }
.toast-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.7;
  line-height: 1.4;
}
.toast-notification.correct .toast-subtitle { color: #22c55e; }
.toast-notification.wrong .toast-subtitle { color: #ef4444; }
.toast-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.toast-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transform: scaleX(1);
  transform-origin: left;
  animation: toastProgress 1s linear forwards;
}
.toast-notification.correct .toast-progress::after {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.toast-notification.wrong .toast-progress::after {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
@keyframes toastProgress {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* ===== استجابة صفحة الاختبار ===== */
@media (max-width: 800px) {
  .quiz-container {
    padding: 0.9375rem 0.9375rem 5.625rem;
  }
  .question-text {
    font-size: 1rem;
  }
  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .controls-group {
    justify-content: space-between;
  }
  .bottom-nav {
    padding: 0.625rem 0.9375rem;
  }
  .bottom-nav .nav-btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
    min-width: 90px;
  }
}

@media (max-width: 600px) {
  .toast-notification {
    top: 80px;
    width: 92vw;
    border-radius: 20px;
  }
  .toast-content {
    padding: 16px 20px;
    gap: 14px;
  }
  .toast-icon-wrapper {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    border-radius: 14px;
  }
  .toast-title { font-size: 1rem; }
  .toast-subtitle { font-size: 0.75rem; }
  .toast-progress { height: 3px; }
}
/* ─────────────────────────────────────────────────────────────────────
   PART 5: SUB PAGES, AUTH, ADMIN & MISC
   (الصفحات الفرعية، المصادقة، لوحات الإدارة والمتنوعات)
   ───────────────────────────────────────────────────────────────────── */

/* ============================================================
   15. TEAM PAGE (صفحة الفريق الرئيسية)
   ============================================================ */

.team-intro {
  background: var(--bg-card);
  border-radius: 2rem;
  padding: 3rem;
  margin: 2.5rem 0;
  text-align: center;
  border: 1px solid var(--border-light);
}
.team-intro h1 {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}
.team-intro p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 1.875rem;
}

/* ===== أزرار التنقل السريع للفرق ===== */
.quick-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin: 1.875rem 0 1.25rem;
}
.nav-team-btn {
  background: var(--btn-discover);
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 60px;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  display: inline-block;
  text-decoration: none;
}
.nav-team-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ===== شبكة الأقسام (الفرق الثلاثة) ===== */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.875rem;
  margin: 3.125rem 0;
}
.department-card {
  background: var(--bg-card);
  border-radius: 2rem;
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border-light);
  transition: 0.25s;
}
.department-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}
.department-icon {
  font-size: 4rem;
  margin-bottom: 1.25rem;
  color: var(--accent-cyan);
}
.department-card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}
.department-card p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.team-btn {
  background: var(--btn-discover);
  border: none;
  padding: 0.625rem 1.75rem;
  border-radius: 40px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
  display: inline-block;
  text-decoration: none;
}
.team-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}


/* ============================================================
   16. TEAM SUB-PAGES (صفحات الفريق الفرعية)
   (olympiad, grade9, outstanding)
   ============================================================ */

.team-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.team-section {
  margin-bottom: 3.75rem;
}
.section-title-wrapper {
  text-align: center;
  margin-bottom: 1.875rem;
}
.section-title-wrapper h2 {
  font-size: 2rem;
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  display: inline-block;
  padding-bottom: 0.5rem;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.875rem;
}
.team-card {
  background: var(--bg-card);
  border-radius: 1.75rem;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border-light);
  transition: 0.2s ease;
}
.team-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow);
}
.team-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  border: 3px solid var(--accent-cyan);
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.team-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.team-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.team-role {
  color: var(--accent-pink);
  font-weight: 500;
  margin-bottom: 0.625rem;
  font-size: 0.9rem;
}
.team-specialty {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
.back-link {
  text-align: center;
  margin: 2.5rem 0;
}


/* ============================================================
   17. INITIATIVE PAGE (صفحة المبادرة)
   ============================================================ */

.initiative-content {
  background: var(--bg-card);
  border-radius: 2rem;
  padding: 3rem;
  margin: 2.5rem 0;
  border: 1px solid var(--border-light);
}
.initiative-content h2 {
  font-size: 1.8rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent-cyan);
}
.initiative-content p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}
.initiative-content ul {
  margin: 1rem 0 1rem 1.875rem;
  color: var(--text-secondary);
}
.initiative-content li {
  margin: 0.5rem 0;
}


/* ============================================================
   18. AUTH PAGES (صفحات المصادقة: Login & Signup)
   ============================================================ */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 72px - 100px);
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--bg-card);
  border-radius: 2rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-2);
}
.auth-card h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card .form-group {
  margin-bottom: 1.25rem;
}
.auth-link {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--text-secondary);
}
.auth-link a {
  color: var(--accent-cyan);
  font-weight: 600;
}
.auth-link a:hover {
  text-decoration: underline;
}


/* ============================================================
   19. PROFILE PAGE (صفحة الملف الشخصي)
   ============================================================ */

.profile-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}

.profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 2rem;
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

/* ===== ملاحظة: تنسيق .profile-avatar موجود في PART 28 ===== */
/* تم نقل تنسيق .profile-avatar إلى PART 28 ليدعم الصورة وزر التغيير */

.profile-info {
  flex: 1;
  min-width: 200px;
}

.profile-info h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== شارة التوثيق (موجودة في PART 28) ===== */
/* تم تنسيق #verifiedBadge في PART 28 */

.profile-badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.profile-badges span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== إحصائيات المتابعة (موجودة في PART 28) ===== */
/* تم تنسيق .profile-follow-stats في PART 28 */

.profile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0.5rem 0;
}

.profile-details span {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-details i {
  color: var(--accent-cyan);
  width: 18px;
}

/* ===== أزرار الإجراءات ===== */
.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.profile-actions .btn,
.profile-actions .btn-primary,
.profile-actions .btn-danger,
.profile-actions .btn-secondary {
  min-height: 42px;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.2s ease;
}

/* ===== زر حذف الحساب ===== */
#deleteAccountBtn {
  background: var(--accent-red, #EF4444);
  color: #fff;
  border: none;
  cursor: pointer;
}
#deleteAccountBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* ===== زر المتابعة (موجود في PART 28) ===== */
/* تم تنسيق #followBtn في PART 28 */

/* ===== تحليلات الملف الشخصي ===== */
.section-analytics {
  margin: 2rem 0;
}

.section-analytics h2 {
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
}

.section-analytics .analytics-grid {
  display: grid;
  gap: 1rem;
}

.section-analytics .analytics-item {
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-light);
  transition: 0.2s;
}

.section-analytics .analytics-item:hover {
  border-color: var(--accent-tint);
}

.section-analytics .analytics-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.375rem;
  font-weight: 500;
}

.section-analytics .progress-bar-bg {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 10px;
  overflow: hidden;
}

.section-analytics .progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1s ease;
}

/* ===== استجابة البروفايل ===== */
@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem;
  }
  
  .profile-info {
    width: 100%;
    text-align: center;
  }
  
  .profile-info h1 {
    justify-content: center;
  }
  
  .profile-details {
    justify-content: center;
  }
  
  .profile-actions {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .profile-header {
    padding: 1rem;
    gap: 1rem;
  }
  
  .profile-info h1 {
    font-size: 1.4rem;
  }
  
  .profile-details span {
    font-size: 0.8rem;
    gap: 4px;
  }
  
  .profile-details i {
    width: 14px;
  }
  
  .profile-actions .btn,
  .profile-actions .btn-primary,
  .profile-actions .btn-danger,
  .profile-actions .btn-secondary {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }
}
/* ============================================================
   21. DASHBOARD ENHANCEMENTS (تحسينات لوحة التحكم)
   ============================================================ */

/* ===== أزرار التحديث والحذف (للمشرفين) ===== */
.btn-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #000;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  transition: all 0.2s ease;
  min-height: 48px;
}
.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  transition: all 0.2s ease;
  min-height: 48px;
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* ===== تنسيق حقل القراءة فقط (اسم النموذج) ===== */
input[readonly] {
  background: var(--bg-hover) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
  border-style: dashed !important;
}

/* ===== تنسيق رسائل التغذية الراجعة ===== */
#formFeedback {
  display: none;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}
#formFeedback.success {
  background: var(--correct-bg, #e6f5eb);
  color: var(--correct, #16A34A);
  border-color: var(--correct, #16A34A);
}
#formFeedback.error {
  background: var(--incorrect-bg, #fbeaea);
  color: var(--incorrect, #DC2626);
  border-color: var(--incorrect, #DC2626);
}
#formFeedback.info {
  background: var(--accent-tint);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ===== تحسين ترتيب الأزرار في نموذج الرفع ===== */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}
.form-actions .btn,
.form-actions .btn-primary,
.form-actions .btn-danger,
.form-actions .btn-warning {
  min-height: 48px;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  flex: 0 1 auto;
}

/* ===== ضمان ظهور زر الحذف قبل أزرار الإجراءات الأخرى ===== */
#deleteQuestionBtn {
  order: -1;
}

/* ===== تنسيق شاشة الرفض (غير مسموح) ===== */
.admin-card .locked-message {
  text-align: center;
  padding: 2rem;
}
.admin-card .locked-message i {
  font-size: 3rem;
  color: var(--accent-pink);
  margin-bottom: 1rem;
}
.admin-card .locked-message h3 {
  margin-top: 0.5rem;
  color: var(--text-primary);
}
.admin-card .locked-message p {
  color: var(--text-muted);
}

/* ===== تحسين تنسيق شبكة الخيارات في الجوال ===== */
@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn,
  .form-actions .btn-primary,
  .form-actions .btn-danger,
  .form-actions .btn-warning {
    width: 100%;
    justify-content: center;
  }
  #deleteQuestionBtn {
    order: 0; /* في الجوال يظهر في ترتيبه الطبيعي */
  }
}

/* ===== تنسيق جدول النماذج (metadata) ===== */
#metadataList {
  overflow-x: auto;
}
#metadataList table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
  min-width: 500px;
}
#metadataList th {
  background: var(--bg-sunken);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 12px;
  text-align: right;
  border-bottom: 2px solid var(--border-light);
}
#metadataList td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}
#metadataList tr:hover td {
  background: var(--bg-hover);
}
#metadataList i {
  color: var(--accent-cyan);
  margin-left: 6px;
}

/* ===== تنسيقات إضافية للنماذج في الإدارة ===== */
#metadataForm {
  background: var(--bg-sunken);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid var(--border-light);
}
#metadataForm .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  #metadataForm .form-row {
    grid-template-columns: 1fr;
  }
}
/* ============================================================
   22. LEADERBOARD (لوحة المتصدرين)
   ============================================================ */

.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
}
.leaderboard-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1.5rem;
  border-radius: 60px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  color: var(--text-secondary);
}
.leaderboard-tab.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}
.leaderboard-tab:hover:not(.active) {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.leaderboard-list {
  max-width: 800px;
  margin: 0 auto;
}

/* ===== عنصر المتصدر (معدل لدعم الصورة والشارة) ===== */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  cursor: pointer;
}
.leaderboard-item:hover {
  border-color: var(--accent-cyan);
  transform: translateX(-4px);
  box-shadow: var(--shadow-1);
}

.leaderboard-rank {
  font-weight: 800;
  font-size: 1.1rem;
  min-width: 40px;
  color: var(--accent-cyan);
}
.leaderboard-rank.gold { color: #FFD700; }
.leaderboard-rank.silver { color: #C0C0C0; }
.leaderboard-rank.bronze { color: #CD7F32; }

/* ===== صورة المستخدم في المتصدرين ===== */
.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-light);
}
.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.leaderboard-avatar-placeholder {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

.leaderboard-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.leaderboard-user .name {
  font-weight: 600;
}
.leaderboard-user .username {
  font-size: 0.75rem;
  color: var(--text-muted);
}
/* ===== شارة التوثيق في المتصدرين ===== */
.leaderboard-user .verified-badge {
  font-size: 0.8rem;
  color: #1DA1F2;
  margin: 0 0.1rem;
}
.leaderboard-score {
  font-weight: 700;
  color: var(--accent-cyan);
}

/* ===== استجابة المتصدرين ===== */
@media (max-width: 600px) {
  .leaderboard-item {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .leaderboard-rank {
    font-size: 0.9rem;
    min-width: 30px;
  }
  .leaderboard-avatar {
    width: 30px;
    height: 30px;
  }
  .leaderboard-user .name {
    font-size: 0.85rem;
  }
  .leaderboard-user .username {
    font-size: 0.65rem;
  }
  .leaderboard-score {
    font-size: 0.85rem;
  }
}
/* ============================================================
   23. SEARCH PAGE (صفحة نتائج البحث)
   ============================================================ */

.search-results-page {
  max-width: 800px;
  margin: 0 auto;
}
.search-results-page h1 {
  margin-bottom: 1.5rem;
}
.search-back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--text-secondary);
  transition: 0.2s;
}
.search-back-link:hover {
  color: var(--accent-cyan);
  transform: translateX(-4px);
}

/* ===== أقسام نتائج البحث ===== */
.search-result-section {
  margin-top: 1.875rem;
}
.search-result-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  color: var(--accent-cyan);
}
.search-result-item {
  background: var(--bg-card);
  border-radius: 1rem;
  padding: 1.125rem 1.25rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-light);
  transition: 0.2s;
}
.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.search-result-item a {
  text-decoration: none;
  color: var(--text-primary);
  display: block;
}
.search-result-item h4 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--accent-cyan);
}
.search-result-item p {
  opacity: 0.8;
  font-size: 0.95rem;
  margin: 0.25rem 0;
  color: var(--text-secondary);
}
/* ─────────────────────────────────────────────────────────────────────
   PART 6: RESPONSIVE & UTILITIES (الاستجابة والتحسينات النهائية)
   ───────────────────────────────────────────────────────────────────── */

/* ============================================================
   24. ADVANCED RESPONSIVE (استجابة متقدمة لجميع الأحجام)
   ============================================================ */

/* ===== شاشات كبيرة جداً (أكبر من 1400px) ===== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  .hero-section {
    padding: 3.5rem 4rem;
  }
  .section-card {
    padding: 2.5rem 3rem;
  }
}

/* ===== شاشات سطح المكتب المتوسطة (1025px - 1399px) ===== */
@media (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
}

/* ===== شاشات سطح المكتب الصغيرة / التابلت الكبير (993px - 1024px) ===== */
@media (max-width: 1024px) {
  :root {
    --nav-h: 68px;
  }
  .hero-section {
    padding: 2rem 1.75rem;
  }
  .hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
  }
  .section-card {
    padding: 1.5rem;
  }
  .section-text h2 {
    font-size: 1.4rem;
  }
  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* ===== التابلت (769px - 992px) ===== */
@media (max-width: 992px) {
  :root {
    --nav-h: 64px;
  }
  main {
    padding-top: calc(var(--nav-h) + 1rem);
  }
  .hero-section {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .hero-content h1 {
    max-width: 100%;
  }
  .hero-content p {
    max-width: 100%;
  }
  .quick-buttons {
    width: 100%;
    min-width: unset;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .quick-btn {
    flex: 1;
    min-width: 180px;
  }
  .section-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .section-text {
    text-align: center;
  }
  .subject-icons-grid {
    justify-content: center;
  }
  .section-text p {
    margin-left: auto;
    margin-right: auto;
  }
  .footer-links-primary {
    gap: 0.5rem;
  }
  .footer-links-secondary {
    gap: 0.5rem;
  }
  .auth-container {
    min-height: calc(100vh - 64px - 80px);
    padding: 1.5rem 1rem;
  }
  .auth-card {
    padding: 2rem;
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .profile-details {
    justify-content: center;
  }
  .profile-actions {
    justify-content: center;
  }
  .team-intro {
    padding: 2rem;
  }
  .team-intro h1 {
    font-size: 2rem;
  }
  .initiative-content {
    padding: 2rem;
  }
  .admin-card {
    padding: 1.5rem;
  }
}

/* ===== الهواتف الكبيرة / التابلت الصغير (601px - 768px) ===== */
@media (max-width: 768px) {
  :root {
    --nav-h: 60px;
  }
  main {
    padding: calc(var(--nav-h) + 1rem) 1rem 1.5rem;
  }
  .hero-section {
    padding: 1.5rem 1.25rem;
    border-radius: 1.5rem;
  }
  .hero-content h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  .hero-content p {
    font-size: 0.95rem;
  }
  .quick-btn {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    min-width: 140px;
  }
  .section-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }
  .section-text h2 {
    font-size: 1.25rem;
  }
  .subject-icons-grid i {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  .subject-icons-grid {
    gap: 0.75rem;
  }
  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .division-card {
    padding: 1rem;
  }
  .division-card h3 {
    font-size: 1.1rem;
  }
  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem;
  }
  .model-card {
    min-height: 100px;
    padding: 0.75rem 0.5rem;
  }
  .model-icon {
    font-size: 2rem;
  }
  .model-name {
    font-size: 0.85rem;
  }
  .grade-tabs {
    gap: 0.75rem;
  }
  .grade-tab {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
  }
  .subjects-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .subject-card {
    padding: 1rem;
  }
  .subject-card h3 {
    font-size: 1rem;
  }
  .random-options {
    gap: 1rem;
  }
  .random-card {
    width: 200px;
    padding: 1.25rem;
  }
  .random-icon {
    font-size: 2.5rem;
  }
  .random-card h3 {
    font-size: 1.1rem;
  }
  .team-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .team-card {
    padding: 1rem;
  }
  .team-img {
    width: 100px;
    height: 100px;
  }
  .team-name {
    font-size: 1.1rem;
  }
  .departments-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .department-card {
    padding: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .stat-card {
    padding: 1rem;
  }
  .stat-card h3 {
    font-size: 1.4rem;
  }
  .quiz-container {
    padding: 0.75rem 0.75rem 5rem;
  }
  .top-bar {
    padding: 0.3rem 0.75rem;
    border-radius: 40px;
  }
  .eval-btn {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
  }
  .finish-exam {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
  }
  .question-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }
  .question-text {
    font-size: 1rem;
  }
  .options-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }
  .option {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  .explanation-area {
    padding: 1rem;
    font-size: 0.85rem;
  }
  .bottom-nav {
    padding: 0.5rem 0.75rem;
  }
  .bottom-nav .nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-width: 70px;
  }
  .result-container {
    padding: 1.5rem;
  }
  .big-score {
    font-size: 1.6rem;
  }
  .result-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
  }
  .auth-card {
    padding: 1.5rem;
  }
  .profile-header {
    padding: 1.25rem;
  }
  .profile-avatar {
    font-size: 4rem;
    width: 70px;
  }
  .profile-info h1 {
    font-size: 1.4rem;
  }
  .profile-details {
    font-size: 0.8rem;
    gap: 0.5rem 1rem;
  }
  .leaderboard-tab {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  .leaderboard-item {
    padding: 0.6rem 1rem;
  }
  .search-result-item {
    padding: 0.8rem 1rem;
  }
  .search-result-item h4 {
    font-size: 0.95rem;
  }
  .options-grid-5 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== الهواتف الصغيرة (480px - 600px) ===== */
@media (max-width: 600px) {
  :root {
    --nav-h: 56px;
  }
  main {
    padding: calc(var(--nav-h) + 0.75rem) 0.75rem 1.25rem;
  }
  .hero-section {
    padding: 1.25rem 1rem;
    border-radius: 1.25rem;
  }
  .hero-content h1 {
    font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  }
  .hero-content p {
    font-size: 0.85rem;
  }
  .quick-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
    min-width: 120px;
  }
  .section-card {
    padding: 1rem;
    border-radius: 1.25rem;
  }
  .section-text h2 {
    font-size: 1.1rem;
  }
  .section-text p {
    font-size: 0.9rem;
  }
  .discover-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .category-card {
    padding: 1.25rem;
  }
  .category-icon {
    font-size: 2.5rem;
  }
  .category-card h2 {
    font-size: 1.3rem;
  }
  .subjects-grid {
    grid-template-columns: 1fr;
  }
  .subject-card {
    padding: 0.75rem;
  }
  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .model-card {
    min-height: 80px;
    padding: 0.5rem 0.25rem;
    border-radius: 1rem;
  }
  .model-icon {
    font-size: 1.6rem;
  }
  .model-name {
    font-size: 0.75rem;
  }
  .grade-tabs {
    gap: 0.5rem;
  }
  .grade-tab {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  .random-card {
    width: 100%;
    max-width: 280px;
  }
  .team-grid {
    grid-template-columns: 1fr;
  }
  .team-card {
    padding: 0.75rem;
  }
  .team-img {
    width: 80px;
    height: 80px;
  }
  .team-name {
    font-size: 1rem;
  }
  .team-specialty {
    font-size: 0.75rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stat-card {
    padding: 0.75rem;
  }
  .stat-card h3 {
    font-size: 1.2rem;
  }
  .stat-card p {
    font-size: 0.7rem;
  }
  .quiz-container {
    padding: 0.5rem 0.5rem 4.5rem;
  }
  .question-card {
    padding: 1rem;
  }
  .question-text {
    font-size: 0.9rem;
  }
  .options-card {
    padding: 1rem;
  }
  .option {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 1.25rem;
  }
  .bottom-nav .nav-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    min-width: 60px;
  }
  .auth-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }
  .auth-card h2 {
    font-size: 1.3rem;
  }
  .profile-header {
    padding: 1rem;
  }
  .profile-avatar {
    font-size: 3.2rem;
    width: 60px;
  }
  .profile-info h1 {
    font-size: 1.2rem;
  }
  .profile-badges span {
    font-size: 0.7rem;
  }
  .profile-details {
    font-size: 0.75rem;
    gap: 0.3rem 0.75rem;
  }
  .profile-details i {
    width: 14px;
  }
  .profile-actions button {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  .initiative-content {
    padding: 1.25rem;
  }
  .initiative-content h2 {
    font-size: 1.3rem;
  }
  .admin-card {
    padding: 1rem;
    border-radius: 1.25rem;
  }
  .page-header h1 {
    font-size: 1.4rem;
  }
  .leaderboard-tab {
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
  }
  .leaderboard-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
  }
  .leaderboard-rank {
    font-size: 1rem;
    min-width: 30px;
  }
  .leaderboard-user .name {
    font-size: 0.85rem;
  }
  .leaderboard-score {
    font-size: 0.85rem;
  }
  .search-result-item {
    padding: 0.6rem 0.75rem;
  }
  .search-result-item h4 {
    font-size: 0.85rem;
  }
  .search-result-item p {
    font-size: 0.8rem;
  }
  .search-back-link {
    font-size: 0.85rem;
  }
  .options-grid-5 {
    grid-template-columns: 1fr;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
}

/* ===== الهواتف الصغيرة جداً (أقل من 400px) ===== */
@media (max-width: 400px) {
  :root {
    --nav-h: 52px;
  }
  main {
    padding: calc(var(--nav-h) + 0.5rem) 0.5rem 1rem;
  }
  .hero-section {
    padding: 1rem 0.75rem;
    border-radius: 1rem;
  }
  .hero-content h1 {
    font-size: 1.1rem;
  }
  .hero-content p {
    font-size: 0.8rem;
  }
  .quick-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
    min-width: 100px;
  }
  .section-text h2 {
    font-size: 1rem;
  }
  .section-text p {
    font-size: 0.8rem;
  }
  .subject-icons-grid i {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
  .subject-icons-grid {
    gap: 0.5rem;
  }
  .models-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }
  .model-card {
    min-height: 70px;
    padding: 0.4rem 0.2rem;
  }
  .model-icon {
    font-size: 1.3rem;
  }
  .model-name {
    font-size: 0.65rem;
  }
  .grade-tab {
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
  .stat-card {
    padding: 0.5rem;
  }
  .stat-card h3 {
    font-size: 1rem;
  }
  .stat-card p {
    font-size: 0.6rem;
  }
  .bottom-nav .nav-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.6rem;
    min-width: 50px;
  }
}
/* ===== تحسينات إضافية للشاشات الصغيرة جداً ===== */
.filter-btn {
  font-size: 0.65rem !important;
  padding: 0.2rem 0.6rem !important;
}
.add-post-btn {
  width: 32px !important;
  height: 32px !important;
  font-size: 0.8rem !important;
}
#showPostFormBtn {
  font-size: 0.75rem !important;
  padding: 0.4rem 0.8rem !important;
}
.post-card-instagram {
  padding: 0.4rem 0.3rem 0.3rem !important;
}
.post-avatar {
  width: 26px !important;
  height: 26px !important;
}
.post-fullname {
  font-size: 0.7rem !important;
}
.post-username {
  font-size: 0.55rem !important;
}
.post-text {
  font-size: 0.75rem !important;
}
.post-image {
  max-height: 140px !important;
}


/* ============================================================
   25. UTILITIES (أدوات مساعدة إضافية)
   ============================================================ */

/* ===== إخفاء العناصر ===== */
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

/* ===== محاذاة النص ===== */
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-justify { text-align: justify !important; }

/* ===== الألوان ===== */
.text-accent { color: var(--accent-primary) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-pink { color: var(--accent-pink) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--correct, #16A34A) !important; }
.text-danger { color: var(--incorrect, #DC2626) !important; }

/* ===== خلفيات ===== */
.bg-card { background: var(--bg-card) !important; }
.bg-surface { background: var(--bg-surface) !important; }
.bg-sunken { background: var(--bg-sunken) !important; }
.bg-hover { background: var(--bg-hover) !important; }
.bg-accent-tint { background: var(--accent-tint) !important; }

/* ===== الهوامش ===== */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 0.75rem !important; }
.m-4 { margin: 1rem !important; }
.m-5 { margin: 1.5rem !important; }
.m-auto { margin: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-auto { margin-top: auto !important; margin-bottom: auto !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.5rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.5rem !important; }

/* ===== الحشو (Padding) ===== */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.p-5 { padding: 1.5rem !important; }

/* ===== العرض ===== */
.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }

/* ===== الفليكس ===== */
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-start { justify-content: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-around { justify-content: space-around !important; }
.align-start { align-items: flex-start !important; }
.align-center { align-items: center !important; }
.align-end { align-items: flex-end !important; }
.align-stretch { align-items: stretch !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-5 { gap: 1.5rem !important; }

/* ===== التمرير السلس ===== */
.scroll-smooth {
  scroll-behavior: smooth !important;
}

/* ===== منع تحديد النص ===== */
.no-select {
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ===== مؤشر التحويل ===== */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* ===== الحواف ===== */
.rounded-sm { border-radius: 0.625rem !important; }
.rounded-md { border-radius: 1rem !important; }
.rounded-lg { border-radius: 1.375rem !important; }
.rounded-xl { border-radius: 1.75rem !important; }
.rounded-full { border-radius: 999px !important; }

/* ===== الظلال ===== */
.shadow-1 { box-shadow: var(--shadow-1) !important; }
.shadow-2 { box-shadow: var(--shadow-2) !important; }
.shadow-3 { box-shadow: var(--shadow-3) !important; }
.shadow-glow { box-shadow: var(--shadow-glow) !important; }
.shadow-none { box-shadow: none !important; }


/* ============================================================
   26. REDUCED MOTION (تخفيف الحركة للمستخدمين الحساسين)
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-section {
    animation: none !important;
  }
  
  .preloader-ring {
    animation: none !important;
  }
  
  .preloader-word span {
    animation: none !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  .preloader-track-fill {
    animation: none !important;
    width: 100% !important;
  }
  
  .toast-notification.correct.show,
  .toast-notification.wrong.show {
    animation: none !important;
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
  }
  
  .toast-progress::after {
    animation: none !important;
    transform: scaleX(1) !important;
  }
  
  .search-overlay.active .search-panel {
    transform: none !important;
  }
  
  .side-menu {
    transition: none !important;
  }
  
  .model-card:hover,
  .category-card:hover,
  .section-card:hover,
  .info-card:hover,
  .card:hover {
    transform: none !important;
    transition: none !important;
  }
}
/* ============================================================
   PRELOADER (شاشة التحميل الأولية)
   ============================================================ */

.preloader-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #0B0F1C 0%, #020617 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  opacity: 1;
  visibility: visible;
}

.preloader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ===== الحاوية الداخلية ===== */
.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
}

/* ===== أيقونة البريلودر ===== */
.preloader-icon-container {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader-icon-container i {
  font-size: 3.5rem;
  color: var(--accent-cyan, #22D3EE);
  animation: preloaderPulse 1.2s ease-in-out infinite;
  z-index: 2;
}

.preloader-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--accent-cyan, #22D3EE);
  border-right-color: var(--accent-pink, #EC4899);
  animation: preloaderSpin 1.2s linear infinite;
}

.preloader-icon-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: var(--accent-primary, #A855F7);
  border-left-color: var(--accent-lime, #A3E635);
  animation: preloaderSpin 0.8s linear infinite reverse;
}

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

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ===== النص ===== */
.preloader-title {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
  animation: preloaderFadeIn 0.8s ease-out;
}

.preloader-subtitle {
  font-size: 1rem;
  color: var(--text-muted, #9CA3AF);
  font-weight: 400;
  letter-spacing: 0.1em;
  animation: preloaderFadeIn 1s ease-out 0.2s both;
}

/* ===== شريط التقدم ===== */
.preloader-progress-container {
  width: 200px;
  max-width: 70vw;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  animation: preloaderFadeIn 1.2s ease-out 0.4s both;
}

.preloader-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ===== النسبة المئوية ===== */
.preloader-percentage {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #9CA3AF);
  font-variant-numeric: tabular-nums;
  animation: preloaderFadeIn 1.2s ease-out 0.6s both;
}

/* ===== أنيميشن الظهور ===== */
@keyframes preloaderFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== تنسيق الثيمات المختلفة ===== */
.theme-light .preloader-overlay {
  background: radial-gradient(ellipse at center, #f4f4f9 0%, #e8e8ef 100%);
}

.theme-light .preloader-subtitle {
  color: #6B7280;
}

.theme-light .preloader-progress-container {
  background: rgba(0, 0, 0, 0.08);
}

.theme-light .preloader-percentage {
  color: #6B7280;
}

.theme-neon .preloader-overlay {
  background: radial-gradient(ellipse at center, #0A0A0F 0%, #000000 100%);
}

.theme-neon .preloader-icon-ring {
  border-top-color: #FF00FF;
  border-right-color: #00FFFF;
}

.theme-neon .preloader-icon-ring::after {
  border-bottom-color: #FF44AA;
  border-left-color: #AAFF00;
}

.theme-green .preloader-overlay {
  background: radial-gradient(ellipse at center, #0A1A0F 0%, #050F08 100%);
}

.theme-pink .preloader-overlay {
  background: radial-gradient(ellipse at center, #1A0A1A 0%, #0F0510 100%);
}

.theme-yellow .preloader-overlay {
  background: radial-gradient(ellipse at center, #1A1408 0%, #0F0B05 100%);
}

.theme-blue .preloader-overlay {
  background: radial-gradient(ellipse at center, #0A0A1A 0%, #05050F 100%);
}

/* ===== استجابة للشاشات الصغيرة ===== */
@media (max-width: 480px) {
  .preloader-icon-container {
    width: 70px;
    height: 70px;
  }
  .preloader-icon-container i {
    font-size: 2.5rem;
  }
  .preloader-progress-container {
    width: 160px;
  }
  .preloader-title {
    font-size: 1.6rem;
  }
  .preloader-subtitle {
    font-size: 0.85rem;
  }
}

/* ===== دعم المستخدمين الذين يفضلون تقليل الحركة ===== */
@media (prefers-reduced-motion: reduce) {
  .preloader-icon-container i {
    animation: none;
  }
  .preloader-icon-ring {
    animation: none;
  }
  .preloader-icon-ring::after {
    animation: none;
  }
  .preloader-title {
    animation: none;
  }
  .preloader-subtitle {
    animation: none;
  }
  .preloader-progress-container {
    animation: none;
  }
  .preloader-percentage {
    animation: none;
  }
}
/* ═══════════════════════════════════════════════════════════════════
   PART 28: PROFILE FOLLOW & AVATAR (البروفايل والمتابعة وتغيير الصورة)
   ═══════════════════════════════════════════════════════════════════ */

/* ===== إحصائيات المتابعة ===== */
.profile-follow-stats {
  display: flex;
  gap: 1.5rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.profile-follow-stats strong {
  color: var(--text-primary);
  font-weight: 700;
}
.profile-follow-stats .follow-stat {
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.profile-follow-stats .follow-stat:hover {
  color: var(--accent-cyan);
}
.profile-follow-stats .follow-stat:hover i {
  transform: translateX(-3px);
}

/* ===== زر المتابعة ===== */
#followBtn {
  min-width: 140px;
  justify-content: center;
  transition: all 0.25s ease;
}
#followBtn.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent-cyan);
  color: var(--accent-cyan);
}
#followBtn.btn-secondary:hover {
  background: var(--accent-cyan);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34, 211, 238, 0.25);
}

/* ===== زر تغيير صورة البروفايل ===== */
.change-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: 2px solid var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  box-shadow: var(--shadow-2);
}
.change-avatar-btn:hover {
  transform: scale(1.1);
  background: var(--accent-deep);
}
.change-avatar-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== حاوية الصورة ===== */
.profile-avatar {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== شارة التوثيق ===== */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1DA1F2;
  font-size: 0.9rem;
  margin-left: 0.2rem;
  margin-right: 0.2rem;
  filter: drop-shadow(0 0 4px rgba(29, 161, 242, 0.3));
  vertical-align: middle;
}
.verified-badge i {
  font-size: inherit;
  color: #1DA1F2;
}
#verifiedBadge i {
  font-size: 1.2rem;
  color: #1DA1F2;
  filter: drop-shadow(0 0 4px rgba(29, 161, 242, 0.4));
}

/* ===== النافذة المنبثقة للمتابعين ===== */
.follow-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.follow-modal-content {
  background: var(--bg-card);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.follow-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.follow-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}
.follow-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s;
  padding: 0.25rem;
  line-height: 1;
}
.follow-modal-close:hover {
  color: var(--text-primary);
  transform: rotate(90deg);
}
.follow-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.follow-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: 0.15s;
  border-bottom: 1px solid var(--border-light);
}
.follow-list-item:hover {
  background: var(--bg-hover);
}
.follow-list-item:last-child {
  border-bottom: none;
}

/* ===== استجابة النافذة والبروفايل ===== */
@media (max-width: 600px) {
  .profile-avatar {
    width: 80px;
    height: 80px;
  }
  .change-avatar-btn {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
  .profile-follow-stats {
    gap: 1rem;
    font-size: 0.85rem;
  }
  .follow-modal-content {
    max-width: 95vw;
    max-height: 90vh;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   PART 29: COMMUNITY POSTS (بطاقات إنستغرام)
   ═══════════════════════════════════════════════════════════════════ */

.post-card-instagram {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 1.5rem;
  padding: 1.25rem 1.25rem 0.75rem;
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-1);
}
.post-card-instagram:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--accent-tint);
  transform: translateY(-2px);
}

/* ===== رأس البطاقة ===== */
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.post-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex: 1;
}
.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-light);
  transition: border-color 0.2s;
}
.post-user-info:hover .post-avatar {
  border-color: var(--accent-cyan);
}
.post-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-avatar-placeholder {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}
.post-user-details {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.post-fullname {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.post-user-info:hover .post-fullname {
  color: var(--accent-cyan);
}
.post-username {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.post-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.post-time i {
  font-size: 0.65rem;
  opacity: 0.6;
}

/* ===== شارة التوثيق داخل البطاقة ===== */
.post-user-details .verified-badge {
  font-size: 0.8rem;
  color: #1DA1F2;
  margin: 0 0.1rem;
}

/* ===== محتوى المنشور ===== */
.post-body {
  margin: 0.4rem 0 0.6rem;
}
.post-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  word-break: break-word;
  margin: 0;
}

/* ===== صورة المنشور ===== */
.post-image-container {
  margin: 0.65rem 0;
  border-radius: 0.75rem;
  overflow: hidden;
  position: relative;
}
.post-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 0.75rem;
  transition: transform 0.3s ease;
  display: block;
}
.post-image-container:hover .post-image {
  transform: scale(1.02);
}

/* ===== أسفل البطاقة ===== */
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-light);
  margin-top: 0.2rem;
}
.post-category {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent-tint);
  color: var(--accent-primary);
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.post-category i {
  font-size: 0.6rem;
  opacity: 0.7;
}
.post-actions {
  display: flex;
  gap: 0.75rem;
  color: var(--text-muted);
}
.post-actions button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  padding: 0.2rem;
}
.post-actions button:hover {
  color: var(--accent-primary);
  transform: scale(1.1);
}
.post-actions .liked {
  color: #ed4956;
}
.post-actions .liked:hover {
  color: #ed4956;
}

/* ===== استجابة بطاقات المجتمع ===== */
@media (max-width: 768px) {
  .post-card-instagram {
    padding: 1rem 1rem 0.6rem;
    border-radius: 1.25rem;
  }
  .post-avatar {
    width: 40px;
    height: 40px;
  }
  .post-fullname {
    font-size: 0.9rem;
  }
  .post-username {
    font-size: 0.75rem;
  }
  .post-text {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .post-card-instagram {
    padding: 0.75rem 0.6rem 0.5rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
  }
  .post-avatar {
    width: 34px;
    height: 34px;
  }
  .post-fullname {
    font-size: 0.8rem;
  }
  .post-username {
    font-size: 0.65rem;
  }
  .post-time {
    font-size: 0.6rem;
  }
  .post-text {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  .post-image {
    max-height: 220px;
  }
  .post-category {
    font-size: 0.6rem;
    padding: 0.15rem 0.6rem;
  }
  .post-actions button {
    font-size: 0.85rem;
  }
}

@media (max-width: 380px) {
  .post-card-instagram {
    padding: 0.5rem 0.4rem 0.4rem;
  }
  .post-avatar {
    width: 30px;
    height: 30px;
  }
  .post-fullname {
    font-size: 0.75rem;
  }
  .post-username {
    font-size: 0.6rem;
  }
  .post-text {
    font-size: 0.8rem;
  }
  .post-image {
    max-height: 160px;
  }
}
/* ============================================================
   COMMUNITY INTERFACE (أزرار وفلترة المجتمع)
   ============================================================ */

/* ===== شريط الفلترة ===== */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 3rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-1);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

/* ===== زر إضافة منشور جديد ===== */
.add-post-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-2);
  flex-shrink: 0;
}
.add-post-btn:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: var(--shadow-glow);
}

/* ===== زر "عرض النموذج" (إن لم يكن بارزاً) ===== */
#showPostFormBtn {
  background: var(--grad-primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-1);
}
#showPostFormBtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
#showPostFormBtn i {
  font-size: 1rem;
}

/* ===== نموذج إنشاء المنشور ===== */
.community-create-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-2);
}
.community-create-post-card h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.community-create-post-card .form-group {
  margin-bottom: 1rem;
}
.community-create-post-card .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.community-create-post-card input,
.community-create-post-card textarea,
.community-create-post-card select {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid var(--border-light);
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.community-create-post-card input:focus,
.community-create-post-card textarea:focus,
.community-create-post-card select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-tint);
}
.community-create-post-card .btn-primary {
  margin-top: 0.5rem;
}
.community-create-post-card .btn-secondary {
  margin-top: 0.5rem;
  margin-right: 0.5rem;
}

/* ===== استجابة للشاشات الصغيرة ===== */
@media (max-width: 600px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 1.5rem;
  }
  .filter-buttons {
    justify-content: center;
  }
  .filter-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
  }
  .add-post-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    align-self: center;
  }
  #showPostFormBtn {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  .community-create-post-card {
    padding: 1rem;
  }
}