/* =====================================================================
   بصيرة — أنماط الصفحات الإضافية (شركاء التقنية، شركاء البيانات، اتصل بنا)
   Basira — Executive Brand Identity Design System
   ===================================================================== */

.sp-content {
  max-width: 1400px;
  margin-inline: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* =====================================================================
   1. الهيرو التنفيذي الموحد (Executive Hero Section)
   ===================================================================== */
.sp-hero-wrap {
  position: relative;
  border-radius: var(--r-xl);
  color: var(--ink-inv);
  overflow: hidden;
  background:
    radial-gradient(850px 380px at 15% -20%, rgba(26, 122, 112, 0.35), transparent 60%),
    radial-gradient(920px 420px at 90% 125%, rgba(201, 168, 63, 0.25), transparent 60%),
    linear-gradient(145deg, #021B19 0%, #063932 50%, #021B19 100%);
  box-shadow: var(--sh-deep);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sp-hero-wrap .sp-pat {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
}

.sp-hero-in {
  position: relative;
  padding: 34px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.sp-hero-main {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #EAD9A0;
  background: rgba(176, 141, 46, 0.2);
  border: 1px solid rgba(201, 168, 63, 0.38);
  padding: 5px 14px;
  border-radius: var(--r-full);
  width: fit-content;
}

.sp-badge .sp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 8px var(--gold-400);
}

.sp-hero-main h1 {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.sp-hero-main p {
  font-size: 14.5px;
  color: #D2E4DD;
  line-height: 1.9;
  max-width: 700px;
}

.sp-hero-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.sp-hstat {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  min-width: 130px;
  backdrop-filter: blur(8px);
}

.sp-hstat .v {
  font-size: 24px;
  font-weight: 700;
  color: #FFFFFF;
}

.sp-hstat .l {
  font-size: 11px;
  color: #B5D2CB;
  font-weight: 500;
}

/* =====================================================================
   2. شركاء التقنية (Technical Partners Grid & Cards)
   ===================================================================== */
.tp-grid {
  display: grid;
  /* min() يمنع تجاوز العرض على الجوال: المسار لا يتجاوز عرض الحاوية أبداً */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 20px;
}

.tp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
}

.tp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--gold-400);
}

.tp-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-600), var(--gold-500));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tp-card:hover::before {
  opacity: 1;
}

.tp-logo-box {
  width: 100%;
  height: 106px;
  background: #FFFFFF;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  box-shadow: 0 1px 3px rgba(15, 29, 28, 0.03);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tp-card:hover .tp-logo-box {
  background: #FFFFFF;
  border-color: var(--gold-400);
  box-shadow: 0 4px 14px rgba(7, 76, 70, 0.08);
}

.tp-logo-box img {
  width: 100%;
  height: 56px;
  max-width: 100%;
  max-height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.04));
  transition: transform 0.22s ease;
}

.tp-card:hover .tp-logo-box img {
  transform: scale(1.05);
}

.tp-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tp-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.tp-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-600);
  background: var(--gold-100);
  padding: 2px 8px;
  border-radius: var(--r-full);
}

.tp-domain {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-600);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tp-domain svg {
  flex-shrink: 0;
  color: var(--green-500);
}

.tp-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.7;
}

.tp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  margin-top: auto;
}

.tp-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--good-text);
  background: var(--good-bg);
  padding: 3px 9px;
  border-radius: var(--r-full);
}

.tp-status .tp-sdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--good);
}

.tp-type {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
}

/* =====================================================================
   3. شركاء البيانات والتحليل (Data Partners Grid & Cards)
   ===================================================================== */
.dp-grid {
  display: grid;
  /* min() يمنع تجاوز العرض على الجوال: المسار لا يتجاوز عرض الحاوية أبداً */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.dp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.dp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--green-400);
}

.dp-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--green-500));
}

.dp-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dp-placeholder-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1.5px dashed var(--line-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.dp-card:hover .dp-placeholder-logo {
  border-color: var(--green-500);
  background: var(--green-50);
}

.dp-placeholder-logo svg {
  color: var(--green-600);
  transition: transform 0.2s ease;
}

.dp-card:hover .dp-placeholder-logo svg {
  transform: scale(1.1);
}

.dp-placeholder-logo .dp-ph-hint {
  position: absolute;
  bottom: 2px;
  font-size: 8.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: -0.2px;
}

.dp-meta-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dp-source-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.dp-dataset-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid var(--green-100);
  padding: 2px 8px;
  border-radius: var(--r-full);
  width: fit-content;
}

.dp-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dp-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.75;
}

.dp-dims-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.dp-dim-pill {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  margin-top: auto;
}

.dp-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green-700);
}

.dp-sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.dp-code {
  font-family: monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  direction: ltr;
  /* المعرّفات مثل DAILY_KPI_INDICATORS لا تحوي مواضع كسر طبيعية */
  overflow-wrap: anywhere;
}

/* =====================================================================
   4. صفحة اتصل بنا وشريك التطوير (Contact & Developer Showcase)
   ===================================================================== */
.ct-dev-showcase {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 36px;
  box-shadow: var(--sh-2);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.ct-dev-showcase::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green-600), var(--gold-500));
}

