﻿/* ==========================================================================
   كلية علوم الحاسوب والرياضيات — جامعة الموصل
   ملف التنسيقات الشامل (Master CSS Architecture)
   
   جميع التنسيقات، الألوان، الخطوط، المسافات، الأيقونات، والكروت تدار من هذا الملف مباشرة!
   يمكنك تعديل أي جزء في الموقع من خلال تغيير القيم في هذا الملف بسهولة تامة.

   فهرس الأقسام (Table of Contents):
   1.  متغيرات النظام ولوحة الألوان (Design Tokens & 60-30-10 Rule)
   2.  الإعدادات العامة والتهيئة الأساسية (Base & Reset)
   3.  الخلفية السينمائية المبلورة والشبكة الحبيبية (Cinematic Background & Grain)
   4.  شريط القراءة العلوي والعودة لأعلى (Progress Bar & Back To Top)
   5.  شريط التنقل العلوي وقائمة الجوال (Navbar & Mobile Drawer)
   6.  حاويات الأيقونات والشارات العامة (Icon Boxes & Badges)
   7.  الأزرار التفاعلية (Buttons System)
   8.  القسم الترحيبي (Hero Section & Floating Stats)
   9.  رؤوس الأقسام الشائعة (Section Headers & Layout Wrappers)
   10. قسم "عن القسم" والرؤية وعمادة الكلية (About, Vision & Deanery)
   11. قسم الخطة الدراسية والمراحل الأربع (Curriculum & Courses Grid)
   12. قسم المختبرات العلمية (Scientific Labs Cards)
   13. المختبر التفاعلي المباشر للخوارزميات (Interactive Algorithm Lab)
   14. قسم الأقسام العلمية للكلية (College 9 Departments Grid)
   15. قسم الأسئلة الشائعة الأكورديون (Interactive FAQ Accordion)
   16. تذييل الصفحة (Footer & Copyrights)
   17. تأثيرات الحركة والظهور عند التمرير (Animations & Scroll Reveal)
   18. التجاوب الكامل مع الشاشات والهواتف (Responsive Media Queries)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ==========================================================================
   1. متغيرات النظام ولوحة الألوان (قاعدة 60% / 30% / 10%)
   ========================================================================== */
:root {
  /* ------------------------------------------------------------------------
     اللون الأساسي (60%): الأزرق الداكن الملكي (Royal Navy)
     ------------------------------------------------------------------------ */
  --bg-primary: #14213D;             /* لون الخلفية السائد */
  --bg-primary-dark: #0B1226;        /* درجة أغمق للفوتر والظلال */
  --bg-primary-light: #1B2D52;       /* درجة أفتح للكروت والحاويات الداخلية */
  --bg-primary-lighter: #243A66;     /* درجة للتمرير والهايلايت */
  --bg-glass: rgba(20, 33, 61, 0.78); /* زجاج نافبار والكروت الكبيرة */
  --bg-glass-card: rgba(27, 45, 82, 0.65); /* خلفية كروت المحتوى */
  --bg-input: #1B2D52;               /* حقول الإدخال والقوائم المنسدلة */

  /* ------------------------------------------------------------------------
     اللون الثانوي (30%): الكريمي الدافئ (للنصوص والقراءة والحدود)
     ------------------------------------------------------------------------ */
  --text-primary: #F4EDE0;           /* النص الرئيسي وعناوين المقالات */
  --text-muted: rgba(244, 237, 224, 0.75); /* النصوص التوضيحية والفقرات */
  --text-subtle: rgba(244, 237, 224, 0.50); /* النصوص الثانوية والتواريخ */
  --border-light: rgba(244, 237, 224, 0.18); /* حدود الكروت الأساسية */
  --border-subtle: rgba(244, 237, 224, 0.10); /* فواصل خفيفة */

  /* ------------------------------------------------------------------------
     لون التمييز (10%): المرجاني الحيوي (Coral Accent) للأزرار والتوهج
     ------------------------------------------------------------------------ */
  --accent-violet: #4DD2C8;          /* المرجاني الرئيسي */
  --accent-violet-light: #00A89C;    /* مرجاني فاتح للأيقونات والعناوين البارزة */
  --accent-violet-hover: #3D4C9A;    /* مرجاني أغمق عند التحويم (Hover) */
  --accent-glow: rgba(43, 57, 144, 0.35); /* هالة التوهج */
  --accent-badge-bg: rgba(43, 57, 144, 0.15); /* خلفية شارات المرجاني */
  --accent-badge-border: rgba(43, 57, 144, 0.40); /* حدود الشارات */

  /* ------------------------------------------------------------------------
     الخطوط والطباعة
     ------------------------------------------------------------------------ */
  --font-arabic: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* ------------------------------------------------------------------------
     الظلال ومؤثرات العمق
     ------------------------------------------------------------------------ */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 10px 32px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(244, 237, 224, 0.08);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 25px rgba(255, 107, 91, 0.25);
  --glow-violet-box: 0 0 20px rgba(255, 107, 91, 0.6);

  /* ------------------------------------------------------------------------
     أزمنة الحركة والانتقال والانحناءات
     ------------------------------------------------------------------------ */
  --transition-fast: 0.2s ease;
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
}

