/* css/style.css */

/* === إعادة تعيين أساسية و Box Sizing === */

/* === متغيرات CSS للألوان المستوحاة من اللوغو الجديد === */

:root {
  /* --- 1. الهوية اللونية الزرقاء الجديدة (المصدر الوحيد للحقيقة) --- */
  --brand-blue-dark: #206d8c; /* اللون الأساسي من شعارك (أزرق مخضر غامق) */
  --brand-blue-light: #4a9fc7; /* نسخة أفتح للتدرجات والخلفيات */
  --brand-accent-sky: #00aeef; /* لون مميز مشرق للأزرار والعناصر النشطة */
  --brand-accent-sky-light: #5ad3f2; /* نسخة أفتح من اللون المميز */

  /* --- 2. ربط المتغيرات القديمة بالجديدة لضمان التوافقية --- */
  /* أي عنصر قديم يستخدم هذه الأسماء سيحصل على الألوان الجديدة تلقائياً */
  --primary-teal: var(--brand-blue-dark);
  --primary-teal-light: var(--brand-blue-light);
  --accent-cyan: var(--brand-accent-sky);
  --accent-cyan-light: var(--brand-accent-sky-light);
  --wave-color: var(--brand-accent-sky);

  /* --- 3. إصلاح المتغيرات التي كانت تستخدم قيماً ثابتة --- */
  --bg-dark: var(--brand-blue-dark);
  --bg-gradient: linear-gradient(
    135deg,
    var(--brand-blue-dark) 0%,
    var(--brand-blue-light) 100%
  );

  /* --- 4. المتغيرات الأخرى التي لا تحتاج لتغيير --- */
  /* (هذه تبقى كما هي لأنها تخدم أغراضاً مختلفة) */
  --accent-blue: #0066cc;
  --accent-blue-light: #3399ff;
  --primary-blue: var(--accent-blue);
  --primary-blue-darker: #004c99;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-light: #ffffff;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --border-color: #e0e6e6;
  --link-footer: #b3d9d9;
  --hover-bg-light: #e6f3f3;
  --danger-red: #dc3545;
  --success-green: #28a745;
  --warning-orange: #ffc107;
  --shadow-light: 0 2px 10px rgba(32, 128, 140, 0.1); /* تعديل طفيف للون الظل ليتناسب */
  --shadow-medium: 0 4px 20px rgba(32, 128, 140, 0.15);
  --shadow-heavy: 0 8px 30px rgba(32, 128, 140, 0.2);
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-20: 20px;
  --radius-24: 24px;
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.18);
  /* --- !!! الإضافة الجديدة والمهمة هنا !!! --- */
  /* نفس الألوان ولكن بصيغة RGB لاستخدامها مع الشفافية */
  --brand-blue-dark-rgb: 32, 128, 140; /* هذه هي قيم RGB للون #20808C */
  --brand-blue-light-rgb: 51, 162, 179; /* هذه هي قيم RGB للون #33A2B3 */
}

/* ======================================================= */
/* === (الحل النهائي) منع التمرير الأفقي بشكل كامل === */
/* ======================================================= */

html,
body {
  /* 
   * overflow-x: hidden; هي القاعدة السحرية.
   * هي تخبر المتصفح "اقطع أي محتوى يتجاوز عرض الشاشة أفقياً
   * ولا تظهر شريط تمرير له أبداً".
  */
  overflow-x: hidden;

  /* 
   * هاتان القاعدتان إضافيتان للأمان.
   * تضمنان أن الصفحة نفسها لا تحاول أن تكون أعرض من الشاشة.
  */
  width: 100%;
  max-width: 100%;
}

/* سِمات الوضع الداكن */
[data-theme="dark"] {
  --bg-light: #0f1e1e;
  --bg-white: #122626;
  --text-primary: #eaf6f6; /* زيادة الوضوح */
  --text-secondary: #cfe5e5; /* تحسين التباين للنص الثانوي */
  --border-color: #2a4a4a; /* حدود أوضح في الوضع الداكن */
  --hover-bg-light: rgba(255, 255, 255, 0.05);
  --link-footer: #8fb9b9;
  --wave-color: #18c3c3;
  --team-card-bg: #2a3a4a; /* خلفية رمادية داكنة للبطاقة في الوضع الداكن */
  --team-card-text: #a8b2c0; /* لون نص الجامعة (فاتح) في الوضع الداكن */
  --team-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* ظل أغمق قليلاً */
}

/* === تنسيقات أساسية للـ Body === */
body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-light);
  direction: ltr;
  text-align: left;
  font-size: 15px;
}
/* 1. تطبيق خط Cairo على النص العام فقط */
body.rtl {
  font-family: "Cairo", sans-serif;
  font-weight: 400;
}

/* 2. التأكد من أن وسوم الأيقونات تستخدم خطها الصحيح (Font Awesome) */
/* هذه القاعدة تقول: لأي وسم <i> داخل body.rtl، لا تطبق خط Cairo */
body.rtl [class*="fa-"],
body.rtl .fab,
body.rtl .fas,
body.rtl .far {
  font-family: "Font Awesome 6 Brands", "Font Awesome 6 Free", sans-serif !important;
  font-weight: 900; /* الوزن الصحيح للأيقونات الصلبة والعلامات التجارية */
}
/* 3. تخصيص العناوين (يبقى كما هو) */
body.rtl h1,
body.rtl h2,
body.rtl h3 {
  font-family: "Cairo", sans-serif;
  font-weight: 700;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  background: var(--accent-cyan);
  color: #0b1414;
  border-radius: 8px;
  z-index: 3000;
}
::selection {
  background: rgba(24, 195, 195, 0.25);
  color: var(--text-primary);
}
::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.1);
}
:focus-visible {
  outline: 3px solid rgba(24, 195, 195, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

/* === تنسيق الـ Container للتوسيط === */
.container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === تنسيق أساسي للـ Header === */
header {
  background: var(--bg-gradient);
  padding: 1.5rem 0;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-medium);
  transition: padding 0.25s ease, box-shadow 0.25s ease, background 0.25s ease,
    backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
}
/* تنسيق الشعار النصي الجديد */
.site-title {
  font-size: 1.5rem; /* يمكنك تعديل الحجم */
  font-weight: 800;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 1px;
}

/* شريط تمييز سفلي خفيف يعزز الفصل البصري للرأس */
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-cyan),
    transparent
  );
  opacity: 0.4;
  pointer-events: none;
}

header .container {
  display: flex;
  justify-content: flex-start; /* كل العناصر تبدأ من اليسار */
  align-items: center;
  direction: ltr;
  /* اجعل حاوية الرأس تملأ العرض وتبدأ من اليسار بدون هوامش */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 0 2rem;
}

/* مسافة موحدة بين عناصر الرأس */
header .container {
  gap: 1.5rem;
}

/* رأس مضغوط عند التمرير لتحسين استغلال الارتفاع */
header.is-shrunk {
  padding: 0.6rem 0;
  box-shadow: var(--shadow-sm);

  /* --- التعديل الرئيسي هنا --- */
  /* استخدمنا متغيرات الأزرق الجديدة مع تحديد الشفافية (alpha) */
  background: linear-gradient(
    135deg,
    rgba(var(--brand-blue-dark-rgb), 0.9) 0%,
    rgba(var(--brand-blue-light-rgb), 0.9) 100%
  );

  -webkit-backdrop-filter: saturate(120%) blur(8px);
  backdrop-filter: saturate(120%) blur(8px);
}

header.is-shrunk .site-logo {
  height: 40px;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.12));
}

/* تحسين خاص بالوضع الداكن عند التصغير */
[data-theme="dark"] header.is-shrunk {
  /* --- والتعديل هنا أيضاً للوضع الداكن --- */
  /* استخدمنا نسخة أغمق وأكثر شفافية قليلاً */
  background: linear-gradient(
    135deg,
    rgba(var(--brand-blue-dark-rgb), 0.85) 0%,
    rgba(var(--brand-blue-light-rgb), 0.8) 100%
  );
}
/* === تحسين منطقة اللوغو === */
header .logo-area a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 700;
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

/* ترتيب واضح للعناصر من اليسار إلى اليمين */
.logo-area {
  order: 0;
  margin-left: 1.5rem;
}
nav.main-nav {
  order: 1;
}
.theme-toggle {
  order: 2;
}
.language-switcher {
  order: 3;
}

header .logo-area a:hover {
  color: var(--accent-cyan);
  transform: scale(1.05);
}

.site-logo {
  height: 48px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}
.preloader-logo {
  display: block;
  margin: 0 auto 1rem auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
  width: 300px; /* يمكنك تغيير هذه القيمة */
  height: auto; /* اجعل الارتفاع تلقائياً ليحافظ على النسبة */
}
.sr-only {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* === تحسين التنقل === */
nav.main-nav {
  flex-grow: 1;
  margin: 0 2rem;
  display: flex;
  justify-content: center; /* اصطفاف عناصر القائمة إلى اليسار */
  min-width: 0; /* ✨✨ هذا هو السطر السحري الذي يسمح للعناصر بالتقلص عند الحاجة ✨✨ */
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

/* تقليل التباعد قليلاً على الشاشات المتوسطة لمنع تزاحم العناصر */
@media (max-width: 1280px) {
  nav.main-nav {
    margin: 0 1rem;
  }
  nav.main-nav ul {
    gap: 0.5rem;
  }
}

/* تفعيل القائمة الجانبية (الهامبرغر) مبكراً على الشاشات المتوسطة لمنع خروج أزرار اللغة خارج الحاوية */
@media (max-width: 1200px) {
  .nav-toggle {
    display: block;
  }
  header .container {
    flex-wrap: wrap;
  }
  /* تحويل القائمة إلى منسدلة أسفل الرأس كما في الهواتف */
  nav.main-nav.is-active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-gradient);
    padding: 1rem;
    box-shadow: var(--shadow-medium);
    visibility: visible;
  }
  nav.main-nav.is-active ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  nav.main-nav.is-active ul li a {
    justify-content: center;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
  }
}

