/* ═══════════════════════════════════════════
   Projects Dashboard v2 — Public CSS
   ═══════════════════════════════════════════ */

.pd-wrap {
  --c-bg:      #f4f6fb;
  --c-surface: #ffffff;
  --c-border:  #e2e8f4;
  --c-navy:    #0b1d4a;
  --c-navy2:   #122060;
  --c-blue:    #1a56db;
  --c-blue-l:  #ebf2ff;
  --c-blue-m:  #3b82f6;
  --c-text:    #0f172a;
  --c-text2:   #475569;
  --c-text3:   #94a3b8;
  --c-sh-sm:   0 1px 4px rgba(11,29,74,.06),0 1px 2px rgba(11,29,74,.04);
  --c-sh:      0 4px 20px rgba(11,29,74,.09);
  --c-sh-lg:   0 16px 48px rgba(11,29,74,.14),0 4px 16px rgba(11,29,74,.07);
  --font:      'Cairo', sans-serif;
  --r:         16px;

  font-family: var(--font);
  background:  var(--c-bg);
  color:       var(--c-text);
  direction:   ltr;
}
.pd-wrap *, .pd-wrap *::before, .pd-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }
.pd-lang-bar { display: none; }

/* ════════════════════════════════
   HERO
   ════════════════════════════════ */
.pd-hero {
  background: linear-gradient(140deg, #0b1d4a 0%, #122060 50%, #0f3580 80%, #1046a8 100%);
  padding: 36px 24px 0;
  position: relative; overflow: hidden;
}
.pd-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.pd-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 15% 60%, rgba(14,165,233,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 85% 20%, rgba(99,102,241,.14) 0%, transparent 60%);
}
.pd-hero-inner {
  position: relative; z-index: 1;
  visibility: hidden; opacity: 0;
}
.pd-hero-inner.pd-ready {
  visibility: visible; opacity: 1;
  transition: opacity .4s ease;
}

/* ── LOGOS ROW — 3 logos balanced ── */
.pd-logos-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto;
}

/* شركة A و B */
.pd-logo-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 12px 20px;
  text-decoration: none;
  transition: background .25s;
  border-radius: 14px 14px 0 0;
}
.pd-logo-block:hover { background: rgba(255,255,255,.05); }

.pd-logo-img {
  width: 110px; height: 110px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.1);
  transition: transform .25s, box-shadow .25s;
}
.pd-logo-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.pd-logo-block:hover .pd-logo-img {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.26);
}

.pd-logo-label {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,.8);
  text-align: center; line-height: 1.35;
}

/* الممول — أكبر قليلاً في الوسط */
.pd-logo-block--funder { flex: 1.15; padding-top: 16px; }

.pd-logo-img--funder {
  width: 120px; height: 120px;
  border-radius: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  box-shadow: 0 8px 28px rgba(0,0,0,.26), 0 2px 8px rgba(0,0,0,.14);
}

.pd-logo-label--funder {
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.45);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* الفاصل × */
.pd-logos-sep {
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px 48px; flex-shrink: 0;
}
.pd-logos-sep-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.28); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* ── TITLE ROW ── */
.pd-title-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 16px 28px 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.11);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  margin-top: 6px;
  max-width: 680px;
  margin-left: auto; margin-right: auto;
}
.pd-title-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.pd-h1 { font-size: 22px; font-weight: 900; color: #fff; margin: 0; }
.pd-sub { display: none; }

/* ════════════════════════════════
   MAIN
   ════════════════════════════════ */
.pd-main { padding: 32px 36px 60px; }
.pd-sec-head { display: none; }

/* ── LOADING ── */
.pd-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 80px; color: var(--c-text2); font-size: 15px;
}
.pd-spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--c-border); border-top-color: var(--c-blue);
  border-radius: 50%; animation: pdSpin .75s linear infinite;
}
@keyframes pdSpin { to { transform: rotate(360deg); } }

/* ── GRID ── */
.pd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

/* ════════════════════════════════
   PROJECT CARD
   ════════════════════════════════ */