/* ==========================================================================
   2. الإعدادات العامة والتهيئة الأساسية (Base & Reset)
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-arabic);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

::selection {
  background: var(--accent-glow);
  color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

img, svg {
  display: block;
}

.font-mono {
  font-family: var(--font-mono);
  direction: ltr;
  display: inline-block;
}

/* ==========================================================================
   3. الخلفية السينمائية المبلورة والشبكة الحبيبية
   ========================================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?q=85&w=2560&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: blur(6px) saturate(1.15) brightness(0.24);
  transform: scale(1.08);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      rgba(20, 33, 61, 0.94) 0%,
      rgba(20, 33, 61, 0.88) 35%,
      rgba(27, 45, 82, 0.90) 70%,
      rgba(11, 18, 38, 0.96) 100%
    ),
    radial-gradient(ellipse at 15% 15%, rgba(255, 107, 91, 0.10) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 25%, rgba(255, 107, 91, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 85%, rgba(244, 237, 224, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* طبقة الحبيبات الدقيقة السينمائية */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   4. شريط القراءة العلوي والعودة لأعلى
   ========================================================================== */
.reading-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 1001;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-violet-light));
  box-shadow: 0 0 10px var(--accent-violet);
  transition: width 0.1s ease-out;
}

.btn-back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  background: var(--bg-primary-light);
  border: 1px solid var(--accent-badge-border);
  color: var(--accent-violet-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: var(--transition-smooth);
}

.btn-back-to-top:hover {
  background: var(--accent-violet);
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==========================================================================
   5. شريط التنقل العلوي وقائمة الجوال (Navbar & Mobile Drawer)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: var(--transition-smooth);
}

/* الحالة عند التمرير لأسفل */
.site-header.is-scrolled {
  background-color: rgba(20, 33, 61, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 0;
}

.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.site-logo-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  letter-spacing: -0.02em;
}

.site-logo-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  display: block;
}

