/* ============================================================
   سراج للعيون — شاشة الكشك التفاعلية
   ============================================================ */

/* ───── متغيرات الألوان ───── */
:root {
  --cream-50:  #FBF8F0;
  --cream-100: #F1ECDD;
  --cream-200: #EFEAD8;
  --cream-300: #E5DFC8;
  --cream-400: #C8C09F;

  --olive-300: #BDC093;
  --olive-500: #8B9560;
  --olive-600: #6B7045;
  --olive-700: #4A5A28;
  --olive-800: #366230;
  --olive-900: #232C0B;

  --gold:      #D4A845;

  --ink-900:   #1F1F1F;
  --ink-700:   #4A4A4A;
  --ink-500:   #7A7A6E;
  --ink-300:   #A8A89A;

  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
}

/* ───── ريسيت + تحسينات اللمس ───── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* منع التكبير العشوائي للمتصفح */
  touch-action: pan-x pan-y;
  overscroll-behavior: none;
}
body {
  font-family: 'Cairo', system-ui, sans-serif;
  background: var(--cream-100);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
/* تأكيد استخدام Cairo في كل العناصر */
body, body *, h1, h2, h3, h4, h5, h6, p, div, span, button, input, textarea, select, label {
  font-family: 'Cairo', system-ui, sans-serif !important;
}
/* استثناء: الأيقونات تحتاج خط Tabler */
.ti, [class^="ti-"], [class*=" ti-"] {
  font-family: 'tabler-icons' !important;
}
/* النص الإنجليزي للأمراض يستخدم نفس Cairo بحجم أصغر */
.disease-name-en {
  font-family: 'Cairo', system-ui, sans-serif !important;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

/* ───── الحاوية الرئيسية ───── */
.kiosk {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--cream-100);
  overflow: hidden;
}

/* ===============================================
   منطقة الخريطة (مع دعم الزوم)
   =============================================== */
.main-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.map-stage {
  position: relative;
  /* الحفاظ على نسبة 1080:1920 */
  width: min(100vw, calc(100vh * 1080 / 1920));
  height: min(100vh, calc(100vw * 1920 / 1080));
  transform-origin: 50% 50%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  /* نتعامل مع كل لمسة برمجياً */
  touch-action: none;
}
.map-stage.gesturing {
  transition: none;  /* أثناء السحب/التكبير لا نريد ترانزشن */
}

.map-bg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ───── هالة الوميض الذهبية حول عنوان الخريطة ───── */
.title-shimmer {
  position: absolute;
  top: 23%;        /* نزّلناها شوي */
  left: 8%;
  width: 84%;
  height: 11%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(212, 168, 69, 0.55) 0%,
    rgba(212, 168, 69, 0.22) 40%,
    transparent 75%
  );
  filter: blur(34px);
  animation: title-breathe 3.5s ease-in-out infinite;
  z-index: 1;
}
@keyframes title-breathe {
  0%, 100% { opacity: 0.35; transform: scale(0.94); }
  50%      { opacity: 1.00; transform: scale(1.06); }
}

/* ───── طبقة النقاط التفاعلية (SVG لدعم المضلعات) ───── */
.hotspots-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.hotspots-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hotspot {
  fill: transparent;
  stroke: transparent;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* hover فقط للأجهزة اللي عندها ماوس */
@media (hover: hover) and (pointer: fine) {
  .hotspot:hover {
    fill: rgba(54, 98, 48, 0.08);
  }
}

/* ───── تموّج (Ripple) عند اللمس ───── */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(54, 98, 48, 0.35);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-spread 0.7s ease-out forwards;
  z-index: 10;
}
@keyframes ripple-spread {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(8);   opacity: 0; }
}

/* ───── تلميح "المس محافظة" ───── */
.touch-hint {
  position: absolute;
  top: 3.5%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(54, 98, 48, 0.15);
  border-radius: 999px;
  color: var(--olive-700);
  font-size: 15px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  z-index: 5;
  animation: hintFloat 3s ease infinite;
}
.touch-hint i { font-size: 20px; }
.touch-hint.hidden { opacity: 0; transition: opacity 0.3s; }