/* مؤشّر تمييز سفلي للروابط على hover/الحالة النشطة */
nav.main-nav ul li a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-cyan),
    transparent
  );
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
  opacity: 0.9;
}
nav.main-nav ul li a:hover::after,
nav.main-nav ul li a.active::after {
  transform: scaleX(1);
}

[data-theme="dark"] .stat-label {
  color: rgba(255, 255, 255, 0.92);
}
[data-theme="dark"] footer a {
  color: var(--link-footer);
}

nav.main-nav ul li a:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

nav.main-nav ul li a.active {
  background: var(--accent-cyan);
  color: var(--text-light);
  box-shadow: var(--shadow-medium);
}

nav.main-nav ul li a i {
  font-size: 1.05rem; /* توحيد حجم الأيقونات */
  width: 1.25rem; /* عرض ثابت لموازنة المحاذاة */
  text-align: center;
  transition: transform 0.3s ease;
}

/* توحيد حجم نصوص العناصر داخل الروابط */
nav.main-nav ul li a span {
  font-size: 1rem;
  font-weight: 600;
}

nav.main-nav ul li a:hover i {
  transform: scale(1.2);
}

/* === تحسين مبدل اللغة === */
.language-switcher {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
  /* منع انكماش مبدّل اللغة حتى لا يخرج خارج الحاوية عند ضيق العرض */
  flex-shrink: 0;
}

.language-switcher button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.language-switcher button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.language-switcher button.active-lang {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  font-weight: bold;
  box-shadow: var(--shadow-light);
}

/* === تحسين زر الهامبرغر === */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-light);
  position: relative;
  transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-light);
  transition: all 0.3s ease;
}

.hamburger-icon::before {
  top: -8px;
}

.hamburger-icon::after {
  bottom: -8px;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* === تحسين المحتوى الرئيسي === */
main {
  padding: 3rem 0;
  min-height: calc(100vh - 200px);
}

main h1 {
  color: var(--primary-teal);
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary-teal), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

main > .container > h1 + p,
main > .container > p[data-key="home_intro"] {
  font-size: 1.25rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  line-height: 1.8;
}

/* === تحسين البطاقات === */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.team-member-card {
  background: var(--team-card-bg); /* استخدام متغير الخلفية */
  border-radius: var(--radius-20);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--team-card-shadow); /* استخدام متغير الظل */
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 800px;
}

/* تعديل لون الدور الوظيفي */

/* نستهدف كل النصوص (p) داخل معلومات البطاقة لتكون بنفس اللون الأساسي */
.team-member-info p {
  color: var(
    --team-card-text
  ) !important; /* ✨✨✨ استخدمنا !important لفرض اللون */
}

/* ثم نقوم بتخصيص كل عنصر على حدة */
.team-member-card .role {
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.team-member-card .affiliation {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 1; /* تأكد من أن الشفافية كاملة للجامعة */
}
.team-member-card .affiliation {
  color: var(--team-card-text); /* استخدام متغير لون النص الخاص بالبطاقة */
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.team-member-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-gradient);
}

.team-member-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--accent-cyan);
}

.team-member-photo img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 4px solid var(--accent-cyan);
  box-shadow: var(--shadow-light);
}

.team-member-info h3 {
  color: var(--primary-teal);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.team-member-info p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.team-member-info p em {
  color: var(--accent-cyan);
  font-style: normal;
  font-weight: 500;
}

.team-member-info p:last-child {
  margin-bottom: 1rem;
}

.team-member-info a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.team-member-info a:hover {
  color: var(--accent-cyan);
}

.theme-toggle button {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-right: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.theme-toggle button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* شريط تقدم التمرير */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  z-index: 2000;
}

/* === تحسين أزرار CTA === */
.cta-button {
  display: inline-block;
  background: var(--bg-gradient);
  color: var(--text-light);
  padding: 1rem 2rem;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-medium);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-heavy);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
}

.main-cta-button {
  display: block;
  width: fit-content;
  margin: 3rem auto;
  padding: 1.25rem 3rem;
  font-size: 1.3rem;
  text-align: center;
}

.magnetic {
  will-change: transform;
}

/* === تحسين الفوتر === */
footer {
  background: var(--bg-gradient);
  color: var(--text-light);
  text-align: center;
  padding: 3rem 0 2rem 0;
  margin-top: 4rem;
}

footer a {
  color: var(--link-footer);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--accent-cyan);
}

/* تحسين تخطيط الفوتر وروابطه */
footer .container {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}
footer p {
  margin: 0.15rem 0;
  opacity: 0.96;
}
footer p a {
  margin: 0 0.35rem;
}

/* === تحسينات RTL === */
body.rtl {
  direction: rtl;
  text-align: right;
}

body.rtl header .container {
  direction: ltr;
}

body.rtl header .logo-area {
  margin-left: auto;
  margin-right: 0;
}

body.rtl nav.main-nav ul {
  justify-content: flex-end;
}

body.rtl nav.main-nav ul li {
  margin-left: 0;
  margin-right: 1.5rem;
}

body.rtl .language-switcher {
  margin-right: 1rem;
  margin-left: 0;
}

body.rtl .language-switcher button {
  margin-left: 0;
  margin-right: 0.625rem;
}

body.rtl main > .container > h1 + p,
body.rtl main > .container > p[data-key="home_intro"] {
  text-align: center;
}

body.rtl .team-grid {
  direction: rtl;
}

body.rtl .team-member-card {
  text-align: center;
  direction: rtl;
}

body.rtl .team-member-info h3,
body.rtl .team-member-info p {
  text-align: center;
}

body.rtl footer {
  text-align: center;
}

/* === تحسينات الاستبيان === */
#questionnaire-module-placeholder {
  /* إزالة كل أنماط البطاقة */
  background-color: transparent; /* خلفية شفافة */
  border: none; /* بدون حدود */
  padding: 0; /* بدون هوامش داخلية */
  box-shadow: none; /* بدون ظل */
  border-radius: 0;
}

#progress-bar-container {
  margin-bottom: 2rem;
  background: var(--hover-bg-light);
  border-radius: 25px;
  overflow: hidden;
  height: 30px;
  box-shadow: var(--shadow-light);
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: var(--bg-gradient);
  text-align: center;
  line-height: 30px;
  color: white;
  font-weight: bold;
  transition: width 0.5s ease;
  border-radius: 25px;
}

#question-area .question-item {
  background: var(--bg-white);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  transition: all 0.3s ease;
}

#question-area .question-item:hover {
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-cyan);
}

#question-area .question-item:last-child {
  border-bottom: none;
  padding-bottom: 2rem;
  margin-bottom: 0;
}

#question-area label,
#question-area legend {
  color: var(--primary-teal);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: block;
}

#question-area input[type="text"],
#question-area input[type="email"],
#question-area input[type="number"],
#question-area select,
#question-area textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-white);
}

#question-area input[type="text"]:focus,
#question-area input[type="email"]:focus,
#question-area input[type="number"]:focus,
#question-area select:focus,
#question-area textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 179, 179, 0.1);
  transform: translateY(-1px);
}

#question-area .radio-option,
#question-area .checkbox-option {
  background: var(--bg-white);
  padding: 1rem 1.5rem;
  margin: 0.5rem 0;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#question-area .radio-option:hover,
#question-area .checkbox-option:hover {
  border-color: var(--accent-cyan);
  background: var(--hover-bg-light);
  transform: translateX(5px);
}

#question-area input[type="radio"],
#question-area input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

#question-area .radio-option label,
#question-area .checkbox-option label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

#question-area .other-specify-input {
  margin-top: 1rem;
  margin-left: 2.5rem;
  width: calc(100% - 2.5rem);
}

#question-area .validation-error,
#question-area #validation-message-area {
  color: var(--danger-red);
  font-weight: 500;
  margin-top: 0.5rem;
}

#validation-message-area {
  text-align: center;
  flex-grow: 1;
  margin: 0 1rem;
  min-height: 1.2em;
}

#navigation-buttons {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#navigation-buttons button {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 25px;
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 120px;
}

#navigation-buttons button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

#prev-button {
  background: var(--text-secondary);
  color: white;
}

#prev-button:not(:disabled):hover {
  background: #5a6268;
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

#next-button {
  background: var(--bg-gradient);
  color: white;
}

#next-button:not(:disabled):hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

#submit-button {
  background: var(--success-green);
  color: white;
}

#submit-button:not(:disabled):hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* === تحسينات رؤوس الأقسام === */
#question-area
  .question-item[data-question-id^="s"][data-question-id$="_header"]
  > div {
  background: var(--bg-gradient);
  color: var(--text-light);
  padding: 2rem;
  border-radius: 15px;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

#question-area
  .question-item[data-question-id^="s"][data-question-id$="_header"]
  > div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

#question-area
  .question-item[data-question-id^="s"][data-question-id$="_header"]
  h3 {
  color: var(--text-light);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

#question-area
  .question-item[data-question-id^="s"][data-question-id$="_header"]
  hr {
  border: none;
  height: 2px;
  background: var(--accent-cyan);
  margin: 1rem auto;
  width: 60px;
  border-radius: 1px;
}

#question-area
  .question-item[data-question-id^="s"][data-question-id$="_header"]
  p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1.6;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* === تحسينات الترحيب === */
#question-area .question-item[data-question-id="s0_welcome"] > div {
  background: var(--bg-gradient);
  color: var(--text-light);
  padding: 3rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-heavy);
}

#question-area .question-item[data-question-id="s0_welcome"] {
  border: none;
  background: transparent;
  box-shadow: none;
}

#question-area .likert-option {
  flex: 1;
  min-width: 120px;
  background: var(--bg-white);
  padding: 1rem;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#question-area .likert-option::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-cyan);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

#question-area .likert-option:hover::before {
  transform: scaleX(1);
}

#question-area .likert-option label {
  margin: 0;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  display: block;
}

#question-area .likert-option input[type="radio"] {
  display: none;
}

#question-area .likert-option:hover {
  border-color: var(--accent-cyan);
  background: var(--hover-bg-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

/* === تحسينات Preloader === */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
  color: var(--text-light);
  align-items: center;
}