.nav-menu-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
  background: rgba(20, 33, 61, 0.45);
  backdrop-filter: blur(12px);
  padding: 0.4rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.2rem;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link-badge {
  color: var(--accent-violet-light) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-nav-cta {
  display: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

.mobile-menu-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-primary-light);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.mobile-menu-btn:hover {
  background: var(--accent-badge-bg);
  color: var(--accent-violet-light);
  border-color: var(--accent-badge-border);
}

/* قائمة الجوال المنسدلة */
.mobile-drawer {
  position: fixed;
  top: 4.5rem;
  left: 1rem;
  right: 1rem;
  background: rgba(20, 33, 61, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  z-index: 999;
  display: none;
  flex-direction: column;
  gap: 0.625rem;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mobile-drawer.is-open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(27, 45, 82, 0.4);
  border: 1px solid var(--border-subtle);
}

.mobile-nav-link:hover {
  background: var(--accent-badge-bg);
  color: var(--accent-violet-light);
  border-color: var(--accent-badge-border);
}

.mobile-drawer-btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* مؤشر النبض الأخضر أو البنفسجي */
.pulse-indicator {
  position: relative;
  display: inline-flex;
  width: 0.5rem;
  height: 0.5rem;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background-color: var(--accent-violet);
  opacity: 0.75;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.pulse-dot {
  position: relative;
  display: inline-flex;
  border-radius: var(--radius-full);
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--accent-violet-light);
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ==========================================================================
   6. حاويات الأيقونات والشارات العامة (Icon Boxes & Badges)
   ========================================================================== */
/* أحجام وألوان أيقونات Lucide الموحدة */
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

.icon-accent { color: var(--accent-violet-light); }
.icon-sand { color: var(--text-primary); }
.icon-white { color: #ffffff; }

.status-dot-violet {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color:rgba(244, 237, 224, 0.75);
  display: inline-block;
  flex-shrink: 0;
}

.text-sand { color: var(--text-primary); }
.text-accent { color: var(--accent-violet-light); }
.text-muted { color: var(--text-muted); }
.text-bold { font-weight: 700; }

.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-box-sm {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
}

.icon-box-md {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
}

.icon-box-lg {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
}

.icon-box-xl {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-xl);
}

.icon-box-round {
  border-radius: var(--radius-full);
}

.icon-box-violet {
  background: var(--accent-badge-bg);
  border: 1px solid var(--accent-badge-border);
  color: var(--accent-violet-light);
}

.icon-box-sand {
  background: rgba(244, 237, 224, 0.1);
  border: 1px solid var(--border-light);
  color: var(--accent-violet-light);
}

.icon-box-white {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* شارات مميزة */
.badge-violet {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  background: var(--accent-badge-bg);
  border: 1px solid var(--accent-badge-border);
  color: var(--accent-violet-light);
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge-sand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-primary-light);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.75rem;
}
.badge-tag1 {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--accent-badge-bg);
  color: var(--accent-violet-light);
  border: 1px solid var(--accent-badge-border);
}
.badge-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  background: var(--accent-badge-bg);
  color: var(--accent-violet-light);
  border: 1px solid var(--accent-badge-border);
}

/* ==========================================================================
   7. الأزرار التفاعلية (Buttons System)
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.9375rem;
  background: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-violet-hover) 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 107, 91, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 91, 0.6);
  filter: brightness(1.08);
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.9375rem;
  background: rgba(27, 45, 82, 0.6);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.btn-glass:hover {
  background: rgba(27, 45, 82, 0.85);
  border-color: var(--accent-badge-border);
  color: #ffffff;
  transform: translateY(-2px);
}

/* ==========================================================================
   8. القسم الترحيبي (Hero Section & Floating Stats)
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 6rem;
  padding-bottom: 4rem;
  overflow: hidden;
}
.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* ضبط الصورة لتكون واحدة وتغطي كل المساحة */
   background-image: url("Testt.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    
    /* قيمة البلور (تستطيع تعديل 8px حسب الرغبة) */
    filter: blur(2px);
    
    /* لجعل الصورة خلف الكلمات والأزرار */
    z-index: 1;
}

/* لجعل النصوص والأزرار تظهر فوق الخلفية المغبشة */
.hero-section > * {
    position: relative;
    z-index: 2;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 58rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-badge-wrapper {
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.text-glow-violet {
  color: var(--accent-violet-light);
  text-shadow: 0 0 25px rgba(255, 107, 91, 0.45);
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 44rem;
  margin: 0 auto 2.5rem auto;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

/* بطاقة الإحصائيات العائمة */
.stats-card {
  padding: 1.75rem 2rem;
  border-radius: var(--radius-xl);
  max-width: 54rem;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.stat-number-accent {
  color: var(--accent-violet-light);
  text-shadow: 0 0 15px rgba(255, 107, 91, 0.4);
}

.stat-number-sand {
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ==========================================================================
   9. رؤوس الأقسام الشائعة والحاويات (Section Headers & Wrappers)
   ========================================================================== */
.site-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-container-sm {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-wrapper {
  padding: 6rem 0;
  position: relative;
}

.section-bordered {
  border-top: 1px solid var(--border-subtle);
}

.section-glass-divider {
  position: relative;
}

.section-glass-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.section-header {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-violet-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.875rem;
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* نظام الكروت الزجاجية العام */
.glass-panel {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--accent-badge-border);
  box-shadow: var(--shadow-hover);
  
}

/* شبكات الكروت الجاهزة */
.card-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* ==========================================================================
   10. قسم "عن القسم" والرؤية وعمادة الكلية (About, Vision & Deanery)
   ========================================================================== */
.about-vision-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.about-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.about-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.vision-box {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(27, 45, 82, 0.7);
  border: 1px solid rgba(255, 107, 91, 0.25);
  margin-bottom: 1.25rem;
}

.vision-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-violet-light);
  margin-bottom: 0.5rem;
}

.vision-box-text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.objectives-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.objectives-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(27, 45, 82, 0.5);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.objective-number {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-badge-bg);
  color: var(--accent-violet-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.dept-head-box {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.dept-head-role {
  font-size: 0.75rem;
  color: var(--text-subtle);
  display: block;
}

.dept-head-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* شبكة كروت المعلومات الأكاديمية */
.about-features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.feature-box {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-box-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.feature-box-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.feature-box-tag {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--accent-violet-light);
}

/* لافتة عمادة الكلية */
.deanery-banner {
  margin-top: 3rem;
  padding: 1.75rem 2rem;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.deanery-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.deanery-text {
  flex: 1;
  min-width: 260px;
}

.deanery-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.deanery-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.deanery-dean-name {
  color: var(--text-primary);
  font-weight: 700;
}

/* ==========================================================================
   11. قسم الخطة الدراسية والمراحل الأربع (Curriculum & Courses Grid)
   ========================================================================== */
.curriculum-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto;
}

.year-card {
  padding: 2rem;
}

.year-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.year-card-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.year-number-badge {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: var(--accent-badge-bg);
  color: var(--accent-violet-light);
  border: 1px solid var(--accent-badge-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 900;
  flex-shrink: 0;
}

.year-number-badge-sand {
  background: rgba(244, 237, 224, 0.1);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.year-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.year-card-subtitle {
  font-size: 0.75rem;
  color: var(--accent-violet-light);
  display: block;
}

.year-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.course-box {
  padding: 0.875rem;
  border-radius: var(--radius-md);
  background: rgba(27, 45, 82, 0.6);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.course-box:hover {
  background: rgba(27, 45, 82, 0.9);
  border-color: var(--accent-badge-border);
  transform: translateY(-2px);
}

.course-title-ar {
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--accent-violet-light);
  display: block;
  margin-bottom: 0.25rem;
}

.course-title-en {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

/* ==========================================================================
   12. قسم المختبرات العلمية (Scientific Labs Cards)
   ========================================================================== */
.lab-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.lab-card:hover {
  transform: translateY(-4px);
}

.lab-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 1rem 0 0.5rem 0;
  color: var(--text-primary);
}

.lab-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   13. المختبر التفاعلي المباشر للخوارزميات (Interactive Algorithm Lab)
   ========================================================================== */

.algo-panel {
  padding: 2rem;
  border-radius: var(--radius-xl);
  max-width: 64rem;
  margin: 0 auto;
}

.algo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.algo-target-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.algo-target-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.algo-select {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
}

.algo-select:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 10px var(--accent-glow);
}

.algo-btn-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.algo-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.algo-metric-box {
  background: rgba(27, 45, 82, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}

.algo-metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.algo-metric-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-violet-light);
}

.algo-complexity-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.algo-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--accent-violet-light);
}

.algo-visual-stage {
  min-height: 200px;
  background: rgba(11, 18, 38, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.algo-bars-flex {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.375rem;
}

/* شريط عنصر المصفوفة */
.algo-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 24px;
  max-width: 44px;
  height: 100%;
  justify-content: flex-end;
}

.algo-bar-val-text {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  font-family: var(--font-mono);
  color: rgba(244, 237, 224, 0.65);
  transition: color 0.2s ease;
}

.algo-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: #1B2D52;
  border-top: 1px solid rgba(244, 237, 224, 0.25);
  border-left: 1px solid rgba(244, 237, 224, 0.25);
  border-right: 1px solid rgba(244, 237, 224, 0.25);
  transition: height 0.3s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.algo-bar-idx-text {
  font-size: 0.625rem;
  color: rgba(244, 237, 224, 0.5);
  margin-top: 0.25rem;
  font-family: var(--font-mono);
}

/* حالات أشرطة الخوارزمية */
.algo-bar-active .algo-bar {
  background: rgba(255, 107, 91, 0.85);
  border-color: #FF6B5B;
  box-shadow: 0 0 15px rgba(255, 107, 91, 0.7);
  animation: barPulse 0.5s infinite alternate;
}
.algo-bar-active .algo-bar-val-text {
  color: #FF8A7A;
  font-weight: 700;
}

.algo-bar-found .algo-bar {
  background: #FF6B5B;
  border-color: #ffffff;
  box-shadow: 0 0 22px rgba(255, 107, 91, 0.95);
}
.algo-bar-found .algo-bar-val-text {
  color: #ffffff;
  font-weight: 900;
}

.algo-bar-dimmed .algo-bar {
  background: rgba(20, 33, 61, 0.4);
  border-color: rgba(20, 33, 61, 0.6);
  opacity: 0.25;
}
.algo-bar-dimmed .algo-bar-val-text {
  color: rgba(244, 237, 224, 0.2);
}

@keyframes barPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.3); }
}

.algo-info-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(27, 45, 82, 0.4);
  border: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.algo-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ==========================================================================
   14. قسم الأقسام العلمية للكلية (College 9 Departments Grid)
   ========================================================================== */
.college-dept-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.college-dept-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-badge-border);
}

.college-dept-card.active-dept {
  border-color: black;
  background: #e8dcc4;
  box-shadow: 0 0 25px #1f3d3b;
  
}

.dept-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dept-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dept-card-en {
  font-size: 0.6875rem;
  color: var(--accent-violet-light);
  display: block;
}

.dept-card-en-subtle {
  font-size: 0.6875rem;
  color: var(--text-subtle);
  display: block;
}

.dept-card-head {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   15. قسم الأسئلة الشائعة الأكورديون (Interactive FAQ Accordion)
   ========================================================================== */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-item.is-open {
  border-color: var(--accent-badge-border);
  box-shadow: 0 4px 20px rgba(255, 107, 91, 0.15);
}

.faq-trigger {
  width: 100%;
  padding: 1.25rem 1.5rem;
  text-align: right;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition-smooth);
}

.faq-trigger:hover {
  color: var(--accent-violet-light);
}

.faq-chevron {
  color: var(--accent-violet-light);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
}

.faq-content {
  display: none;
  padding: 0 1.5rem 1.25rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.8;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.faq-item.is-open .faq-content {
  display: block;
}

/* ==========================================================================
   16. تذييل الصفحة (Footer & Copyrights)
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary-dark);
  padding: 5rem 0 2.5rem 0;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
}

.footer-info-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand-title {
  font-size: 1.25rem;
  font-weight: 900;
  display: block;
  color: var(--text-primary);
}

.footer-brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.footer-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 28rem;
}

.footer-badge {
  font-size: 0.75rem;
  color: var(--accent-violet-light);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.footer-col-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.footer-link:hover {
  color: var(--accent-violet-light);
  transform: translateX(-4px);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-subtle);
  text-align: center;
}

.footer-love {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-heart-icon {
  color: var(--accent-violet);
  fill: var(--accent-violet);
}


/* ==========================================================================
   17. تأثيرات الحركة والظهور عند التمرير (Animations & Scroll Reveal)
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.animate-float-slow {
  animation: floatSlow 5s ease-in-out infinite;
}

/* ==========================================================================
   18. التجاوب الكامل مع الشاشات والهواتف (Responsive Media Queries)
   ========================================================================== */
/* أجهزة التابلت والشاشات المتوسطة (Medium Tablets: >= 640px) */
@media (min-width: 640px) {
  .hero-title {
    font-size: 3rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    flex-direction: row;
    text-align: right;
  }
}

/* أجهزة الكمبيوتر المحمول والشاشات الكبيرة (Laptops / Desktops: >= 1024px) */
@media (min-width: 1024px) {
  .hero-title {
    font-size: 3.75rem;
  }

  .nav-menu-desktop {
    display: flex;
  }

  .btn-nav-cta {
    display: inline-flex;
  }

  .mobile-menu-btn {
    display: none;
  }

  .card-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}


/* ==========================================================================
   19. قسم "موقعنا" — خريطة Mapbox وأزرار البوابات (Location & Campus Map)
   ========================================================================== */
.location-panel {
  padding: 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
}

/* أزرار البوابات */
.gate-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.gate-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(27, 45, 82, 0.6);
  border: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.gate-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gate-tab:hover {
  color: var(--text-primary);
  border-color: var(--accent-badge-border);
  transform: translateY(-2px);
}

.gate-tab:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 2px;
}

.gate-tab.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-violet-hover) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 18px rgba(77, 210, 200, 0.35);
}