.ct-dev-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ct-dev-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-600);
  background: var(--gold-100);
  padding: 4px 12px;
  border-radius: var(--r-full);
  width: fit-content;
}

.ct-dev-left h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.ct-dev-left p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.85;
}

.ct-dev-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ct-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-600);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(7, 76, 70, 0.2);
}

.ct-btn-primary:hover {
  background: var(--green-700);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(7, 76, 70, 0.3);
  color: #FFFFFF;
}

.ct-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.18s ease;
}

.ct-btn-outline:hover {
  border-color: var(--green-400);
  color: var(--green-700);
  background: var(--green-50);
}

.ct-dev-right {
  background: radial-gradient(circle at center, #FFFFFF, var(--surface-2));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: var(--sh-1);
}

.ct-dev-logo-wrap {
  max-width: 320px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ct-dev-logo-wrap img {
  width: 100%;
  height: auto;
  max-height: 85px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
}

.ct-dev-web-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-600);
  text-decoration: none;
  direction: ltr;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--green-50);
  border: 1px solid var(--green-100);
  transition: all 0.15s ease;
}

.ct-dev-web-link:hover {
  background: var(--green-100);
  color: var(--green-700);
}

/* بطاقات قنوات التواصل */
.ct-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.ct-channel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: var(--sh-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.ct-channel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-2);
  border-color: var(--green-400);
}

.ct-ch-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  transition: transform 0.2s ease;
}

.ct-channel-card:hover .ct-ch-icon {
  transform: scale(1.08);
}

.ct-icon-phone { background: rgba(14, 96, 88, 0.1); color: var(--green-600); }
.ct-icon-mail  { background: rgba(176, 141, 46, 0.12); color: var(--gold-600); }
.ct-icon-loc   { background: rgba(42, 120, 214, 0.1); color: var(--info-text); }
.ct-icon-web   { background: rgba(108, 92, 231, 0.1); color: #5f27cd; }

.ct-channel-card b {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.ct-channel-card .ct-val {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}

.ct-channel-card .ct-action-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--green-600);
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =====================================================================
   5. تذييل الصفحات (Page Footer)
   ===================================================================== */
.pg-foot {
  padding: 24px 0 10px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pg-foot-sep {
  opacity: 0.4;
}

/* =====================================================================
   6. التوافق مع الشاشات المتجاوبة (Responsive)
   ===================================================================== */
@media (max-width: 1100px) {
  .ct-dev-showcase {
    grid-template-columns: 1fr;
  }
  .ct-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sp-hero-in {
    flex-direction: column;
    align-items: flex-start;
    padding: 26px 22px;
  }
  .sp-hero-stats {
    width: 100%;
    justify-content: space-between;
  }
  .sp-hstat {
    flex: 1;
    min-width: 0;
    padding: 12px 10px;
  }
  /* مساحة لمس مناسبة للرابط الخارجي على الأجهزة اللمسية */
  .ct-dev-web-link {
    min-height: 44px;
    font-size: 13px;
    padding: 8px 16px;
  }
}

@media (max-width: 600px) {
  .sp-content {
    gap: 20px;
  }

  /* الهيرو: لا يجوز أن يبتلع الشاشة الأولى كاملة */
  .sp-hero-in {
    padding: 20px 16px;
  }
  .sp-hero-main h1 {
    font-size: clamp(19px, 5.2vw, 26px);
    line-height: 1.4;
  }
  .sp-hero-main p {
    font-size: 13px;
  }
  .sp-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .sp-hstat {
    min-width: 0;
  }
  .sp-hstat .v {
    font-size: 21px;
  }
  /* الزخرفة تتضخم عند دوران الهيرو رأسياً فتزاحم العنوان */
  .sp-hero-wrap .sp-pat {
    opacity: 0.03;
  }

  /* وضوح النصوص الصغيرة */
  .tp-tag,
  .dp-dataset-badge,
  .dp-dim-pill,
  .dp-code {
    font-size: 11.5px;
  }
  .dp-dataset-badge {
    border-radius: var(--r-sm);
    padding: 4px 9px;
    line-height: 1.5;
  }
  .dp-head {
    gap: 10px;
  }
  .dp-placeholder-logo {
    width: 52px;
    height: 52px;
  }
  /* 8.5px غير مقروء ويتداخل مع الأيقونة؛ اسم الجهة ظاهر في الشارة المجاورة */
  .dp-placeholder-logo .dp-ph-hint {
    display: none;
  }

  /* بطاقة الشريك المطور */
  .ct-dev-showcase {
    padding: 22px 18px;
    gap: 22px;
  }
  .ct-dev-left h2 {
    font-size: 17.5px;
  }
  .ct-dev-left p {
    font-size: 13px;
  }
  .ct-dev-right {
    padding: 20px 16px;
  }
  .ct-dev-actions {
    width: 100%;
  }
  .ct-btn-primary,
  .ct-btn-outline {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .ct-cards-grid {
    grid-template-columns: 1fr;
  }

  /* الفواصل تُترك وحيدة في أسطر مستقلة عند ضيق الشاشة */
  .pg-foot {
    flex-direction: column;
    gap: 4px;
  }
  .pg-foot-sep {
    display: none;
  }
}