.preloader-content p {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  animation: fadeInText 1s ease-in;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

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

/* === تحسينات إضافية === */
body:not(.preloader-done) header,
body:not(.preloader-done) main,
body:not(.preloader-done) footer {
  opacity: 0;
  transition: opacity 0.5s ease;
}

body.preloader-done header,
body.preloader-done main,
body.preloader-done footer {
  opacity: 1;
}

/* خلفية زخرفية خفيفة لجميع الصفحات لإحساس أكثر حداثة */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(
      600px 400px at 10% 10%,
      rgba(0, 179, 179, 0.08),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at 90% 30%,
      rgba(0, 102, 204, 0.08),
      transparent 60%
    );
}

[data-theme="dark"] body::before {
  background: radial-gradient(
      600px 400px at 10% 10%,
      rgba(24, 195, 195, 0.14),
      transparent 60%
    ),
    radial-gradient(
      800px 500px at 90% 30%,
      rgba(51, 153, 255, 0.12),
      transparent 60%
    );
}

/* === تحسينات الاتصال === */
.contact-section-card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 2.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
  text-align: center;
}

.contact-section-card h2 {
  color: var(--primary-teal);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.contact-section-card p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.pi-details-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.principal-investigator-section .researcher-photo h3 {
  color: var(--primary-teal);
  font-size: 1.25rem;
  margin-top: 1rem;
  font-weight: 600;
}

/* صورة الباحث في صفحة الاتصال */
.principal-investigator-section .researcher-photo img {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-cyan);
  box-shadow: var(--shadow-light);
}

/* عرض البريد الإلكتروني بشكل مقروء */
.email-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  background-color: var(--hover-bg-light);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  word-break: break-all;
}

/* ملاحظة خافتة */
.muted-note {
  font-size: 0.95rem;
  color: var(--text-secondary);
  opacity: 0.9;
}

main > .container > h1[data-key="contact_h1"] {
  margin-bottom: 3rem;
}

/* === تحسينات RTL للاستبيان === */
body.rtl .principal-investigator-section {
  direction: rtl;
}

body.rtl .study-contact-details {
  text-align: right;
}

body.rtl #question-area input[type="radio"],
body.rtl #question-area input[type="checkbox"] {
  margin-right: 0;
  margin-left: 10px;
}

body.rtl #question-area .other-specify-input {
  margin-left: 0;
  margin-right: 2.5rem;
}

body.rtl #question-area label,
body.rtl #question-area .radio-option label,
body.rtl #question-area .checkbox-option label,
body.rtl #question-area .likert-option label,
body.rtl #question-area legend {
  text-align: right;
}

/* === أخلاقيات البحث والموافقة === */
.consent-section {
  margin-bottom: 1.5rem;
}
.consent-section h2 {
  color: var(--primary-teal);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.consent-form-area {
  margin-top: 2.5rem;
}
.consent-form-area label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  line-height: 1.7;
}
.consent-form-area input[type="checkbox"] {
  margin-top: 4px;
  transform: scale(1.1);
  cursor: pointer;
}

.proceed-button {
  display: inline-block;
  margin-top: 1rem;
}
.proceed-button[disabled] {
  background: #ccc !important;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

body.rtl .consent-form-area input[type="checkbox"] {
  margin-right: 0;
  margin-left: 10px;
}
body.rtl .consent-form-area label {
  text-align: right;
}

/* === تحسينات الخريطة === */
#map {
  border-radius: 20px;
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  height: clamp(360px, 45vh, 520px);
  width: 100%;
  margin: 2rem 0;
  position: relative;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* موجة فاصلة بين الأقسام */
.section-wave {
  color: var(--wave-color);
}
.section-wave svg {
  display: block;
  width: 100%;
  height: 80px;
}
.section-wave[data-parallax] {
  will-change: transform;
}

/* skeleton shimmer */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #e6ecec;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
.img-wrap {
  border-radius: 50%;
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
}
.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* reveal animation utility */
.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.6s cubic-bezier(0.2, 0.65, 0.2, 1), opacity 0.6s;
}
.reveal.animate-in {
  opacity: 1;
  transform: none;
}

/* --- (إعادة هيكلة) أنماط قائمة التنقل الرئيسية --- */

/* 1. القاعدة الأساسية لروابط التنقل */
nav.main-nav ul li a {
  /* --- الخصائص الأساسية --- */
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap; /* يمنع التفاف النص داخل الزر */
  transition: all 0.3s ease;

  /* --- الأبعاد والهوامش المرنة (الحل للمشكلة) --- */
  display: inline-flex; /* يسمح بالتحكم في المحاذاة والـ gap */
  align-items: center; /* توسيط الأيقونة والنص عمودياً */
  padding: 0.8rem 1.2rem; /* هوامش داخلية مرنة (أقل من السابق) */
  border-radius: 99px; /* حواف دائرية كاملة */
  font-size: 0.95rem; /* حجم خط أصغر قليلاً */

  /* --- المظهر الزجاجي (Glassmorphism) --- */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);

  /* --- الألوان الافتراضية (الوضع الفاتح) --- */
  color: var(--text-light, #333); /* استخدام متغير إذا وجد، مع قيمة احتياطية */
  --team-card-bg: #ffffff; /* خلفية بيضاء للبطاقة في الوضع الفاتح */
  --team-card-text: #555; /* لون نص الجامعة في الوضع الفاتح */
  --team-card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* ظل خفيف */
}

/* 2. حالة مرور الماوس (Hover) */
nav.main-nav ul li a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* 3. حالة الرابط النشط (Active) */
nav.main-nav ul li a.active {
  background: var(--primary-color, #18c3c3);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 195, 195, 0.4);
}

/* 4. تخصيص الوضع المظلم (Dark Mode) */
[data-theme="dark"] nav.main-nav ul li a {
  color: #eaf6f6;
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] nav.main-nav ul li a:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* 5. حالة الهيدر المتقلص (Shrunk Header) */
header.is-shrunk nav.main-nav ul li a {
  font-size: 0.85rem; /* تصغير الخط أكثر قليلاً */
  padding: 0.5rem 0.9rem; /* تصغير الهوامش أكثر قليلاً */
}

/* 6. استجابة للشاشات الصغيرة (مثلاً، داخل قائمة الهامبرغر) */
@media (max-width: 768px) {
  nav.main-nav ul li a {
    width: 100%; /* جعل الزر يملأ عرض القائمة */
    justify-content: center; /* توسيط المحتوى */
    padding: 1rem; /* إعادة الهوامش لتكون أكبر وسهلة النقر */
    font-size: 1rem; /* إرجاع حجم الخط لوضعه الطبيعي */
  }
}
/* === >> أنماط قائمة الهامبرغر والاستجابة << === */

/* افتراضياً، زر الهامبرغر مخفي على الشاشات الكبيرة */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001; /* ليكون فوق القائمة */
}

/* عندما تصغر الشاشة (مثلاً أقل من 1100px)، أظهر زر الهامبرغر */
@media (max-width: 1100px) {
  .nav-toggle {
    display: block;
  }

  /* أخفِ القائمة الرئيسية وحولها إلى قائمة منسدلة عمودية */
  nav.main-nav {
    display: none; /* ابدأها مخفية */
    position: absolute;
    top: 100%; /* ابدأ من تحت الهيدر */
    left: 0;
    width: 100%;
    padding: 1rem;
    background: var(--bg-gradient); /* استخدم نفس خلفية الهيدر */
    box-shadow: var(--shadow-medium);

    /* هذا الجزء مهم للتحريك */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* --- >> هذا هو الكود السحري المفقود << --- */
  /* عندما يتم إضافة كلاس .is-active، أظهر القائمة */
  nav.main-nav.is-active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  /* --- >> نهاية الكود السحري << --- */

  nav.main-nav ul {
    flex-direction: column; /* اجعل الروابط عمودية */
    align-items: center;
    gap: 1rem;
  }

  /* تعديل لضمان أن العناصر الإضافية تنتقل لليسار بشكل صحيح */
  .header-actions {
    margin-left: auto; /* ادفعها إلى أقصى اليمين */
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* === تحسينات الاستجابة === */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  nav.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-gradient);
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
  }

  nav.main-nav.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  nav.main-nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  nav.main-nav ul li:last-child a {
    margin-bottom: 0;
  }

  nav.main-nav ul li a.active {
    background: var(--accent-cyan);
  }

  nav.main-nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* تعديل لضمان أن العناصر الإضافية تنتقل لليسار بشكل صحيح */
  .header-actions {
    margin-left: auto; /* ادفعها إلى أقصى اليمين */
  }

  /* تفعيل ضبابية الرأس وخلفية شفافة أعلى الصفحة على الشاشات الصغيرة لتحسين القراءة فوق الصور/التدرجات */
  header {
    background: linear-gradient(
      135deg,
      rgba(26, 77, 77, 0.88) 0%,
      rgba(45, 122, 122, 0.88) 100%
    );
    -webkit-backdrop-filter: saturate(120%) blur(8px);
    backdrop-filter: saturate(120%) blur(8px);
  }

  .language-switcher {
    margin-left: 0;
    margin-right: 1rem;
  }

  header .container {
    flex-wrap: wrap;
  }

  main h1 {
    font-size: 2.5rem;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  #questionnaire-module-placeholder {
    padding: 0rem;
  }

  #navigation-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  #validation-message-area {
    margin: 0;
  }

  #navigation-buttons button {
    width: 100%;
    max-width: 300px;
  }

  #question-area fieldset .likert-options-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  #question-area .likert-option {
    min-width: auto;
    width: 100%;
  }

  .container {
    padding: 0 1.5rem;
  }

  header {
    padding: 1rem 0;
  }

  main {
    padding: 2rem 0;
  }

  .main-cta-button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  main h1 {
    font-size: 2rem;
  }

  .team-member-card {
    padding: 1.5rem;
  }

  .contact-section-card {
    padding: 1.5rem;
  }

  .pi-details-container {
    flex-direction: column;
    text-align: center;
  }
}

/* === تحسينات اللوغو الجديد === */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.logo-main {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 2px;
  position: relative;
}

.logo-main::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 8px;
  z-index: -1;
  opacity: 0.3;
}

.logo-subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 1px;
  opacity: 0.9;
}