/* جسم القسم: خريطة + تعليمات */
.location-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.location-map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-primary-dark);
}

.campus-map {
  width: 100%;
  height: 360px;
  direction: ltr; /* Mapbox يعمل بشكل صحيح داخل حاوية LTR */
}

.campus-map-message {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  direction: rtl;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
}

.campus-map-message strong {
  color: var(--accent-violet-light);
  font-size: 1rem;
}

/* لوحة التعليمات */
.location-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}

.gate-instructions {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: rgba(27, 45, 82, 0.55);
  border: 1px solid var(--border-subtle);
}

.gate-instructions-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.gate-instructions-title {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text-primary);
}

.gate-instructions-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.gate-instructions.is-updating {
  animation: gateInfoIn 0.4s ease;
}

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

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 2px solid #ffffff;
}

.legend-dot-dept { background: #FF6B5B; }
.legend-dot-gate { background: #F4EDE0; border-color: var(--accent-violet); }

/* علامات الخريطة (Markers) */
.map-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 3px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  cursor: default;
}

.map-marker svg { width: 55%; height: 55%; }

.map-marker-dept {
  width: 44px;
  height: 44px;
  background: #FF6B5B;
  color: #ffffff;
}

.map-marker-dept::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid #FF6B5B;
  animation: markerPulse 1.8s ease-out infinite;
}

