/* ═══════════════ VARIABLES ═══════════════ */
:root {
  --bg: #0B1220;
  --card: #121A2A;
  --card-hover: #1A2336;
  --text: #F3F4F6;
  --muted: #9CA3AF;
  --accent: #10B981;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --link: #2463EB;
  --border: #1F2937;
  --danger: #EF4444;
  --warning: #F59E0B;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --max-w: 1200px;
  --header-h: 64px;
  --font: 'Cairo', sans-serif;
}

/* ═══════════════ RESET ═══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
img { max-width: 100%; display: block; }
button, select, input { font-family: inherit; }

/* ═══════════════ SKIP LINK ═══════════════ */
.skip-link {
  position: absolute; top: -100px; right: 0; background: var(--accent); color: var(--bg);
  padding: 8px 20px; z-index: 9999; border-radius: 0 0 0 8px; font-weight: 700;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ═══════════════ UTILITY ═══════════════ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-sub { color: var(--muted); margin-bottom: 32px; font-size: 1rem; }

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius); font-weight: 700;
  font-size: 0.95rem; cursor: pointer; border: 2px solid transparent;
  transition: all .2s; text-decoration: none;
}
.btn-accent { background: var(--accent); color: var(--bg); }
.btn-accent:hover { background: #0DA271; transform: translateY(-1px); }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; border-radius: var(--radius-sm); background: var(--card); color: var(--text); border: 1px solid var(--border); cursor: pointer; }
.btn-sm:hover { border-color: var(--accent); }
.btn-cta {
  padding: 8px 20px; background: var(--accent); color: var(--bg); border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.85rem; white-space: nowrap; transition: all .2s;
}
.btn-cta:hover { background: #0DA271; }

/* ═══════════════ HEADER ═══════════════ */
#site-header {
  position: fixed; top: 0; right: 0; left: 0; height: var(--header-h); z-index: 100;
  background: rgba(11, 18, 32, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: 100%; gap: 16px;
}
.header-brand { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; }
.header-title { font-size: 1.15rem; font-weight: 900; color: var(--text); white-space: nowrap; }
.header-title .header-sub { color: var(--accent); font-weight: 700; }
.header-tag { font-size: 0.7rem; color: var(--muted); background: var(--card); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.header-controls { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.filter-group { display: flex; gap: 8px; }
.filter-group select, .search-box input {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: 0.82rem;
  outline: none; transition: border-color .2s;
}
.filter-group select:focus, .search-box input:focus { border-color: var(--accent); }
.search-box { position: relative; }
.search-box input { padding-left: 32px; width: 160px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mobile-menu-btn {
  display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px;
}
.mobile-menu-btn span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }

@media (max-width: 860px) {
  .header-controls { display: none; position: fixed; top: var(--header-h); right: 0; left: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 16px 20px; gap: 12px; z-index: 99; }
  .header-controls.open { display: flex; }
  .filter-group { width: 100%; }
  .filter-group select { flex: 1; }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .mobile-menu-btn { display: flex; }
}

/* ═══════════════ HERO ═══════════════ */
#hero {
  padding-top: calc(var(--header-h) + 40px);
  position: relative; overflow: hidden;
  min-height: 70vh; display: flex; align-items: center;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-badge {
  display: inline-block; background: var(--accent-dim); color: var(--accent);
  padding: 6px 16px; border-radius: 20px; font-size: 0.8rem; font-weight: 700;
  margin-bottom: 20px; letter-spacing: 0.5px;
}
.hero-title { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 900; line-height: 1.3; margin-bottom: 20px; }
.hero-desc { color: var(--muted); font-size: 1.05rem; line-height: 1.8; margin-bottom: 16px; }
.hero-desc strong { color: var(--text); }
.hero-proof {
  display: flex; align-items: center; gap: 8px; color: var(--accent);
  font-size: 0.9rem; font-weight: 600; margin-bottom: 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-gfx { position: absolute; left: -100px; top: 50%; transform: translateY(-50%); z-index: 1; }
.hero-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.18;
}
.hero-orb-1 { width: 400px; height: 400px; background: var(--accent); top: -200px; left: 0; }
.hero-orb-2 { width: 300px; height: 300px; background: var(--link); top: 0; left: 100px; }

/* ═══════════════ KPI STRIP ═══════════════ */
.kpi-strip { padding: 32px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.kpi-card {
  background: var(--card); border-radius: var(--radius); padding: 20px; text-align: center;
  border: 1px solid var(--border);
}
.kpi-num {
  font-size: 2.2rem; font-weight: 900; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.kpi-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ═══════════════ MAP ═══════════════ */
.map-wrapper { display: flex; justify-content: center; padding: 20px 0; }
.iraq-map { width: 440px; max-width: 100%; height: auto; filter: drop-shadow(0 4px 24px rgba(0,0,0,0.3)); }
.province {
  fill: #172033; stroke: #2a3f5e; stroke-width: 0.8;
  transition: fill .3s, stroke .3s; cursor: default;
}
.province:hover { fill: #1c2a42; stroke: #3a5070; }
/* Baghdad & Basra provinces — distinguishable and glowing */
#IQ-BG { fill: #173028; stroke: #10B981; stroke-width: 1; cursor: pointer; animation: provinceGlow 3s ease-in-out infinite; }
#IQ-BG:hover { fill: #1a3d30; }
#IQ-BG.active { fill: rgba(16,185,129,0.3); stroke: var(--accent); stroke-width: 1.8; }
#IQ-BA { fill: #173028; stroke: #10B981; stroke-width: 1; cursor: pointer; animation: provinceGlow 3s ease-in-out infinite; animation-delay: 1.5s; }
#IQ-BA:hover { fill: #1a3d30; }
#IQ-BA.active { fill: rgba(16,185,129,0.3); stroke: var(--accent); stroke-width: 1.8; }
@keyframes provinceGlow {
  0%, 100% { fill: #173028; filter: brightness(1); }
  50% { fill: #1a3d30; filter: brightness(1.3); }
}
.map-dot { fill: var(--accent-dim); stroke: var(--accent); stroke-width: 1.5; cursor: pointer; transition: all .3s; }
.map-city:hover .map-dot, .map-city:focus .map-dot { fill: rgba(16,185,129,0.4); }
.map-city.active .map-dot { fill: rgba(16,185,129,0.55); stroke-width: 2.5; }
.map-label { fill: var(--text); font-family: var(--font); font-size: 13px; font-weight: 700; text-anchor: middle; pointer-events: none; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }

/* ═══════════════ TIMELINE ═══════════════ */
.timeline-filters { margin-bottom: 24px; }
.timeline-filters select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 0.85rem; }
.timeline-container {}
.timeline-month { margin-bottom: 32px; }
.timeline-month-label {
  font-size: 1.05rem; font-weight: 700; color: var(--accent); margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.timeline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tl-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: all .2s;
}
.tl-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.tl-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tl-badge {
  font-size: 0.7rem; padding: 2px 10px; border-radius: 12px; font-weight: 700; white-space: nowrap;
}
.tl-badge-training { background: rgba(59,130,246,0.15); color: #60A5FA; }
.tl-badge-focus_group { background: rgba(168,85,247,0.15); color: #C084FC; }
.tl-badge-event { background: rgba(245,158,11,0.15); color: #FBBF24; }
.tl-badge-helpdesk { background: rgba(16,185,129,0.15); color: #34D399; }
.tl-badge-visit { background: rgba(236,72,153,0.15); color: #F472B6; }
.tl-city-badge { font-size: 0.7rem; color: var(--muted); }
.tl-status {
  font-size: 0.65rem; padding: 2px 8px; border-radius: 8px; font-weight: 700; margin-right: auto;
}
.tl-status-Completed { background: rgba(16,185,129,0.15); color: var(--accent); }
.tl-status-Ongoing { background: rgba(59,130,246,0.15); color: #60A5FA; }
.tl-status-Planned { background: rgba(245,158,11,0.15); color: #FBBF24; }
.tl-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.tl-topic { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

/* ═══════════════ CHARTS ═══════════════ */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.chart-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.chart-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; color: var(--muted); }

/* ═══════════════ LIBRARY ═══════════════ */
.library-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  background: var(--card); color: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 20px; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.tab-btn.active, .tab-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.library-search { margin-bottom: 20px; }
.library-search input {
  width: 100%; max-width: 400px; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 0.9rem;
}
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.lib-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  transition: border-color .2s;
}
.lib-card:hover { border-color: var(--accent); }
.lib-format {
  font-size: 0.7rem; font-weight: 700; padding: 2px 10px; border-radius: 12px;
  display: inline-block; margin-bottom: 10px;
}
.lib-format-post { background: rgba(59,130,246,0.15); color: #60A5FA; }
.lib-format-reel { background: rgba(168,85,247,0.15); color: #C084FC; }
.lib-format-carousel { background: rgba(245,158,11,0.15); color: #FBBF24; }
.lib-hook { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.lib-body { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.lib-cta { font-size: 0.82rem; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lib-tag { font-size: 0.7rem; background: var(--bg); color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.lib-copy {
  background: var(--accent-dim); color: var(--accent); border: none; padding: 6px 16px;
  border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; cursor: pointer;
  transition: all .2s;
}
.lib-copy:hover { background: var(--accent); color: var(--bg); }

/* ═══════════════ WIZARD ═══════════════ */
.wizard-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.wizard-step {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  background: var(--bg); border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--border); transition: all .2s;
}
.wizard-step.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.wizard-step.done { border-color: var(--accent); color: var(--accent); opacity: 0.7; }
.step-num { font-weight: 900; }
.wizard-content {}
.wizard-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.wizard-opt {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px; text-align: center; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: all .2s;
}
.wizard-opt:hover, .wizard-opt.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.wizard-result { padding: 12px 0; }
.wizard-result h4 { font-size: 1.05rem; color: var(--accent); margin-bottom: 12px; }
.wizard-path-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.wizard-path-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-dim); color: var(--accent); display: flex;
  align-items: center; justify-content: center; font-weight: 900; font-size: 0.8rem;
}
.wizard-path-text { font-size: 0.9rem; line-height: 1.6; }
.wizard-nav { display: flex; gap: 10px; margin-top: 20px; }

/* ═══════════════ IMPACT ═══════════════ */
.evidence-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 32px; }
.ev-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; transition: border-color .2s;
}
.ev-card:hover { border-color: var(--accent); }
.ev-icon { font-size: 1.8rem; margin-bottom: 6px; }
.ev-card h4 { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.impact-tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.track-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; border-top: 3px solid var(--accent);
}
.track-card h4 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; color: var(--accent); }
.track-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }

/* ═══════════════ TABLE ═══════════════ */
.table-controls { margin-bottom: 16px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  background: var(--card); color: var(--accent); padding: 12px 14px; text-align: right;
  font-weight: 700; border-bottom: 2px solid var(--border); cursor: pointer; white-space: nowrap;
  user-select: none;
}
.data-table th:hover { color: var(--text); }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: var(--card-hover); }

/* ═══════════════ FOOTER ═══════════════ */
#site-footer { background: var(--card); border-top: 1px solid var(--border); padding: 40px 0 0; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; padding-bottom: 32px; }
.footer-inner h3 { font-size: 1.1rem; margin-bottom: 8px; }
.footer-inner h4 { font-size: 0.95rem; margin-bottom: 8px; color: var(--accent); }
.footer-inner p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.footer-muted { font-size: 0.8rem !important; }
.partner-logos { display: flex; flex-wrap: wrap; gap: 8px; }
.partner-placeholder {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 0.75rem; color: var(--muted);
}
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 20px; text-align: center; }
.footer-bottom p { font-size: 0.75rem; color: var(--muted); max-width: var(--max-w); margin: 0 auto; }

/* ═══════════════ MODAL ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 32px;
  position: relative; box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: 12px; left: 12px; background: none; border: none;
  color: var(--muted); font-size: 1.8rem; cursor: pointer; line-height: 1;
  transition: color .2s; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }
.modal-body h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.modal-section { margin-bottom: 16px; }
.modal-section h4 { font-size: 0.9rem; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.modal-section p { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }
.modal-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.modal-gallery-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: var(--muted); text-align: center; padding: 8px;
}
.modal-posts { margin-top: 12px; }
.modal-post-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 8px;
}
.modal-post-item .lib-hook { font-size: 0.9rem; }

/* ═══════════════ ANIMATIONS ═══════════════ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.5s ease both; }

/* ═══════════════ PRINT ═══════════════ */
@media print {
  #site-header, .header-controls, .hero-actions, .filter-group, .search-box,
  .timeline-filters, .library-tabs, .library-search, .wizard-box,
  .tab-btn, .lib-copy, .btn-cta, .mobile-menu-btn, #map-section,
  .wizard-steps, .table-controls, .modal-overlay, .skip-link, .hero-gfx { display: none !important; }
  body { background: #fff; color: #000; }
  .section-title { -webkit-text-fill-color: #000; background: none; }
  .kpi-card, .chart-card, .track-card, .ev-card { border: 1px solid #ccc; background: #f9f9f9; }
  .kpi-num { color: #000; }
  #site-footer { background: #f5f5f5; }
}