/* === تحسينات Preloader === */
.logo-animation {
  margin-bottom: 3rem;
  text-align: center;
  animation: fadeIn 1s ease-out;
}

.logo-animation .logo-text {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 1rem;
  animation: logoGlow 2s ease-in-out infinite alternate;
  text-shadow: 0 0 30px rgba(0, 179, 179, 0.6);
  letter-spacing: 4px;
  font-family: "Inter", sans-serif;
  position: relative;
}

.logo-animation .logo-text::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 15px;
  z-index: -1;
  opacity: 0.2;
  filter: blur(10px);
}

.logo-animation .logo-subtitle {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 3px;
  opacity: 0.9;
  animation: fadeInUp 1s ease-out 0.8s both;
  font-family: "Inter", sans-serif;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes logoGlow {
  from {
    text-shadow: 0 0 30px rgba(0, 179, 179, 0.6);
    transform: scale(1) rotate(0deg);
  }
  to {
    text-shadow: 0 0 50px rgba(0, 179, 179, 0.9),
      0 0 60px rgba(0, 179, 179, 0.5);
    transform: scale(1.1) rotate(1deg);
  }
}

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

/* === تحسينات إضافية للتصميم === */
.hero-section {
  position: relative;
  background: var(--bg-gradient);
  color: var(--text-light);
  padding: 6rem 0;
  margin: -3rem 0 4rem 0;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, var(--bg-light), transparent);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: screen;
}

.hero-content h1 {
  color: var(--text-light);
  font-size: 4.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, var(--text-light), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: "Inter", sans-serif;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.5rem;
  margin-bottom: 3rem;
  opacity: 0.95;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
  font-weight: 400;
}

/* === تحسينات إضافية للإحصائيات === */
.stats-section {
  padding: 5rem 0;
  background: var(--bg-gradient);
  margin: 3rem 0;
  border-radius: 25px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
}

.stats-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
  opacity: 0.3;
}

.stats-section h2 {
  position: relative;
  z-index: 2;
  color: var(--text-light);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 3rem;
}

.stats-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin: 4rem 0;
  direction: ltr;
}
.stats-grid .stat-card {
  direction: rtl;
}
body:not(.rtl) .stats-grid .stat-card {
  direction: ltr;
}

.stat-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-20);
  padding: 3rem;
  text-align: center;
  color: var(--text-light);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  transform-style: preserve-3d;
  perspective: 800px;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.8s ease;
}

.stat-card:hover::before {
  left: 100%;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: countUp 2.5s ease-out;
  font-family: "Inter", sans-serif;
}

.stat-label {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 600;
  letter-spacing: 1px;
}

/* === تحسينات إضافية للمميزات === */
.features-section {
  padding: 6rem 0;
  background: var(--bg-light);
  position: relative;
}

.features-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, var(--bg-light), transparent);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 3rem;
  margin: 5rem 0;
}

.feature-card {
  background: var(--bg-white);
  padding: 3.5rem;
  border-radius: 30px;
  text-align: center;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--bg-gradient);
}

.feature-card:hover {
  transform: translateY(-20px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--accent-cyan);
}

.feature-icon {
  width: 120px;
  height: 120px;
  background: var(--bg-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2.5rem auto;
  color: var(--text-light);
  font-size: 3rem;
  transition: all 0.4s ease;
  box-shadow: var(--shadow-medium);
}

.feature-card:hover .feature-icon {
  transform: scale(1.15) rotate(8deg);
  box-shadow: var(--shadow-heavy);
}

.feature-card h3 {
  color: var(--primary-teal);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-family: "Inter", sans-serif;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1.2rem;
}

/* === تحسينات إضافية للخريطة === */
.map-section {
  padding: 5rem 0;
  text-align: center;
}

.map-section h2 {
  color: var(--primary-teal);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 4rem;
  position: relative;
  font-family: "Inter", sans-serif;
}

.map-section h2::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 5px;
  background: var(--bg-gradient);
  border-radius: 3px;
}

#map {
  border-radius: 30px;
  box-shadow: var(--shadow-heavy);
  overflow: hidden;
  border: 4px solid var(--accent-cyan);
  transition: all 0.3s ease;
}

#map:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 60px rgba(26, 77, 77, 0.3);
}

/* Tooltip مخصص لمناطق الخريطة */
.leaflet-tooltip.region-tooltip {
  background: rgba(26, 77, 77, 0.95);
  color: var(--text-light);
  border: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.95em;
  white-space: nowrap;
  font-weight: 600;
  backdrop-filter: blur(10px);
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
  border: none !important;
  content: none !important;
}

/* === تحسينات إضافية للتصميم === */
.main-content {
  padding: 5rem 0;
}

.main-content p[data-key="home_intro"] {
  font-size: 1.4rem;
  line-height: 1.9;
  color: var(--text-secondary);
  max-width: 1100px;
  margin: 0 auto 5rem auto;
  text-align: center;
  font-weight: 400;
}

/* === تحسينات إضافية للاستجابة === */
@media (max-width: 768px) {
  .logo-main {
    font-size: 1.8rem;
  }

  .logo-subtitle {
    font-size: 0.6rem;
  }

  .hero-content h1 {
    font-size: 2.8rem;
  }

  .hero-content p {
    font-size: 1.2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .feature-card {
    padding: 2.5rem;
  }

  .stat-card {
    padding: 2.5rem;
  }

  .stat-number {
    font-size: 3rem;
  }

  .logo-animation .logo-text {
    font-size: 3.5rem;
  }

  .logo-animation .logo-subtitle {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2.2rem;
  }

  .logo-animation .logo-text {
    font-size: 3rem;
  }

  .logo-animation .logo-subtitle {
    font-size: 1rem;
  }

  .stats-section h2 {
    font-size: 2.5rem;
  }

  .map-section h2 {
    font-size: 2.5rem;
  }

  .feature-card h3 {
    font-size: 1.8rem;
  }
}

/* === إضافات جمالية واحترافية عامة (قابلة لإعادة الاستخدام) === */
/* عناوين أقسام موحّدة */
.section-title {
  color: var(--primary-teal);
  font-size: 2.4rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 2rem 0;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 88px;
  height: 5px;
  background: var(--bg-gradient);
  margin: 0.75rem auto 0;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.6s ease;
}
.section-title.in-view::after {
  transform: scaleX(1);
}

/* نص منسق لصفحات المحتوى */
.content-prose {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text-primary);
}
.content-prose p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.content-prose ul,
.content-prose ol {
  padding-inline-start: 1.25rem;
  margin-bottom: 1rem;
}
body.rtl .content-prose ul,
body.rtl .content-prose ol {
  padding-inline-start: 0;
  padding-inline-end: 1.25rem;
}
.content-prose h2 {
  color: var(--primary-teal);
  font-size: 2rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}
.content-prose h3 {
  color: var(--primary-teal);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
}

/* أقسام عامة قابلة لإعادة الاستخدام */
.about-section {
  margin-bottom: 2.5rem;
}

/* كروت زجاجية عامة يمكن إعادة استخدامها */
.glass-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-20);
  box-shadow: var(--shadow-light);
  padding: 1.5rem;
}
[data-theme="dark"] .glass-card {
  background: rgba(18, 38, 38, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

/* تأثير خط سفلي متدرّج للروابط */
a.gradient-underline {
  text-decoration: none;
  background-image: linear-gradient(
    90deg,
    var(--accent-cyan),
    var(--accent-blue)
  );
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size 0.3s ease;
}
a.gradient-underline:hover {
  background-size: 100% 2px;
}

/* أزرار إضافية */
.btn-outline {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 40px;
  border: 2px solid var(--accent-cyan);
  color: var(--primary-teal);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.btn-outline:hover {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--text-light);
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-block;
  padding: 0.85rem 1.25rem;
  border-radius: 40px;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-decoration: none;
  transition: all 0.3s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--accent-cyan);
}

/* تأثير Ripple على أزرار CTA */
.cta-button {
  position: relative;
  overflow: hidden;
}
.cta-button .ripple {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple {
  to {
    transform: translate(-50%, -50%) scale(14);
    opacity: 0;
  }
}

/* فاصل ناعم عام */
hr.soft-divider {
  margin: 40px auto;
  border: 0;
  height: 1px;
  width: 80%;
  background-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0)
  );
}

/* === FAQ (الأسئلة الشائعة) === */
.faq-list {
  margin-top: 2rem;
  max-width: 900px;
  margin-inline: auto;
}
.faq-item details {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-light);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.faq-item details:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}
.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  color: var(--primary-teal);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  min-height: 75px !important;
}
.faq-item summary:hover {
  color: var(--accent-cyan);
}
.faq-item details[open] summary {
  border-bottom: 1px solid var(--border-color);
  background: var(--hover-bg-light);
}
.faq-item summary::before {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
  color: var(--accent-cyan);
}
.faq-item details[open] summary::before {
  content: "−";
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-answer {
  padding: 0.75rem 1.25rem 1.25rem;
  color: var(--text-primary);
  line-height: 1.8;
}
body.rtl .faq-item summary::before {
  right: auto;
  left: 1rem;
}
body.rtl .faq-item summary {
  padding-left: 1.25rem;
  padding-right: 2.75rem;
}
body.rtl .faq-answer {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* نمط نماذج عامة لصفحة الانضمام وغيرها */
.form-card {
  margin-top: 1.5rem;
}
.form-row {
  margin-bottom: 1rem;
}
.form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-teal);
}
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="url"],
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-white);
  transition: all 0.25s ease;
  font-size: 1rem;
}
.form-card input[type="text"]:focus,
.form-card input[type="email"]:focus,
.form-card input[type="url"]:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 179, 179, 0.1);
  transform: translateY(-1px);
}
.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  transform: scale(1.2);
  accent-color: var(--accent-cyan);
}
body.rtl .checkbox-row input[type="checkbox"] {
  margin-left: 10px;
  margin-right: 0;
}
.message {
  margin-top: 1rem;
  font-weight: 700;
  display: none;
}
.message.info {
  color: var(--accent-blue);
}
.message.error {
  color: var(--danger-red);
}