.map-marker-gate {
  width: 34px;
  height: 34px;
  background: #F4EDE0;
  color: #14213D;
  border-color: var(--accent-violet);
}

.map-marker-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-family: var(--font-arabic);
  font-size: 0.75rem;
  font-weight: 700;
  direction: rtl;
  color: #ffffff;
  background: rgba(11, 18, 38, 0.88);
  border: 1px solid rgba(244, 237, 224, 0.3);
  pointer-events: none;
}

@keyframes markerPulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.mapboxgl-ctrl-group { direction: ltr; }

@media (min-width: 640px) {
  .location-panel { padding: 2rem; }
  .campus-map { height: 440px; }
}

@media (min-width: 1024px) {
  .location-body { grid-template-columns: 2fr 1fr; align-items: stretch; }
  .campus-map { height: 500px; }
}

.gate-route-meta {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.7;
  color: var(--accent-violet-light);
}

/* مفاتيح تبديل نوع الخريطة و3D */
.location-map-wrap { position: relative; }

.map-style-switch {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-full);
  background: rgba(11, 18, 38, 0.85);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(8px);
}

.map-style-switch button {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.map-style-switch button:hover { color: var(--text-primary); }

.map-style-switch button.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-violet) 0%, var(--accent-violet-hover) 100%);
}