@keyframes hintFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}

/* ───── مؤشر الزوم ───── */
.zoom-indicator {
  position: fixed;
  top: 32px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--olive-700);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  border: 1px solid rgba(54, 98, 48, 0.1);
}
.zoom-indicator.visible { opacity: 1; }
.zoom-indicator i { font-size: 16px; }

/* ───── زر إعادة الزوم ───── */
.zoom-reset {
  position: fixed;
  top: 32px;
  left: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--olive-700);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.1s;
  border: 1px solid rgba(54, 98, 48, 0.1);
  cursor: pointer;
}
.zoom-reset.visible { opacity: 1; pointer-events: auto; }
.zoom-reset:active { transform: scale(0.92); }
.zoom-reset i { font-size: 22px; }

/* ===============================================
   بطاقة المحافظة (Modal)
   =============================================== */
.region-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.region-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 44, 11, 0.55);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cream-50);
  border-radius: 40px 40px 0 0;
  padding: 32px 56px 56px;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0.2, 1);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.25);
  touch-action: pan-y;  /* السماح بالتمرير العمودي */
}
.region-modal.open .modal-panel {
  transform: translateY(0);
}

.modal-handle {
  width: 56px;
  height: 5px;
  background: var(--cream-400);
  border-radius: 3px;
  margin: 0 auto 32px;
}

.modal-close {
  position: absolute;
  top: 32px;
  left: 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cream-200);
  color: var(--olive-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.modal-close i { font-size: 28px; }
.modal-close:hover { background: var(--cream-300); }
.modal-close:active { transform: scale(0.95); }

/* رأس البطاقة */
.modal-region-header {
  text-align: center;
  margin-bottom: 36px;
}
.region-eyebrow {
  font-size: 18px;
  color: var(--olive-500);
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.region-name {
  font-size: 80px;
  font-weight: 800;
  color: var(--olive-800);
  letter-spacing: -2px;
  line-height: 1;
}

/* الصور */
.modal-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.region-image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: var(--cream-200);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s;
  border: 1px solid rgba(74, 90, 40, 0.1);
  touch-action: manipulation;
}
.region-image:active { transform: scale(0.97); }
@media (hover: hover) {
  .region-image:hover { transform: scale(1.02); }
}
.region-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── تسمية الصورة (Caption) — تظهر على الشريط الأخضر ─── */
.region-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px 16px;
  text-align: center;
  font-family: 'Cairo', system-ui, sans-serif;
  background: linear-gradient(to top,
    rgba(54, 98, 48, 0.96) 0%,
    rgba(54, 98, 48, 0.92) 70%,
    rgba(54, 98, 48, 0) 100%);
  color: #FFFFFF;
  z-index: 2;
  pointer-events: none;
}
.region-image-caption .caption-name {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #FBF8F0;
  line-height: 1.2;
}
.region-image-caption .caption-subtitle {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(251, 248, 240, 0.85);
  margin-top: 3px;
  letter-spacing: 0.2px;
}
.region-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--olive-500);
  background: linear-gradient(135deg, var(--cream-200), var(--cream-300));
  width: 100%;
  height: 100%;
  justify-content: center;
}
.region-image-placeholder i { font-size: 40px; }
.region-image-placeholder span { font-size: 14px; font-weight: 500; }
.region-image .zoom-hint {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--olive-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.region-image .zoom-hint i { font-size: 18px; }

/* الوصف */
.modal-description {
  font-size: 22px;
  line-height: 1.85;
  color: var(--ink-700);
  text-align: center;
  margin-bottom: 48px;
  padding: 0 32px;
  font-weight: 400;
}

/* رأس الإحصائيات */
.modal-stats-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
}
.modal-stats-header span {
  font-size: 22px;
  font-weight: 600;
  color: var(--olive-700);
  letter-spacing: 2px;
}
.modal-stats-line {
  flex: 0 0 48px;
  height: 1px;
  background: var(--olive-500);
  opacity: 0.4;
}