/* تلميح تمرير في الـ Hero */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  gap: 6px;
  z-index: 3;
  opacity: 0.95;
  user-select: none;
}
.scroll-hint .chevron {
  font-size: 1.15rem;
  animation: bounceY 1.4s infinite;
}
.scroll-hint .label {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
}
@keyframes bounceY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
[data-theme="dark"] .scroll-hint {
  color: rgba(234, 246, 246, 0.92);
}

/* عناصر زخرفية عائمة لبارالاكس خفيف */
.parallax-blob {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 179, 179, 0.28),
    rgba(0, 102, 204, 0.18) 60%,
    transparent 70%
  );
  filter: blur(28px);
  opacity: 0.35;
  z-index: 1;
  pointer-events: none;
}
[data-theme="dark"] .parallax-blob {
  background: radial-gradient(
    ellipse at center,
    rgba(24, 195, 195, 0.32),
    rgba(51, 153, 255, 0.22) 60%,
    transparent 70%
  );
  opacity: 0.4;
}

/* مواضع مخصصة للبلوبات في الأقسام */
.stats-section .blob-stats-1 {
  top: -60px;
  left: -60px;
  width: 360px;
  height: 360px;
}
.stats-section .blob-stats-2 {
  bottom: -90px;
  right: -40px;
  width: 440px;
  height: 440px;
}

.features-section .blob-feat-1 {
  top: -70px;
  right: 10%;
  width: 300px;
  height: 300px;
}
.features-section .blob-feat-2 {
  bottom: -100px;
  left: 14%;
  width: 380px;
  height: 380px;
}

/* Blobات خاصة بالـ Hero والخريطة */
.hero-section .blob-hero-1 {
  top: 10%;
  left: -6%;
  width: 440px;
  height: 440px;
  opacity: 0.22;
}
.hero-section .blob-hero-2 {
  bottom: -12%;
  right: -6%;
  width: 520px;
  height: 520px;
  opacity: 0.2;
}
.hero-section .parallax-blob {
  z-index: 0;
}

.map-section {
  position: relative;
}
.map-section .blob-map-1 {
  top: -60px;
  left: 6%;
  width: 360px;
  height: 360px;
  opacity: 0.18;
}
.map-section .blob-map-2 {
  bottom: -80px;
  right: 8%;
  width: 420px;
  height: 420px;
  opacity: 0.18;
}

/* قوالب عامة لبلوبات صفحات المحتوى */
.page-section {
  position: relative;
}
.page-blob-1 {
  top: -40px;
  left: -60px;
  width: 320px;
  height: 320px;
  opacity: 0.16;
  z-index: 0;
}
.page-blob-2 {
  bottom: -60px;
  right: -40px;
  width: 360px;
  height: 360px;
  opacity: 0.16;
  z-index: 0;
}

@media (max-width: 768px) {
  .page-blob-1,
  .page-blob-2 {
    opacity: 0.12;
    filter: blur(24px);
  }
}

/* شركاؤنا */
.partners-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.partner-logo-placeholder {
  padding: 1rem 1.25rem;
  border: 2px dashed var(--border-color);
  border-radius: 14px;
  min-width: 160px;
  text-align: center;
  color: var(--text-secondary);
  background: var(--bg-white);
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.partner-logo-placeholder:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
  border-color: var(--accent-cyan);
}

/* صفحة تسجيل الدخول عبر تيليجرام */
.auth-center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}
.telegram-login-card {
  max-width: 560px;
  width: 100%;
  padding: 2rem;
  text-align: center;
}
.auth-logo {
  height: 56px;
  margin-bottom: 0.75rem;
}
.telegram-button {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.5rem 0 1.25rem 0;
  transform: scale(1.2);
  transform-origin: center;
}
@media (min-width: 768px) {
  .telegram-button {
    transform: scale(1.3);
  }
}

/* === >> أنماط نافذة النجاح المنبثقة (Success Modal) << === */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 15px;
  animation: fadeIn 0.3s ease-out;
}

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

.modal-content.success-card {
  background-color: var(--bg-white);
  padding: 35px 40px;
  border-radius: var(--radius-20);
  box-shadow: var(--shadow-heavy);
  width: 100%;
  max-width: 580px;
  text-align: center;
  border-top: 5px solid var(--success-green);
  animation: slideInUp 0.4s ease-out;
}

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

.modal-icon {
  margin-bottom: 1.25rem;
}

.modal-icon .fa-check-circle {
  font-size: 3.5rem;
  color: var(--success-green);
}