/* ==========================================================================
   20. الرحلة السينمائية — من الفضاء إلى القسم (Cinematic Descent)
   ========================================================================== */
.map-marker-dept { cursor: pointer; }
.map-marker-dept:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

.map-cine-hint {
  position: absolute; bottom: 10px; left: 10px; z-index: 2;
  padding: 0.35rem 0.8rem; border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 700; color: var(--text-primary);
  background: rgba(11, 18, 38, 0.85); border: 1px solid var(--border-light);
  backdrop-filter: blur(8px); pointer-events: none;
}

html.cine-lock { overflow: hidden; }

.cine {
  position: fixed; inset: 0; z-index: 10000; overflow: hidden;
  background: #000; color: #fff; direction: rtl;
  opacity: 0; transition: opacity 0.6s ease;
}
.cine.is-open { opacity: 1; }

.cine-map { position: absolute; inset: 0; direction: ltr; transition: filter 2.4s ease, transform 6s ease-out; }
.cine.show-photo .cine-map { filter: blur(10px) brightness(0.55); transform: scale(1.06); }

.cine-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.6) 100%);
}
.cine-haze { /* وهج الغلاف الجوي أثناء العبور */
  position: absolute; inset: 0; pointer-events: none; opacity: var(--haze, 0); mix-blend-mode: screen;
  background: radial-gradient(ellipse at 50% 115%, rgba(190, 220, 255, 0.75), rgba(120, 170, 255, 0.25) 55%, transparent 80%);
}