.pd-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 18px; overflow: hidden; cursor: pointer;
  transition: transform .28s cubic-bezier(.4,0,.2,1),
              box-shadow .28s cubic-bezier(.4,0,.2,1),
              border-color .28s;
  box-shadow: var(--c-sh-sm);
  display: flex; flex-direction: column;
  animation: pdUp .45s ease both;
}
.pd-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--c-sh-lg);
  border-color: var(--c-blue-m);
}
@keyframes pdUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.pd-card-thumb {
  height: 180px;
  background: linear-gradient(160deg, #f0f5ff 0%, #e8edf8 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; flex-shrink: 0; padding: 20px;
}
.pd-card-thumb img {
  max-width: 100%; max-height: 140px; width: auto; height: auto;
  object-fit: contain; transition: transform .35s ease; display: block;
  filter: drop-shadow(0 4px 10px rgba(11,29,74,.1));
}
.pd-card:hover .pd-card-thumb img { transform: scale(1.07); }

.pd-card-badge { display: none; }
.pd-card-badge.s-active   { background: rgba(5,150,105,.12);  color: #047857; border: 1px solid rgba(5,150,105,.25); }
.pd-card-badge.s-progress { background: rgba(245,158,11,.12); color: #b45309; border: 1px solid rgba(245,158,11,.25); }
.pd-card-badge.s-planning { background: rgba(99,102,241,.12); color: #4338ca; border: 1px solid rgba(99,102,241,.25); }
.pd-card-badge.s-complete { background: rgba(139,92,246,.12); color: #6d28d9; border: 1px solid rgba(139,92,246,.25); }

.pd-card-no-img {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--c-text3);
}
.pd-card-no-img span { font-size: 40px; opacity: .28; }

.pd-card-body {
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px;
  background: #fff; border-top: 1px solid #f0f4fb; flex: 1;
}
.pd-card-name {
  font-size: 14px; font-weight: 800; color: var(--c-navy);
  line-height: 1.45; text-align: center;
}
.pd-card:hover .pd-card-name { color: var(--c-blue); }
.pd-card-hint { display: none; }

/* ════════════════════════════════
   ArcGIS OVERLAY
   ════════════════════════════════ */
.pd-overlay {
  position: fixed; inset: 0; z-index: 99999;
  display: none; flex-direction: column; background: #fff;
}
.pd-overlay.active { display: flex; }

.pd-overlay-topbar {
  flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--c-border);
  padding: 13px 22px; box-shadow: var(--c-sh);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  direction: ltr; z-index: 1;
}
.pd-back-btn {
  width: 42px; height: 42px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--c-navy); font-size: 18px; flex-shrink: 0;
  transition: .2s; box-shadow: var(--c-sh-sm); font-family: var(--font);
}
.pd-back-btn:hover { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
.pd-overlay-title { flex: 1; min-width: 0; }
.pd-ov-name-ar { font-size: 16px; font-weight: 800; color: var(--c-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-ov-name-en { font-size: 12px; color: var(--c-text3); margin-top: 2px; }
.pd-ov-tag { padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.pd-ov-co-tag { background: var(--c-blue-l); border: 1px solid rgba(26,86,219,.18); color: var(--c-blue); display: flex; align-items: center; gap: 6px; }
.pd-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #059669; animation: pdLive 1.5s infinite; }
@keyframes pdLive { 0%,100%{box-shadow:0 0 0 0 rgba(5,150,105,.4)} 50%{box-shadow:0 0 0 4px rgba(5,150,105,0)} }
.pd-ov-st-tag { background: #f8fafc; border: 1px solid var(--c-border); color: var(--c-text2); }
.pd-ov-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--c-bg); color: var(--c-text2); font-size: 14px; }
.pd-ov-spinner { width: 44px; height: 44px; border: 4px solid var(--c-border); border-top-color: var(--c-blue); border-radius: 50%; animation: pdSpin .8s linear infinite; }
.pd-arcgis-frame { flex: 1; border: none; display: block; width: 100%; background: var(--c-bg); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .pd-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}
@media (max-width: 700px) {
  .pd-hero { padding: 24px 12px 0; }
  .pd-main { padding: 22px 16px 44px; }
  .pd-logos-row, .pd-title-row { max-width: 100%; }
  .pd-logo-img { width: 80px; height: 80px; font-size: 26px; }
  .pd-logo-img--funder { width: 90px; height: 90px; }
  .pd-logo-label { font-size: 11px; }
  .pd-logo-block { padding: 16px 8px 14px; gap: 8px; }
  .pd-h1 { font-size: 17px; }
  .pd-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pd-overlay-topbar { padding: 10px 14px; }
  .pd-card-thumb { height: 150px; }
}