.modal-content h3 {
  font-size: 1.9rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.modal-content p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.modal-content .credentials-box {
  margin: 1.5rem 0;
  padding: 12px 15px;
  background-color: var(--hover-bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  word-break: break-all;
  font-size: 1rem;
  font-family: "Courier New", Courier, monospace;
}

.copy-btn-modal {
  /* inherits from .cta-button but we can override */
  padding: 12px 25px;
  font-size: 1.1em;
  margin-bottom: 1.5rem;
  min-width: 150px;
}

.modal-footer-note {
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.9;
  margin-top: 1rem;
  margin-bottom: 2rem;
}
/* تحسينات على خيارات الاستبيان متعددة الأسطر */
.radio-option label,
.checkbox-option label {
  display: inline-block; /* يسمح بتطبيق الهوامش والخصائص الأخرى بشكل أفضل */
  line-height: 1.4; /* تحسين تباعد الأسطر */
  vertical-align: middle; /* محاذاة النص مع زر الراديو */
}

.radio-option label small,
.checkbox-option label small {
  color: #555; /* لون أغمق قليلاً من النص العادي لتمييزه */
  font-size: 0.9em; /* حجم أصغر قليلاً */
  margin-top: 4px; /* مسافة صغيرة بين العنوان والوصف */
  display: block; /* يضمن أنه يأخذ السطر كاملاً */
}

/* تعديل خاص باللغة العربية لضمان محاذاة صحيحة */
body.rtl .radio-option input,
body.rtl .checkbox-option input {
  margin-left: 10px; /* إضافة هامش على يسار زر الراديو في الوضع العربي */
  margin-right: 0;
}

/* --- أنماط التحقق من صحة الإدخال (Validation) - النسخة النهائية --- */

/* 1. القاعدة الأساسية لتلوين الـ fieldset (المربع الداخلي) */
.question-item.invalid-question fieldset {
  /* هذا يجعل المربع كله أحمر */
  border: 2px solid var(--danger-red, #dc3545) !important; /* نستخدم !important للتغلب على أي قواعد أخرى */
  background-color: rgba(220, 53, 69, 0.05) !important; /* خلفية حمراء شفافة */

  /* الحفاظ على التنسيقات الأخرى */
  border-radius: 8px;
  padding: 1rem;
}

/* 2. تغيير لون نص السؤال (العنوان) لزيادة الوضوح */
.question-item.invalid-question legend {
  color: var(--danger-red, #dc3545);
  font-weight: bold;
}

/* 3. إزالة أي حدود غير مرغوب فيها من الحاوية الخارجية (.question-item) */
.question-item.invalid-question {
  border: none !important;
  background: none !important;
  padding: 0 !important;
}

/* --- أنماط صفحة فريق البحث (Team Page) --- */

/* حاوية جديدة لتوسيط العنوان بشكل صحيح في كل اللغات */
.team-section-header {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

/* عنوان القسم (Core Leadership, National Leaders) */
.team-section-title {
  text-align: center;
  font-size: 2rem;
  color: var(--primary-color-dark);
  border-bottom: 2px solid var(--primary-color-light);
  padding-bottom: 0.5rem;
  display: inline-block;
  /* تمت إزالة position, left, transform من هنا */
}

/* تعديلات على شبكة عرض الفريق */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* تمييز الفريق الأساسي */
.team-grid.core-team .team-member-card {
  border-left: 4px solid var(--primary-color);
  background: #fdfdfd;
}
/* تصميم بطاقة عضو الفريق */
.team-member-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  /* ✨✨✨ التعديلات الأساسية هنا ✨✨✨ */
  position: relative; /* 1. جعل البطاقة مرجعاً للموقع */
  padding-bottom: 5rem; /* 2. إضافة مساحة فارغة في الأسفل للأيقونة */
}

/* --- أنماط تفاصيل الأداء في بطاقة القائد --- */
.performance-details {
  border-top: 1px solid #f0f0f0;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  text-align: left; /* محاذاة النص لليسار/اليمين */
  opacity: 0; /* ✨ مخفي بشكل افتراضي */
  max-height: 0; /* ✨ ارتفاعه صفر بشكل افتراضي */
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* ✨ حالة التوسيع عند إضافة كلاس 'expanded' بواسطة JavaScript */
.team-member-card.expanded .performance-details {
  opacity: 1;
  max-height: 200px; /* ارتفاع كافٍ لإظهار المحتوى */
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.detail-label {
  color: #666;
}

.detail-value {
  font-weight: bold;
  color: var(--primary-color);
}

/* إضافة أيقونة للإشارة إلى قابلية التوسيع */
.team-member-card {
  cursor: pointer; /* تغيير شكل المؤشر للإشارة إلى قابلية النقر */
}

.team-member-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* حجم الصورة (يمكنك تعديله كما تريد) */
.team-member-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.2rem;
  border: 4px solid var(--primary-color-light);
}

.team-member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* (لا تغيير هنا) */
.team-member-info h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
}

/* (لا تغيير هنا) */
.team-member-info .role {
  font-weight: bold;
  color: var(--primary-color);
  margin: 0.25rem 0;
  /* اسمح بكسر السطر إذا كان النص طويلاً */
  white-space: normal;
}

/* (لا تغيير هنا) */
.team-member-info .affiliation {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.25rem;
}

/* 
 * ✨✨✨ تعديل جذري على روابط التواصل الاجتماعي ✨✨✨
*/
.social-links {
  position: absolute; /* 3. تحديد الموقع بشكل مطلق */
  bottom: 1.5rem; /* 4. تثبيتها في الأسفل */
  left: 0;
  right: 0;
  text-align: center;
}

.social-links a {
  color: #555;
  font-size: 1.8rem; /* تكبير الأيقونة قليلاً */
  transition: color 0.3s ease, transform 0.3s ease;
  display: inline-block;
}

.social-links a:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

/* تنسيق اسم الدولة والعلم (لا تغيير هنا) */
.name-country {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.country-flag {
  width: 24px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* --- أنماط أزرار الفلترة (لا تغيير هنا) --- */
.filter-buttons {
  text-align: center;
  margin-bottom: 2rem;
}

.filter-btn {
  background-color: #f1f1f1;
  border: none;
  padding: 10px 20px;
  margin: 5px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background-color: #ddd;
}

/* --- أنماط أزرار الفلترة --- */

.filter-btn {
  background-color: #f0f2f5; /* لون رمادي فاتح جداً للافتراضي */
  border: 2px solid transparent; /* حدود شفافة للحفاظ على الحجم */
  color: #333; /* لون نص داكن */
  padding: 10px 20px;
  margin: 5px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background-color: #e4e6eb; /* لون أغمق قليلاً عند المرور */
  border-color: #d1d5db;
}

/* ✨✨✨ هذا هو التعديل الأهم ✨✨✨ */
.filter-btn.active {
  background-color: var(
    --primary-color,
    #18c3c3
  ); /* استخدام اللون الرئيسي للموقع */
  color: white; /* نص أبيض ليكون واضحاً على الخلفية الزرقاء */
  border-color: var(
    --primary-color-dark,
    #14a2a2
  ); /* حدود أغمق قليلاً للتأكيد */
  box-shadow: 0 4px 12px rgba(24, 195, 195, 0.3); /* إضافة ظل ناعم */
}
/* --- أنماط الفوتر المحدثة (Footer Styles) --- */

footer {
  /* يمكنك إبقاء أنماط الفوتر الحالية كما هي (الخلفية، اللون، إلخ) */
  text-align: center; /* توسيط كل محتوى الفوتر */
}

.footer-links-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* للسماح بالالتفاف على الشاشات الصغيرة */
  gap: 10px; /* مسافة بين العناصر */
  margin-top: 0.5rem;
}

.footer-separator {
  color: var(--text-color-muted, #a0a0a0);
  display: inline-block;
}

.footer-social-icon {
  font-size: 1.6rem; /* حجم أكبر قليلاً للأيقونة */
  color: var(--text-color);
  transition: color 0.3s ease, transform 0.3s ease;
  margin-left: 15px; /* مسافة واضحة قبل أيقونة LinkedIn */
  display: inline-block; /* لتمكين التحويلات (transforms) */
}

.footer-social-icon:hover {
  color: var(--primary-color);
  transform: scale(1.1); /* تأثير تكبير بسيط عند المرور */
}

/* إخفاء الفواصل على الشاشات الصغيرة جداً إذا التف النص */
@media (max-width: 480px) {
  .footer-separator {
    display: none;
  }
  .footer-links-container {
    gap: 15px; /* زيادة المسافة قليلاً عند إخفاء الفواصل */
  }
}
/* --- تحسينات على الهيدر لضمان المرونة والتجاوب --- */

/* القاعدة الأساسية للهيدر */
header {
  /* 
    هذه القاعدة تضمن أن الهيدر يستخدم Flexbox للمحاذاة
    وتستبدل أي ارتفاع ثابت (height) بارتفاع أدنى (min-height) مع padding.
    مما يسمح له بالتمدد إذا كان المحتوى (مثل الروابط) يحتاج مساحة أكبر.
  */
  display: flex !important;
  align-items: center !important;
  height: auto !important; /* إلغاء أي ارتفاع ثابت قديم */
  min-height: 75px !important; /* تحديد ارتفاع أدنى كقيمة أساسية */
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* تعديل الهيدر عند التمرير (عندما يتقلص) */
header.is-shrunk {
  min-height: 60px; /* تحديد ارتفاع أدنى أقل قليلاً عند التمرير */
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/* 
  هذه القاعدة مهمة جداً: تضمن أن الحاوية الداخلية للهيدر 
  تتمدد بشكل صحيح لتتسع لكل العناصر (الشعار، الروابط، الأزرار).
*/
header .container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* ======================================================= */
/* === (إعادة كتابة كاملة) أنماط الهيدر النهائية V2 === */
/* ======================================================= */

/* --- القاعدة الأساسية للهيدر --- */
header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  width: 100% !important;
  background: var(--bg-gradient) !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  height: auto !important;
  min-height: 120px !important;
  padding: 0.5rem 0 !important;
}

header .container {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 1500px !important;
  margin: 0 auto !important;
  padding: 0 1.5rem !important;
}

/* --- الشعار --- */
.logo-area {
  flex-shrink: 0;
}
.site-logo {
  height: 45px;
  width: auto;
}

/* --- قائمة التنقل --- */
nav.main-nav {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}
nav.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}
nav.main-nav ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light, #fff);
  text-decoration: none;
  border-radius: 99px;
  transition: all 0.3s ease;
  white-space: nowrap;
}
nav.main-nav ul li a:hover {
  background: rgba(255, 255, 255, 0.15);
}
nav.main-nav ul li a.active {
  background: var(--accent-cyan, #00aeef);
  color: #ffffff;
}

/* --- الأزرار الإضافية --- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem; /* مسافة بين زر اللغة وزر السمة */
}

/* --- زر الهامبرغر --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.hamburger-icon {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-light);
  position: relative;
  transition: all 0.3s ease;
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-light);
  transition: all 0.3s ease;
  left: 0;
}
.hamburger-icon::before {
  top: -8px;
}
.hamburger-icon::after {
  bottom: -8px;
}
.nav-toggle[aria-expanded="true"] .hamburger-icon {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .hamburger-icon::before {
  transform: rotate(45deg);
  top: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger-icon::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* --- التصميم المتجاوب --- */
@media (max-width: 1200px) {
  nav.main-nav {
    display: none !important;
  }
  .nav-toggle {
    display: block !important;
    order: 3; /* يضع زر الهامبرغر في النهاية */
  }
  .header-actions {
    order: 2; /* يضع الأزرار قبله */
  }
  header .container {
    justify-content: space-between;
  }
  nav.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-gradient);
    padding: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
  nav.main-nav.is-active {
    display: block !important;
  }
  nav.main-nav ul {
    flex-direction: column;
  }
}
/* ============================================= */
/* === أنماط قائمة "More" المنسدلة === */
/* ============================================= */

/* تعديل بسيط على الحاوية الرئيسية للقائمة */
.main-nav ul.main-nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

/* حاوية عنصر "More" */
.nav-item-more {
  position: relative; /* مهم جداً لتحديد موضع القائمة المنسدلة */
}

/* تصميم زر "More" ليبدو مثل بقية الروابط */
.more-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light, #fff);
  text-decoration: none;
  border-radius: 99px;
  transition: all 0.3s ease;
  white-space: nowrap;
  background: transparent; /* بدون خلفية افتراضية */
  border: none;
  cursor: pointer;
  font-family: inherit; /* ليرث خط الموقع */
}

.more-button:hover,
.nav-item-more.active .more-button {
  background: rgba(255, 255, 255, 0.15);
}

/* أيقونة السهم الصغير */
.more-button .fa-chevron-down {
  font-size: 0.7em;
  transition: transform 0.3s ease;
}

/* تدوير السهم عند فتح القائمة */
.more-button[aria-expanded="true"] .fa-chevron-down {
  transform: rotate(180deg);
}

/* تصميم القائمة المنسدلة (مخفية افتراضياً) */
.dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;

  /* ✨✨ التعديلات الرئيسية هنا ✨✨ */
  background: var(
    --brand-blue-dark
  ); /* <-- استخدام لون الهيدر الداكن للخلفية */
  border: 1px solid rgba(255, 255, 255, 0.2); /* <-- حدود فاتحة لتحديد القائمة */

  border-radius: 12px;
  box-shadow: var(--shadow-heavy);
  list-style: none;
  padding: 0.5rem;
  margin: 0;
  min-width: 220px;
  z-index: 1100;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* إظهار القائمة عندما تكون نشطة */
.dropdown-menu.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* تصميم روابط القائمة المنسدلة */
.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1rem;

  /* ✨✨ تعديلات الألوان هنا ✨✨ */
  color: var(--text-light); /* <-- نص أبيض/فاتح بشكل افتراضي */

  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* تغيير لون الخلفية والنص عند مرور الماوس */
.dropdown-menu li a:hover {
  background-color: var(
    --accent-cyan
  ); /* <-- استخدام اللون المميز عند المرور */
  color: #ffffff; /* <-- التأكد من أن النص يبقى أبيض وواضح */
}
/* ============================================= */
/* === (إصلاح) أنماط الهيدر للغة العربية (RTL) === */
/* ============================================= */

/* هذه القاعدة سيتم تطبيقها فقط عندما يحتوي body على كلاس .rtl */
body.rtl header .container {
  /* 
      Flexbox ذكي. بدلاً من عكس كل عنصر على حدة،
      يمكننا ببساطة عكس اتجاه الحاوية الرئيسية نفسها.
      هذا سيجعل العناصر تتدفق من اليمين إلى اليسار بشكل صحيح.
    */
  flex-direction: row-reverse;
}

/* 
  لأننا عكسنا الاتجاه، قد نحتاج لتعديل بسيط في هوامش الشعار 
  للتأكد من وجود مسافة كافية من الحافة اليمنى.
*/
body.rtl .logo-area {
  margin-left: 0;
  margin-right: 1.5rem; /* أضف هامشاً على اليمين بدلاً من اليسار */
}
/* ========================================================= */
/* === (إضافة جديدة) أنماط محسنة لقائمة التنقل الرئيسية === */
/* ========================================================= */

/* القاعدة الأساسية للروابط داخل قائمة التنقل */
.main-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px; /* مسافة بين الأيقونة والنص */
  padding: 10px 15px;
  border-radius: 25px;
  transition: background-color 0.3s ease, color 0.3s ease;
  white-space: nowrap; /* يمنع تكسر النص لسطر جديد */
  text-decoration: none;
  font-weight: 600; /* جعل الخط أعرض قليلاً */
  color: var(--text-color);
}

/* تغيير المظهر عند مرور الماوس فوق أي رابط */
.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* تغيير مظهر الرابط النشط (للصفحة الحالية) */
.main-nav li.active > a,
.main-nav a.active {
  background-color: var(--primary-color, #18c3c3);
  color: white;
}

/* 
 * قاعدة خاصة باللغة العربية (RTL) لعكس ترتيب الأيقونة والنص.
 * ستعمل فقط عند التبديل إلى اللغة العربية.
*/
body.rtl .main-nav a {
  flex-direction: row-reverse;
}
/* ============================================= */
/* === (إصلاح نهائي) أنماط الهيدر للغة العربية (RTL) === */
/* ============================================= */

/* هذه القاعدة تعكس اتجاه حاوية الهيدر الرئيسية */
body.rtl header .container {
  flex-direction: row-reverse;
}

/* 
/* === >> الحل النهائي لمشكلة قائمة الموبايل العربية << === */

/* 1. القاعدة للشاشات الكبيرة فقط (Desktop) */
/* ستعمل فقط عندما يكون عرض الشاشة أكبر من 768px */
@media (min-width: 769px) {
  body.rtl .main-nav ul {
    flex-direction: row-reverse;
  }
}

/* 2. القاعدة للشاشات الصغيرة (Mobile) */
/* ستفرض الاتجاه العمودي عندما تكون الشاشة 768px أو أصغر */
@media (max-width: 768px) {
  body.rtl .main-nav.is-active ul {
    flex-direction: column; /* تأكد من أنها عمودية */
  }
}

/* 3. (مهم) تعديل القاعدة التي تعكس الأيقونة والنص */
/* يجب أن نتأكد أنها لا تتعارض مع قائمة الموبايل */

/* ابحث عن هذه القاعدة */
body.rtl .main-nav a {
  flex-direction: row-reverse;
}

/* واستبدلها بهذه */
@media (min-width: 769px) {
  body.rtl .main-nav a {
    flex-direction: row-reverse;
  }
}

/* هذه القاعدة تعكس ترتيب الأيقونة والنص داخل كل رابط */
body.rtl .main-nav a {
  flex-direction: row-reverse;
}

/* هذه القاعدة تعكس اتجاه القائمة المنسدلة */
body.rtl .nav-item-more .dropdown-menu {
  left: 0; /* تموضع القائمة لتبدأ من الحافة اليسرى لعنصر "المزيد" */
  right: auto; /* إلغاء التموضع من اليمين */
}

/* === >> أنماط اللوحة الجانبية (Side Panel) << === */

.side-panel {
  position: fixed; /* === >> الحل النهائي لمشكلة قائمة الموبايل العربية << === */

  /* 1. القاعدة للشاشات الكبيرة فقط (Desktop) */
  /* ستعمل فقط عندما يكون عرض الشاشة أكبر من 768px */
  @media (min-width: 769px) {
    body.rtl .main-nav ul {
      flex-direction: row-reverse;
    }
  }

  /* 2. القاعدة للشاشات الصغيرة (Mobile) */
  /* ستفرض الاتجاه العمودي عندما تكون الشاشة 768px أو أصغر */
  @media (max-width: 768px) {
    body.rtl .main-nav.is-active ul {
      flex-direction: column; /* تأكد من أنها عمودية */
    }
  }

  /* 3. (مهم) تعديل القاعدة التي تعكس الأيقونة والنص */
  /* يجب أن نتأكد أنها لا تتعارض مع قائمة الموبايل */

  /* ابحث عن هذه القاعدة */
  body.rtl .main-nav a {
    flex-direction: row-reverse;
  }

  /* واستبدلها بهذه */
  @media (min-width: 769px) {
    body.rtl .main-nav a {
      flex-direction: row-reverse;
    }
  }
  top: 0;
  right: -350px; /* ابدأ من خارج الشاشة */
  width: 300px;
  height: 100%;
  background: var(--bg-white);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  padding: 2rem;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow-y: auto;
}

.side-panel.open {
  right: 0; /* تحريكها لداخل الشاشة */
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s, visibility 0.4s;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.side-panel .close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.side-panel h2 {
  color: var(--primary-teal);
  margin-top: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.panel-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.panel-nav ul li a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.panel-nav ul li a:hover {
  background-color: var(--hover-bg-light);
  color: var(--primary-teal);
}

/* --- >> الإضافة هنا << --- */
.panel-nav ul li a.active {
  background-color: var(--accent-cyan);
  color: var(--text-light);
  font-weight: 700;
}

/* --- >> وأضف هذا أيضاً لزر More << --- */
.nav-more-btn.active {
  /* يمكنك اختيار أي نمط تريده، مثلاً جعله مضيئاً قليلاً */
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.nav-more-btn {
  /* تنسيق زر "More" ليبدو مثل باقي الروابط */
  background: none;
  border: none;
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.1rem;
  height: 48px;
}
.nav-more-btn i {
  transition: transform 0.3s;
}
.nav-more-btn.open i {
  transform: rotate(180deg);
}
/* === (إضافة جديدة) قائمة اللغات المنسدلة   === */
/* ============================================= */

.language-switcher-dropdown {
  position: relative;
}

.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.lang-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

.lang-switcher-btn .caret {
  font-size: 0.7em;
  transition: transform 0.3s ease;
}

.lang-switcher-btn[aria-expanded="true"] .caret {
  transform: rotate(180deg);
}

.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-white);
  border-radius: 12px;
  box-shadow: var(--shadow-heavy);
  list-style: none;
  padding: 0.5rem;
  margin: 0;
  min-width: 150px;
  z-index: 1100;
  border: 1px solid var(--border-color);

  /* Animation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.lang-switcher-menu.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher-menu li button {
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.lang-switcher-menu li button:hover {
  background-color: var(--hover-bg-light);
  color: var(--accent-cyan);
}

body.rtl .lang-switcher-menu li button {
  text-align: right;
}

/* Dark mode adjustments */
[data-theme="dark"] .lang-switcher-menu {
  background: #1a2f2f;
}
/* ======================================================= */
/* === أنماط مجموعة الأزرار العائمة (النهائية والموحدة) === */
/* ======================================================= */

/* 1. الحاوية الرئيسية للمجموعة */
.floating-action-buttons {
  position: fixed;
  /* ✨✨✨ التعديل هنا: وضعناه في اليسار بناءً على طلبك ✨✨✨ */
  left: 20px;
  bottom: 20px;
  z-index: 1500; /* استخدام z-index الأعلى لضمان ظهوره فوق كل شيء */
  display: flex;
  flex-direction: column-reverse; /* ✨✨✨ السحر هنا: هذا يضع الزر الثاني (toTop) في الأسفل والأول (theme-toggle) فوقه */
  align-items: center; /* توسيط الزرين أفقياً */
  gap: 12px; /* مسافة بين الزرين */
}

/* 2. الأنماط المشتركة للزرين (دمج من الكودين القديمين) */
.floating-action-buttons button {
  width: 48px; /* حجم موحد */
  height: 48px;
  border-radius: 50%;
  border: none;
  box-shadow: var(--shadow-medium);
  display: flex; /* استخدام flex لتوسيط الأيقونة بسهولة */
  justify-content: center;
  align-items: center;
  font-size: 1.1rem; /* حجم أيقونة موحد */
  cursor: pointer;
  transition: all 0.3s ease; /* تأثير انتقال موحد */
}

/* 3. تصميم خاص بكل زر */
#theme-toggle {
  background-color: var(--card-bg-color);
  color: var(--text-color);
}

#toTop {
  background: var(--bg-gradient);
  color: var(--text-light);
  /* إخفاءه مبدئياً */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

/* 4. تأثيرات الـ Hover */
#theme-toggle:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: var(--shadow-heavy);
  background-color: var(--accent-color);
  color: #fff;
}

#toTop:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: var(--shadow-heavy);
}

/* 5. حالة الظهور لزر "العودة للأعلى" */
#toTop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 6. تعديلات للشاشات الصغيرة */
@media (max-width: 768px) {
  .floating-action-buttons {
    left: 15px;
    bottom: 15px;
  }
  .floating-action-buttons button {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 768px) {
  /* 1. تصغير حجم خط الشعار النصي */
  .site-title {
    font-size: 1.2rem; /* <<-- القيمة الأصلية قد تكون 1.5rem أو أكثر، سنقوم بتصغيرها */
    /* يمكنك تجربة قيم مختلفة مثل 1.1rem أو 1.3rem لتجد الأنسب */
  }

  /* 2. (اختياري) تقليل المسافات قليلاً لتوفير مساحة أكبر */
  header .container .logo-area .site-title {
    font-size: 1.1rem; /* <<-- قمنا بتقليل الحجم أكثر للتأكد من رؤية الفرق */
  }
}
/* ======================================================= */
/* === إصلاحات شاشة التحميل (Preloader) للموبايل === */
/* ======================================================= */

/* نستهدف الشاشات التي عرضها 500px أو أقل */
@media (max-width: 500px) {
  /* 1. جعل الـ span يتصرف ككتلة لينزل لسطر جديد */
  .preloader-break {
    display: block;
  }

  /* 2. (اختياري) تعديل حجم الخط ليبدو أفضل على سطرين */
  #preloader p {
    font-size: 1.1rem; /* تصغير الخط قليلاً */
    line-height: 1.5; /* زيادة المسافة بين السطرين */
    max-width: 90%; /* منع النص من لمس حواف الشاشة الصغيرة */
  }
}
/* ======================================================= */
/* === إصلاح نهائي لمشكلة الإطار المزدوج في الاستبيان === */
/* ======================================================= */

/* 
 * نزيل الحدود والهوامش الافتراضية من عنصر fieldset
 * الذي يسبب ظهور الإطار الإضافي حول أسئلة الراديو والتشيك بوكس.
*/
.question-item fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
/* ================================================================= */
/* === (النسخة النهائية) تصميم مخصص فقط لسؤال المعدل الأكاديمي === */
/* ================================================================= */

/* 1. القاعدة الأساسية لحاوية الخيار في سؤال المعدل */
.question-item[data-question-id="s1q6_academic_average"] .radio-option {
  display: flex;
  align-items: center; /* توسيط عمودي لزر الراديو والنصوص */
  text-align: left;
  gap: 15px; /* مسافة بين زر الراديو وكتلة النص */
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* 2. تغيير مظهر الحاوية عند تحديد الخيار بداخلها */
/* عندما يتم تحديد input، يتغير تصميم .radio-option الأب */
.question-item[data-question-id="s1q6_academic_average"]
  .radio-option:has(input:checked) {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-color-light);
}

/* 3. تنسيق الـ label ليحتوي على النصوص بشكل عمودي */
.question-item[data-question-id="s1q6_academic_average"] .radio-option label {
  flex-grow: 1; /* اجعل الـ label يأخذ كل المساحة المتبقية */
}

/* 4. تنسيق النص الرئيسي (المعدل) */
.option-main {
  display: block; /* ✨✨✨ هذا السطر يجبر النص التالي على النزول لسطر جديد */
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 4px;
}

/* 5. تنسيق النص الفرعي (التوضيحي) */
.option-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--text-color-muted);
  line-height: 1.5;
}
/* ======================================================= */
/* === (إصلاح نهائي وكامل) القائمة المنسدلة للغات === */
/* ======================================================= */