/* الشريطان السينمائيان + لوحة القياس */
.cine-bar {
  position: absolute; left: 0; right: 0; z-index: 5; height: 9vh; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0 1.25rem; background: #000;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cine-bar-top { top: 0; transform: translateY(-100%); }
.cine-bar-bottom { bottom: 0; transform: translateY(100%); }
.cine.is-open .cine-bar { transform: none; }
.cine-bar small { font-size: 0.65rem; color: rgba(255, 255, 255, 0.55); }

.cine-hud { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem; font-family: var(--font-mono); font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); }
.cine-hud b { color: #4DD2C8; font-weight: 700; margin-left: 0.35rem; }
.cine-hud em { font-style: normal; font-family: var(--font-arabic); font-weight: 700; color: #fff; }

.cine button {
  font: inherit; font-size: 0.8rem; font-weight: 700; color: #fff; cursor: pointer;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.2s;
}
.cine button:hover { background: rgba(255, 255, 255, 0.22); }
.cine button.is-primary { background: linear-gradient(135deg, var(--accent-violet), var(--accent-violet-hover)); border-color: rgba(255, 255, 255, 0.2); }
.cine-bar-bottom span { display: flex; gap: 0.5rem; }

/* العناوين المرافقة */
.cine-caption {
  position: absolute; left: 0; right: 0; bottom: 16vh; z-index: 2; text-align: center; pointer-events: none;
  font-size: clamp(1.4rem, 4vw, 2.6rem); font-weight: 800; opacity: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.85);
}
.cine-caption.is-in { animation: cineCap 3.2s ease both; }
.cine.show-photo .cine-caption { display: none; }
@keyframes cineCap {
  0%   { opacity: 0; transform: translateY(14px); letter-spacing: 0.2em; }
  18%, 72% { opacity: 1; transform: none; letter-spacing: 0.06em; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ظهور المبنى */
.cine-photo { position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; overflow: hidden; transition: opacity 2.4s ease; }
.cine-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent 45%); }
.cine-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cine.show-photo .cine-photo { opacity: 1; pointer-events: auto; }
.cine.show-photo .cine-photo img { animation: cineKen 16s ease-out forwards; }
@keyframes cineKen { from { transform: scale(1.14); } to { transform: scale(1); } }

.cine-photo-card { position: absolute; z-index: 1; left: 0; right: 0; bottom: calc(9vh + 1.5rem); text-align: center; padding: 0 1rem; }
.cine-photo-card h3 { font-size: clamp(1.6rem, 4.5vw, 3rem); font-weight: 900; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.9); }
.cine-photo-card p { margin: 0.35rem 0 1rem; color: rgba(255, 255, 255, 0.8); font-size: 0.95rem; }
.cine-actions { display: flex; justify-content: center; gap: 0.6rem; }

/* شاشة التجهيز */
.cine-loading {
  position: absolute; inset: 0; z-index: 4; background: #000 center / cover no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  font-weight: 700; transition: opacity 1.4s ease;
}
.cine.is-ready .cine-loading { opacity: 0; pointer-events: none; }
.cine-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: #4DD2C8; animation: cineSpin 0.9s linear infinite; }
@keyframes cineSpin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .cine-hud { gap: 0.75rem; font-size: 0.68rem; }
  .cine-hud .hide-sm, .cine-bar small { display: none; }
}
.cine-status { font-size: 0.9rem; color: rgba(255, 255, 255, 0.85); text-align: center; padding: 0 1rem; }
.cine-photo-err { position: absolute; z-index: 2; top: 50%; left: 0; right: 0; text-align: center; padding: 0 1rem; font-weight: 700; color: #ffb4a8; }
.cine-photo-err[hidden] { display: none; }