/* شبكة الإحصائيات */
.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.region-stat-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1px solid rgba(74, 90, 40, 0.08);
}
.region-stat-card .icon-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.region-stat-card .stat-icon-mini {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cream-200);
  color: var(--olive-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.region-stat-card .stat-icon-mini i { font-size: 22px; }
.region-stat-card .label {
  font-size: 17px;
  font-weight: 600;
  color: var(--olive-700);
  line-height: 1.4;
}

.region-stat-card .value {
  font-size: 52px;
  font-weight: 800;
  color: var(--olive-800);
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 12px;
}
.region-stat-card .value.placeholder {
  color: var(--cream-400);
  font-size: 52px;
  font-weight: 700;
}

.region-stat-card .source {
  font-size: 13px;
  color: var(--ink-500);
  font-weight: 400;
  line-height: 1.5;
  padding-top: 12px;
  border-top: 1px solid rgba(74, 90, 40, 0.08);
}
.region-stat-card .source strong {
  font-weight: 600;
  color: var(--ink-700);
  margin-left: 4px;
}

/* ===============================================
   Lightbox تكبير الصور
   =============================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 18, 5, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: var(--cream-50);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.lightbox-content > div {
  width: min(600px, 80vw);
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--cream-200), var(--cream-300));
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--olive-700);
}
.lightbox-content > div i { font-size: 80px; }
.lightbox-content > div span {
  font-family: 'Cairo', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
}
.lightbox-close {
  position: absolute;
  top: 32px;
  left: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  z-index: 210;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-close:active { transform: scale(0.92); }
.lightbox-close i { font-size: 30px; }

/* ───── حركات دخول بطاقات الإحصائيات ───── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.region-stat-card { animation: fadeUp 0.45s ease both; }
.region-stat-card:nth-child(1) { animation-delay: 0.05s; }
.region-stat-card:nth-child(2) { animation-delay: 0.12s; }
.region-stat-card:nth-child(3) { animation-delay: 0.19s; }
.region-stat-card:nth-child(4) { animation-delay: 0.26s; }
.region-stat-card:nth-child(5) { animation-delay: 0.33s; }
.region-stat-card:nth-child(6) { animation-delay: 0.40s; }

/* ═══════════════════════════════════════════════
   قسم الأمراض التي نطمح إلى علاجها
   ═══════════════════════════════════════════════ */
.modal-diseases-section {
  margin-top: 56px;
}

.modal-diseases-intro {
  text-align: center;
  font-size: 17px;
  color: var(--ink-500);
  line-height: 1.75;
  margin-bottom: 32px;
  padding: 0 24px;
  font-weight: 400;
}

.modal-diseases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.disease-card {
  background: linear-gradient(135deg, #F8F4E6 0%, #FBF8F0 100%);
  border-radius: 22px;
  padding: 22px 22px;
  border: 1px solid rgba(74, 90, 40, 0.10);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeUp 0.45s ease both;
}
.disease-card:nth-child(1) { animation-delay: 0.50s; }
.disease-card:nth-child(2) { animation-delay: 0.56s; }
.disease-card:nth-child(3) { animation-delay: 0.62s; }
.disease-card:nth-child(4) { animation-delay: 0.68s; }
.disease-card:nth-child(5) { animation-delay: 0.74s; }
.disease-card:nth-child(6) { animation-delay: 0.80s; }

.disease-card .disease-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.disease-card .disease-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--olive-700);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(74, 90, 40, 0.2);
}

.disease-card .disease-icon i {
  font-size: 24px;
}

.disease-card .disease-name-block {
  flex: 1;
  min-width: 0;
}

.disease-card .disease-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--olive-800);
  line-height: 1.25;
}

.disease-card .disease-name-en {
  font-size: 12px;
  color: var(--olive-500);
  font-weight: 500;
  margin-top: 3px;
  font-family: system-ui, sans-serif;
  letter-spacing: 0.3px;
}

.disease-card .disease-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-700);
  font-weight: 400;
}