/* 1. الحاوية الرئيسية للزر (لضمان التموضع الصحيح) */
.language-switcher-dropdown {
  position: relative;
}

/* 2. تصميم القائمة المنسدلة وهي مخفية (الحالة الافتراضية) */
.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 10px); /* تظهر تحت الزر بمسافة 10px */
  right: 0; /* افتراضياً، تبدأ من الحافة اليمنى (مناسب للكمبيوتر) */
  background-color: var(--card-bg-color, #fff);
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  width: 120px; /* عرض مناسب للقائمة */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease-in-out;
  z-index: 9990; /* قيمة عالية لضمان الظهور في الأعلى */
}

/* 3. تصميم القائمة عندما تكون ظاهرة (عند إضافة كلاس .is-active) */
.lang-switcher-menu.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 4. تصميم العناصر داخل القائمة */
.lang-switcher-menu li button {
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  text-align: left; /* أو right للعربية */
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.9rem;
}

body.rtl .lang-switcher-menu li button {
  text-align: right;
}

.lang-switcher-menu li button:hover {
  background-color: var(--primary-color-light);
}

/* 
 * 5. ✨✨✨ الحل السحري لمشكلة الموبايل ✨✨✨
 * نستهدف الشاشات الصغيرة التي تحدث فيها المشكلة.
*/
@media (max-width: 768px) {
  .lang-switcher-menu {
    right: auto !important;
    left: 0 !important;
  }
}
/* ================================================================= */
/* === (الحل النهائي والحاسم) تنسيق الاستبيان على الموبايل === */
/* ================================================================= */

/* نستهدف الشاشات التي عرضها 768px أو أقل */
@media (max-width: 768px) {
  /* --- الخطوة 1: تحرير الحاوية الرئيسية للاستبيان --- */
  /* 
   * هذا هو الجزء الأهم. نحن نجبر الحاوية التي تحمل الاستبيان
   * على التمدد وأخذ مساحة أكبر.
  */
  main .container {
    max-width: 100% !important; /* اسمح لها بالتمدد */
    padding: 0 0.25rem !important; /* أضف هوامش جانبية صغيرة فقط */
  }

  /* --- الخطوة 2: إزالة أي تنسيق غير مرغوب فيه من الغلاف الوسيط --- */
  #questionnaire-module-placeholder {
    padding: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
  }

  /* --- الخطوة 3: تصميم كل سؤال كبطاقة مستقلة --- */
  .question-item {
    background-color: var(--card-bg-color, #fff);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 0 0 1.5rem 0; /* هوامش صفر من الجوانب، وسفلية للفصل */
    border: 1px solid var(--border-color);
    box-sizing: border-box; /* خاصية مهمة جداً */
  }

  /* --- الخطوة 4: إصلاحات داخلية للأسئلة (كما كانت سابقاً) --- */

  /* إزالة حدود fieldset */
  .question-item fieldset {
    border: none;
    padding: 0;
    margin: 0;
  }

  /* تنسيق خيارات الراديو المعقدة (المعدل والمستوى) */
  .question-item[data-question-id="s1q4_study_level"] .radio-option,
  .question-item[data-question-id="s1q6_academic_average"] .radio-option {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 15px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    cursor: pointer;
  }
  .question-item[data-question-id="s1q4_study_level"] .radio-option label,
  .question-item[data-question-id="s1q6_academic_average"] .radio-option label {
    flex-grow: 1;
  }
  .option-main,
  .radio-option strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
  }
  .option-sub,
  .radio-option small {
    display: block;
    font-size: 0.85rem;
    color: var(--text-color-muted);
  }
}
/* ================================================================= */
/* === (الحل السريع) لإصلاح قائمة "المزيد" في العربية === */
/* ================================================================= */

/* 
 * نستخدم مُحدِّدات قوية لضمان تطبيق هذه القواعد.
*/

/* 1. الحالة الافتراضية للوحة وهي مخفية (في العربية) */
body.rtl .side-panel {
  transform: translateX(
    -105%
  ) !important; /* ندفعها بقوة إلى خارج الشاشة يساراً */
  left: 0 !important;
  right: auto !important;
  transition: transform 0.4s ease-out !important;
}

/* 2. الحالة النشطة للوحة وهي ظاهرة (في العربية) */
body.rtl .side-panel.open {
  transform: translateX(0) !important; /* نعيدها إلى موضعها الأصلي */
}

/* 3. إصلاح محتوى اللوحة الداخلي ليتناسب مع العربية */
body.rtl .side-panel .panel-nav a {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 1rem;
}
/* ======================================================= */
/* === (إصلاح نهائي v3) تصميم أسئلة ليكرت الموحد === */
/* ======================================================= */

/* 1. إخفاء زر الراديو الأصلي */
.likert-options-container input[type="radio"] {
  display: none !important;
}

/* 2. تصميم حاوية الأزرار (Desktop) */
.likert-options-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* 3. تصميم الزر (Label) في حالته الافتراضية */
.likert-options-container .likert-option-label {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  background-color: var(--card-bg-color, #fff);
  color: var(--text-color, #333);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-align: center;
}

/* 4. ✨✨✨ القاعدة الأهم والمعدلة ✨✨✨ */
/* عندما يتم تحديد الراديو، نغير لون الـ label الذي يليه */
.likert-options-container
  input[type="radio"]:checked
  + .likert-option-label.likert-option-label {
  background-color: var(--accent-color) !important;
  color: rgb(23, 131, 37) !important;
  border-color: var(--accent-color) !important;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(24, 195, 195, 0.4);
}

/* 5. تعديلات خاصة بشاشات الموبايل */
@media (max-width: 768px) {
  /* جعل الحاوية عمودية */
  .likert-options-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
}
/* =============================================== */
/* === أنماط أزرار اختيار اللغة في صفحة الاستبيان === */
/* =============================================== */

/* الحاوية الرئيسية للأزرار */
.language-selector-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem; /* مسافة صغيرة بين الأزرار */
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 50px; /* يجعل الحاوية بيضاوية */
  padding: 0.5rem;
  background-color: var(--card-bg, #ffffff);
  width: fit-content; /* يجعل عرض الحاوية مناسباً للمحتوى */
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* تصميم الزر العادي (غير نشط) */
.language-selector-buttons .lang-button {
  background-color: transparent;
  border: none;
  border-radius: 50px; /* يجعل الأزرار بيضاوية */
  padding: 0.5rem 1.25rem; /* تعديل الحشو ليعطي شكلاً أفضل */
  cursor: pointer;
  font-size: 0.95rem; /* تعديل حجم الخط قليلاً */
  font-weight: 600;
  color: var(--text-color-muted, #6c757d);
  transition: all 0.3s ease; /* حركة انتقال سلسة */
}

/* تصميم الزر عند مرور الماوس فوقه (غير نشط) */
.language-selector-buttons .lang-button:not(.active):hover {
  background-color: var(--background-color, #f8f9fa);
  color: var(--primary-color, #007bff);
}

/* تصميم الزر النشط (اللغة المختارة حالياً) */
.language-selector-buttons .lang-button.active {
  background-color: var(--primary-color, #007bff);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
}

/* إزالة الفواصل | (لم نعد بحاجة إليها) */
.language-selector-buttons span {
  display: none;
}
/* تنسيق شارات المناطق لتصبح صغيرة وفي الزاوية */
.team-grid.regional-team .team-member-card {
  position: relative; /* ضروري لتثبيت الشارة داخل البطاقة */
}

.region-badge {
  position: absolute; /* تحرير الشارة من التدفق العادي */
  top: 15px; /* المسافة من الأعلى */
  right: 15px; /* المسافة من اليمين (في العربية ستنقلب تلقائياً إذا كان الاتجاه مضبوطاً، أو يمكنك استخدام left للإنجليزية) */
  width: auto; /* العرض حسب النص فقط */
  padding: 5px 12px; /* حشوة داخلية */
  border-radius: 20px; /* حواف دائرية بالكامل */
  font-size: 0.7rem; /* خط صغير */
  font-weight: bold;
  color: #fff; /* لون النص أبيض */
  text-transform: uppercase; /* تحويل النص لأحرف كبيرة */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* ظل خفيف */
  z-index: 10; /* لضمان ظهورها فوق الصورة */
}

/* تحسين إضافي: إزاحة الصورة قليلاً للأسفل لكي لا تغطيها الشارة */
.team-grid.regional-team .team-member-photo {
  margin-top: 20px;
}
/* حاوية القائمة */
.dropdown-container {
  position: relative;
  display: inline-block;
}

/* محتوى القائمة (مخفي افتراضياً) */
.dropdown-content {
  display: none; /* مخفي */
  position: absolute;
  right: 0;
  top: 110%; /* يظهر تحت الزر مباشرة */
  background-color: #ffffff;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 1000;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

/* حالة الظهور */
.dropdown-content.show {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

/* روابط القائمة */
.dropdown-content a {
  color: #333;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.95rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* تأثير التمرير (Hover) */
.dropdown-content a:hover {
  background-color: #f1f3f5;
}

/* تأثير بسيط للظهور */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
