/* =========================================
   1) متغيّرات الألوان والهوية العامة
   ========================================= */
:root {
  --bg-body:      #F6EDDD;
  --brand-dark:   #0A3A4A;  /* الأزرق-الأخضر الداكن */
  --brand-base:   #1A8C94;  /* الأزرق-الأخضر الفاتح */
  --brand-accent: #E9B622;  /* الذهبي / الأصفر */
  --brand-bg:     #F6EEDC;  /* الخلفية الدافئة */

  /* أسماء قديمة مستخدمة في بعض الأجزاء – نربطها بالجدول الجديد */
  --brand-teal:   #1A8C94;
  --brand-yellow: #E9B622;

  --text-main:  #1F2933;
  --text-muted: #6B7280;
  --card-bg:    #FFFFFF;
}

/* =========================================
   2) تخصيص بسيط لألوان Bootstrap (هوية فقط)
   ========================================= */

/* أزرار أساسية */
.btn-primary {
  background-color: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--brand-base) !important;
  border-color: var(--brand-base) !important;
}

.btn-outline-secondary {
  color: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: var(--brand-dark) !important;
  color: #fff !important;
}

/* روابط وهوية نصية */
a {
  color: var(--brand-dark);
}
a:hover {
  color: var(--brand-base);
}

.text-primary {
  color: var(--brand-dark) !important;
}

/* =========================================
   3) الهيدر / التوب بار / النافبار
   ========================================= */

.navbar,
.main-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar-nav .nav-link {
  color: var(--brand-dark);
  font-weight: 500;
  padding: 0.4rem 0.75rem;
}

.navbar-nav .nav-link:hover {
  color: var(--brand-base);
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-current="page"] {
  color: #fff;
  background-color: var(--brand-base);
  border-radius: 999px;
}

/* شريط علوي مخصص (إن وجد) */
.top-bar {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-teal));
  color: #F9FAFB;
  padding: 0.75rem 0;
}

.logo-link {
  color: #F9FAFB;
}

.logo-mark {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: #E5E7EB;
}

.logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

.logo-main {
  font-weight: 800;
  font-size: 1.3rem;
  color: #f9fafb;
  letter-spacing: 0.04em;
}

.logo-tagline {
  font-size: 0.8rem;
  color: #9ca3af;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-user {
  color: #e5e7eb;
  font-size: 0.9rem;
}

/* تحسينات قائمة التصفح في الهيدر */
.top-bar nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar .main-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.top-bar .main-nav li {
  list-style: none;
}

.top-bar .main-nav .main-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: #E5E7EB;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.top-bar .main-nav .main-nav-link:hover,
.top-bar .main-nav .main-nav-link:focus {
  background-color: rgba(15, 23, 42, 0.35);
  color: #F9FAFB;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .top-bar nav {
    gap: 0.5rem;
  }
  .top-bar .main-nav {
    gap: 0.4rem;
  }
  .top-bar .main-nav .main-nav-link {
    font-size: 0.8rem;
    padding-inline: 0.6rem;
  }
}

/* ================================
   Footer - موقع منظور
   ================================ */

.site-footer {
  background: var(--brand-dark);  /* اللون الداكن الرئيسي */
  color: #f1f5f9;
  padding: 1.5rem 0;
  margin-top: 3rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  opacity: 0.9;
}

.site-footer a {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer a:hover {
  opacity: 0.75;
}


/* =========================================
   4) أزرار الهوية الخاصة بمنظور
   ========================================= */

.btn-accent {
  background-color: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: #1F2933;
}
.btn-accent:hover {
  background-color: #e3a223;
  border-color: #e3a223;
  color: #111827;
}

/* override بسيط لأزرار Bootstrap الفاتحة */
.btn-outline-light {
  border-color: rgba(249, 250, 251, 0.6);
}
.btn-outline-light:hover {
  background-color: rgba(249, 250, 251, 0.1);
}

/* زر رئيسي موحّد لمنظور */
.btn-main,
.btn-main:visited {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand-yellow);
  color: #0b1020;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-main:hover {
  background: #e3a223;
  color: #0b1020;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.btn-main.btn-ghost {
  background: transparent;
  color: #f9fafb;
  border-color: rgba(249, 250, 251, 0.25);
}
.btn-main.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.5);
  color: #f9fafb;
}

/* لا نتدخل في كل الأزرار، فقط زر الهوية:
   button العام يبقى تحت سيطرة Bootstrap إلا إذا أضفنا .btn-main */

/* =========================================
   5) أساسيات الصفحة والجسم
   ========================================= */

body.bg-body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* =========================================
   6) HERO القديم / العام (grid)
   ========================================= */

/* ================================
   Page Hero (مكوّن هيرو موحّد)
   ================================ */

.page-hero {
  margin-bottom: 1.5rem;
}

.page-hero-inner {
  border-radius: 0.9rem;
  background: linear-gradient(135deg, var(--brand-bg, #f6eedc), #fff8ea);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 1.5rem 1.75rem;
}

.page-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  align-items: center;
}

/* النص */
.page-hero-title-kicker {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.page-hero h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.page-hero-lead {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.page-hero-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* العنصر البصري */
.page-hero-visual {
  border-radius: 0.75rem;
  background: radial-gradient(circle at 30% 20%, #ffffff, #f4e5c8);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* دائرة أيقونة بسيطة يمكن إعادة استخدامها */
.page-hero-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.page-hero-visual-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.issue-hero-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.75rem;
  object-fit: cover;
}

.issue-hero-placeholder {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem;
}


/* نسخة صغيرة لفهارس القوائم (Index) */
.page-hero--compact .page-hero-layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
}

.page-hero--compact h1 {
  font-size: 1.3rem;
}

/* نسخة التفاصيل (Detail) يمكن أن تكون أقل "زخرفة" */
.page-hero--detail .page-hero-inner {
  background: #fffdf7;
}

/* استجابة للموبايل */
@media (max-width: 768px) {
  .page-hero-inner {
    padding: 1.25rem 1rem;
  }
  .page-hero-layout {
    grid-template-columns: 1fr;
  }
  .page-hero-visual {
    order: -1;
  }
}

/* نموذج بصري بسيط لمنشور ثلاثي/رباعي الأوجه */
.hero-post-3d {
  position: relative;
  width: 200px;
  height: 200px;
  transform-style: preserve-3d;
  animation: hero-rotate 12s linear infinite;
  transform-origin: center center;
  perspective: 800px;
}

.hero-post-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 1.2rem;
  background-image: url('../img/post-texture.png');
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  opacity: 0.88;
}

/* أربع أوجه */
.hero-post-face.face1 { transform: rotateY(   0deg) translateZ(100px); }
.hero-post-face.face2 { transform: rotateY(  90deg) translateZ(100px); }
.hero-post-face.face3 { transform: rotateY( 180deg) translateZ(100px); }
.hero-post-face.face4 { transform: rotateY( -90deg) translateZ(100px); }

@keyframes hero-rotate {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}

.hero-caption {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  max-width: 240px;
}

.hero-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: start;
  }
  .hero-visual {
    order: -1;
  }
}

/* ===== هيرو صفحة القضية issue.php ===== */

/* نجعل هيرو القضية له ارتفاع ثابت على الشاشات الكبيرة،
   مع شبكة عمودين (نص + صورة)، والنص يكون داخله سكرول */
.issue-hero .page-hero-inner {
  height: 260px;                 /* يمكنك رفعها إلى 280 لو حبيت */
  display: flex;
  padding: 1.4rem 1.6rem;
}

/* نعيد تعريف تخطيط الهيرو للقضية فقط (لا نلمس الهيرو العام) */
.issue-hero .page-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.4rem;
  align-items: stretch;
  width: 100%;
}

/* العمود الذي يحتوي النص + الميتا */
.issue-hero-main {
  display: flex;
  flex-direction: column;
  min-height: 0;                 /* مهم مع grid + height ثابت */
}

/* منطقة النص القابلة للسكرول */
.issue-hero-scroll {
  flex: 1 1 auto;
  min-height: 0;                 /* بدونها السكرول لا يعمل كما ينبغي */
  overflow-y: auto;
  padding-inline-end: 0.4rem;    /* مسافة بسيطة بجانب شريط السكرول */
}

/* وصف القضية */
.issue-hero-description {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.7;
}

/* الميتا: عدد الزوايا + تاريخ الإضافة */
.issue-hero-meta {
  margin-top: 0.35rem;
}

.issue-hero-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.issue-hero-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(26, 140, 148, 0.12); /* تمييز بلون الهوية */
  color: var(--brand-dark);
}

.issue-hero-meta-pill .meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand-accent); /* نقطة صغيرة بلون ثانوي */
}

/* سطر التلميحة تحت الميتا */
.issue-hero-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* عمود الصورة – فارغ الآن لكن جاهز للاستخدام لاحقاً */
.issue-hero-visual {
  min-height: 0;                 /* مهم مع grid */
  border-radius: 0.75rem;
  background: radial-gradient(circle at 20% 20%, #ffffff, #f4e5c8);
  border: 1px dashed rgba(10, 58, 74, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* استجابة للموبايل */
@media (max-width: 768px) {
  /* على الموبايل نرجع للهيدر المتكيّف تلقائيًا */
  .issue-hero .page-hero-inner {
    height: auto;
    padding: 1.25rem 1rem;
  }

  .issue-hero .page-hero-layout {
    grid-template-columns: 1fr;
  }

  .issue-hero-visual {
    order: -1;          /* الصورة فوق النص لو حبيت */
    min-height: 160px;
    margin-top: 0.75rem;
  }

  .issue-hero-scroll {
    max-height: 220px;  /* حد أقصى مع سكرول لو النص طويل جداً */
  }
}


/* =========================================
   7) HERO الجديد للصفحة الرئيسية: عجلة منظور
   ========================================= */

.hero.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin-top: 1.5rem;
}

.hero.hero-home .hero-text h1 {
  font-size: 1.9rem;
  margin-bottom: 0.8rem;
}

/* العجلة */
.hero.hero-home .hero-wheel {
  position: relative;
  width: 280px;
  height: 280px;
  margin-inline: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, var(--brand-teal), var(--brand-dark));
  box-shadow: 0 10px 28px rgba(11,58,75,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.hero.hero-home .wheel-center {
  position: absolute;
  width: 120px;
  height: 120px;
  background: var(--brand-yellow);
  color: #0b1020;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  z-index: 2;
}

.hero.hero-home .wheel-item {
  position: absolute;
  width: 90px;
  height: 90px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--brand-dark);
  font-weight: 600;
  text-align: center;
  padding: 0.4rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 3;
  animation: wheel-soft-glow 4s ease-in-out infinite;
}

.hero.hero-home .wheel-icon {
  font-size: 1.35rem;
  display: block;
}

.hero.hero-home .wheel-label {
  display: block;
  font-size: 0.7rem;
}

/* تموضع العقد */
.hero.hero-home .item1 {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
}
.hero.hero-home .item2 {
  top: 50%;
  right: -10px;
  transform: translateY(-50%);
}
.hero.hero-home .item3 {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}
.hero.hero-home .item4 {
  top: 50%;
  left: -10px;
  transform: translateY(-50%);
}

@keyframes wheel-soft-glow {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  }
  50% {
    box-shadow: 0 10px 26px rgba(0,0,0,0.30);
  }
}

@media (max-width: 768px) {
  .hero.hero-home {
    grid-template-columns: 1fr;
    text-align: start;
  }
  .hero.hero-home .hero-wheel {
    margin-top: 1rem;
  }
}

/* ===== هيرو صفحة التحيّز: تخطيط عام ===== */

.bias-hero-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.bias-hero-layout-primary {
  flex: 1.4;
  min-width: 260px;
}

.bias-hero-layout-side {
  flex: 1;
  min-width: 240px;
}

/* ===== بطاقة التحيّز في صفحة bias.php (تعتمد نفس هوية بطاقات التحيّز) ===== */

.bias-detail-card {
  border-radius: 0.9rem;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
}

/* إعادة استخدام الحبوبات نفسها */
.bias-detail-card .bias-header-badges {
  margin-bottom: 0.4rem;
}

.bias-detail-card .bias-header-badges .badge {
  margin-inline-end: 0.25rem;
}

/* ===== صندوق التعليمات العام (يمكن استخدامه في أي صفحة تعليمات) ===== */

.instructions-card {
  border-radius: 0.9rem;
  background: linear-gradient(
    135deg,
    rgba(246, 238, 220, 0.95),
    #ffffff
  );
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 6px 16px rgba(15,23,42,0.04);
  position: relative;
}

/* شريط ملوّن على جانب الصندوق (يتماشى مع RTL) */
.instructions-card::before {
  content: "";
  position: absolute;
  inset-block: 0.6rem;
  inset-inline-start: 0.6rem;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    var(--brand-base),
    var(--brand-accent)
  );
}

/* محتوى التعليمات من الداخل */
.instructions-inner {
  position: relative;
  padding-inline-start: 1.25rem; /* لأن عندنا الشريط على start */
}

/* أيقونة صغيرة أعلى التعليمات */
.instructions-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(10,58,74,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* عنوان التعليمات */
.instructions-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 0.35rem;
}

/* وصف قصير */
.instructions-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* قائمة التعليمات */
.instructions-list {
  margin: 0;
  padding-inline-start: 1rem;
  font-size: 0.85rem;
  color: #374151;
}

.instructions-list li {
  margin-bottom: 0.25rem;
}

/* سطر صغير للوقت المقترح */
.instructions-time-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* استجابة للموبايل */
@media (max-width: 768px) {
  .bias-hero-layout {
    flex-direction: column;
  }
}


/* ===== رحلة تعلم التحيّز (داخل bias.php) ===== */

.bias-steps-wrapper {
  border-radius: 0.9rem;
  background: linear-gradient(
    135deg,
    rgba(10, 58, 74, 0.03),
    rgba(233, 182, 34, 0.04)
  );
  border: 1px solid rgba(10, 58, 74, 0.1);
}

/* عنوان الرحلة والوقت التقريبي */
.bias-steps-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.bias-steps-header-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--brand-dark);
}

.bias-steps-header-title .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bias-steps-header-meta {
  text-align: left; /* مع الاتجاه RTL سيظهر يميناً */
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bias-steps-header-meta .time-value {
  font-weight: 600;
  color: var(--brand-dark);
}

/* شريط التقدم الأفقي */
.bias-progress-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  margin-bottom: 0.6rem;
}

.bias-progress-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 0%; /* تُحدَّث بالـ JS */
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-base), var(--brand-accent));
  transition: width 0.25s ease-out;
}

/* شريط النقاط (1–5) أفقي */
.bias-steps-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bias-step-indicator {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
}

/* إن كان عندك تعريف سابق لـ .bias-step-indicator .step-dot،
   أبقه كما هو أو عدّل القيم قليلاً */
.bias-step-indicator .step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--brand-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--brand-base);
  background: #fff;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bias-step-indicator .step-dot.active {
  background: var(--brand-base);
  color: #fff;
  transform: translateY(-1px);
}

.bias-step-indicator .step-dot.done {
  background: var(--brand-dark);
  color: #fff;
}

/* نص نسبة التقدم */
.bias-progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* صندوق لماذا هذا الموقع + البوستر الدوّار القديم */
.home-hero-inner {
  border-radius: 0.9rem;
  background: var(--brand-bg, #f6eedc);
  border: 1px solid rgba(0,0,0,0.04);
}

.home-rotating-poster {
  height: 180px;
  border-radius: 1rem;
  background: radial-gradient(circle at 30% 20%, #ffffff, #f4e5c8);
  border: 1px solid rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.poster-core {
  position: relative;
}

.poster-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid var(--brand-base);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: poster-rotate 12s linear infinite;
  background: #fff;
}

.poster-title {
  font-weight: 700;
  color: var(--brand-dark);
}

.poster-subtitle {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--brand-dark);
}

@keyframes poster-rotate {
  0%   { transform: rotate(0deg);   }
  100% { transform: rotate(360deg); }
}

.home-why-box {
  border-radius: 0.75rem;
  background-color: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
}

/* =========================================
   8) بطاقات القضايا والزوايا / الفورمات
   ========================================= */

.issue-card,
.perspective-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 25px rgba(15,23,42,0.08);
  border: 1px solid #e5e7eb;
}

.issue-card:hover,
.perspective-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

.issue-card h2 a {
  text-decoration: none;
  color: var(--brand-dark);
}

.issue-card h2 a:hover {
  text-decoration: underline;
}

.main-question {
  color: var(--brand-teal);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.issue-meta,
.perspective-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* فورمات عامة */
.form-group {
  margin-bottom: 0.75rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #D1D5DB;
}
.form-group label {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  display: inline-block;
}

.error {
  color: #B91C1C;
  background: #FEE2E2;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

/* زر عام لأدوات الذكاء الاصطناعي – يعتمد على ستايل أزرارك الحالية */
.ai-tools-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ai-tools-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-ai {
  font-size: 0.85rem;
  padding-inline: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-ai.is-loading {
  opacity: 0.7;
  cursor: default;
}

/* =========================================
   9) تخطيط عام للصفحات الرئيسية والقضايا
   ========================================= */

.home-page,
.issues-index-page {
  max-width: 1100px;
  margin: 0 auto;
}

/* كروت عامة */
.home-section-card {
  border-radius: 0.7rem;
  background: #ffffff;
  border: 1px solid #e4e7eb;
}

/* تأثير hover إضافي على الكروت */
.issue-card:hover,
.bias-card:hover {
  border-color: var(--brand-base, #1A8C94);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

/* نماذج الفلترة للقضايا */
.issues-filter-form {
  border-radius: 0.7rem;
  background: #ffffff;
  border: 1px solid #e4e7eb;
}

@media (max-width: 768px) {
  .home-hero-inner {
    padding: 1.25rem;
  }
}


/* وعاء الزاوية النشطة (قائمة البطاقات) مع سكرول وارتفاع ثابت */
.perspective-list-scroll {
  max-height: 360px;           /* عدّل الرقم حسب ما يناسب ارتفاع العمود */
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* في الشاشات الصغيرة نقلل الارتفاع قليلاً */
@media (max-width: 768px) {
  .perspective-list-scroll {
    max-height: 260px;
  }
}

/* زر إظهار نموذج إضافة زاوية */
.btn-toggle-add-perspective {
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
}

/* حركة فتح/إغلاق الفورم */
.add-perspective {
  overflow: hidden;
  max-height: 1000px; /* قيمة كبيرة مبدئيًا، ستتضبط بالـ JS */
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.add-perspective.is-collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* تنسيق بسيط للتحقق البشري */
.human-check-group {
  margin-top: 0.75rem;
}

.human-check-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.human-check-question {
  font-size: 0.85rem;
}

.human-check-input {
  max-width: 80px;
}

.field-error {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #d9534f; /* أحمر هادئ */
}

/* ============================
   بطاقة الفئة – تصميم مميز
   ============================ */

.bias-category-card {
  background: linear-gradient(
    135deg,
    var(--brand-bg) 0%,
    #ffffff 100%
  );
  border: 1px solid rgba(26, 140, 148, 0.20); /* يميل للـ brand-base */
  border-radius: 0.8rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.bias-category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border-color: var(--brand-base);
}

/* أيقونة الفئة */
.bias-category-card::before {
  content: "📂";
  display: inline-block;
  font-size: 1.2rem;
  margin-left: 0.4rem;
  opacity: 0.85;
}

/* تمييز Badge عدد التحيزات */
.bias-category-card .category-count-badge {
  background-color: var(--brand-base);
  color: #fff;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(26,140,148,0.28);
}

/* ==========================================
   بطاقة التحيّز – الهوية الموحدة الجديدة
   ========================================== */

.bias-card {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: 0 4px 10px rgba(0,0,0,0.035);
  padding: 1rem 1.2rem;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border 0.22s ease;
}

/* حدّ علوي ملوّن */
.bias-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--brand-base);  
  border-radius: 0.75rem 0.75rem 0 0;
}

/* أيقونة صغيرة في الزاوية */
.bias-card .bias-icon {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.2rem;
  opacity: 0.85;
  color: var(--brand-dark);
}

/* النص */
.bias-card h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--brand-dark);
}

.bias-card p {
  font-size: 0.85rem;
  color: #4b5563;
}

/* تأثير hover */
.bias-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-base);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* مستوى الصعوبة */
.bias-difficulty-pill {
  background-color: var(--brand-accent) !important;
  color: #4a3b14 !important;
}

/* ===================================================
   هوية مربّع البحث – Search Box Identity (Site-wide)
   =================================================== */

.search-box {
  background: var(--brand-bg);
  border: 1px solid rgba(26, 140, 148, 0.25); /* brand-base */
  border-radius: 0.85rem;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  position: relative;
}

/* أيقونة البحث داخل المربع */
.search-box .search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 1.25rem;
  font-size: 1.15rem;
  color: var(--brand-dark);
  opacity: 0.75;
  pointer-events: none;
}

/* حقل البحث */
.search-box input[type="text"],
.search-box input[type="search"] {
  width: 100%;
  padding: 0.55rem 1rem;
  padding-right: 2.7rem; /* مساحة للأيقونة */
  border-radius: 0.65rem;
  border: 1px solid rgba(26, 140, 148, 0.35);
  background: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

/* التركيز */
.search-box input[type="text"]:focus,
.search-box input[type="search"]:focus {
  border-color: var(--brand-dark);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26, 140, 148, 0.18);
  outline: none;
}

/* زر البحث */
.search-box .btn-search {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
  border-radius: 0.65rem;
  padding: 0.55rem 1.2rem;
  border: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.search-box .btn-search:hover {
  background: var(--brand-base);
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
}



/* =========================================
   10) المنشور ثلاثي الأبعاد (Prism)
   ========================================= */

.issue-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 2rem;
}

.post3d-column,
.perspective-column {
  flex: 1;
  min-width: 300px;
}

.post3d-wrapper {
  width: 100%;
  height: auto;
  min-height: 380px;
  perspective: 1200px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.post3d-cube {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  width: 280px;
  height: 280px;
  margin-bottom: 2rem;
  z-index: 5;
}
/* إعادة ضبط محتوى وجوه المنشور ثلاثي الأبعاد */
.post3d-face {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  border-radius: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.2);
  overflow: hidden;
  background-image: url('../img/post-texture.png');
  background-repeat: no-repeat;
  backface-visibility: hidden;
}

.post3d-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(11, 58, 75, 0.65),
    rgba(11, 58, 75, 0.90)
  );
  z-index: 0; /* تحت النص */
}

.post3d-content {
  position: relative;
  z-index: 1;            /* فوق الـ overlay */
  padding: 0.8rem 0.9rem;
  color: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* مهم: من الأعلى */
  text-align: right;
  overflow: hidden;
}



.post3d-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #F4B534;
}

.post3d-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.9;
}

.post3d-face.is-active {
  border: 2px solid #F4B534;
  box-shadow: 0 0 15px rgba(244, 181, 52, 0.4);
}

/* أزرار التحكم للمنشور ثلاثي الأبعاد:
   نقيّدها داخل .post3d-controls بدلاً من استهداف كل button في الموقع */
.post3d-controls {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  z-index: 10;
}

.post3d-controls button {
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: var(--brand-dark);
  color: #fff;
  border: none;
  border-radius: 4px;
}

.post3d-controls button:hover {
  background: var(--brand-teal);
}

.post3d-face-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.75rem 0.9rem;
  box-sizing: border-box;
}
/* الميتا العلوية (حبات صغيرة) */
.post3d-face-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.3rem;
}

.post3d-meta-pill {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fdfdfd;
  line-height: 1.1;
}

/* العنوان */
.post3d-title {
  font-size: 0.9rem;
  margin: 0 0 0.2rem 0;
  color: #F4B534;
}

/* فرض ظهور وصف الزاوية في أوجه المنشور */
.post3d-excerpt,
.post3d-excerpt-empty {
  display: block !important;
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 0 0.3rem 0;
  font-size: 0.78rem;
  line-height: 1.4;
}


/* الميتا السفلية */
.post3d-face-meta-bottom {
  margin-top: auto;  /* تنزلها أسفل الوجه */
  font-size: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.post3d-meta-item {
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
}



/* البطاقات الجانبية للزوايا */
.perspective-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.perspective-card.is-active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.perspective-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.add-perspective {
  margin-top: 1.5rem;
}

.section-title {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: #111827;
}

/* =====================================
   Mobile Navigation - قائمة الموبايل
   ===================================== */

/* زر الهامبرغر */
.top-bar .mobile-nav-toggle {
  display: none; /* افتراضياً مخفي، يظهر فقط في الشاشات الصغيرة */
  cursor: pointer;
  font-size: 1.7rem;
  background: none;
  border: none;
  color: #F9FAFB; /* نفس لون نص الهيدر */
  padding: 0.1rem 0.4rem;
  line-height: 1;
}

/* حاوية القائمة في الموبايل كـ DROPDOWN عائم */
.top-bar .mobile-nav {
  position: absolute;
  top: 100%;              /* أسفل الهيدر مباشرة */
  inset-inline-end: 0;    /* يمين في RTL */
  width: 230px;           /* عرض مناسب */
  max-width: calc(100vw - 1.5rem);
  display: none;          /* مخفية افتراضياً */
  flex-direction: column;
  gap: 0.25rem;
  background-color: #0b2530;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  z-index: 999;           /* فوق المحتوى */
}

/* الروابط داخل قائمة الموبايل */
.top-bar .mobile-nav a {
  display: block;
  padding: 0.4rem 0.1rem;
  text-decoration: none;
  color: #E5E7EB;
  font-size: 0.9rem;
  font-weight: 500;
}

.top-bar .mobile-nav a:hover {
  color: #ffffff;
}

/* عندما تكون القائمة مفتوحة عبر JS */
.top-bar .mobile-nav.open {
  display: flex;
}

/* إعدادات خاصة للشاشات الصغيرة */
@media (max-width: 768px) {
  /* نسمح للكونتينر أن يكون مرجع تموضع للدروب داون */
  .top-bar .container {
    position: relative;
    /* نبقيه في صف واحد: الشعار + زر المنيو + أزرار المستخدم */
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  /* إخفاء القائمة الأفقية في الموبايل */
  .top-bar .main-nav {
    display: none !important;
  }

  /* إظهار زر الهامبرغر */
  .top-bar .mobile-nav-toggle {
    display: block;
  }

  /* تصغير حجم منطقة المستخدم قليلاً */
  .top-bar nav {
    font-size: 0.85rem;
  }
}

/* ===============================
   اختبارات التحيّزات - فهرس واختبار
   =============================== */

/* بطاقة الهيرو الخاصة بفهرس الاختبارات */
.bias-test-hero-card {
  background: linear-gradient(135deg, #0f172a, #1f2937);
  color: #f9fafb;
  border-radius: 1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
}

.bias-test-hero-icon {
  font-size: 2.6rem;
}

/* شريط بسيط داخل الهيرو */
.bias-overview-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.4);
  overflow: hidden;
}

.bias-overview-bar-fill {
  position: absolute;
  inset: 0;
  width: 55%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
}

/* بطاقات الاختبارات في الفهرس */
.test-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.test-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.18);
}

.test-card-title {
  transition: color 0.15s ease;
}

.test-card:hover .test-card-title {
  color: var(--brand-base);
}

/* ميتاداتا الاختبارات (المدة، عدد الأسئلة، المستوى) في البطاقات والهيرو */
.test-card {
  display: flex;
  flex-direction: column;
}

.test-card-meta {
  margin-top: auto;
}

.test-meta-pill {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: var(--brand-yellow); /* #E9B622 من ثيمة مدائن */
  color: var(--brand-dark);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.test-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ميتاداتا الهيرو */
.test-hero-meta {
  margin-top: 1.25rem;
}

.test-hero-meta .test-meta-pill {
  width: 100%;
  justify-content: space-between;
}

@media (max-width: 576px) {
  .test-hero-meta .test-meta-pill {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* الهيرو في صفحة الاختبار: حاوية الوصف */
.test-desc-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding-inline-end: 0.25rem;
}

/* شريط التقدّم في صفحة الاختبار (أقل ارتفاعًا) */
.bias-test-progress .bias-progress-track {
  height: 4px;
}

/* بطاقات نتيجة الاختبار */
.test-result-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.test-result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

/* ألوان مستويات التحيّز */
.test-level-pill.level-low {
  background-color: #dcfce7;
  color: #166534;
}

.test-level-pill.level-medium {
  background-color: #fef9c3;
  color: #854d0e;
}

.test-level-pill.level-high {
  background-color: #fee2e2;
  color: #991b1b;
}

/* المؤشر الشمولي في الملخّص التنفيذي */
.bias-overview-visual .bias-overview-bar {
  height: 8px;
  background: #e5e7eb;
}

.bias-overview-visual .bias-overview-bar-fill {
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
}

.bias-overview-bar-fill.level-low {
  background: #22c55e;
}

.bias-overview-bar-fill.level-medium {
  background: linear-gradient(90deg, #22c55e, #eab308);
}

.bias-overview-bar-fill.level-high {
  background: linear-gradient(90deg, #eab308, #ef4444);
}

/* ===============================
   سلايدر تلميحات اختبارات التحيّز
   =============================== */

.bias-test-tips {
  margin-top: 1.5rem;
}

.tips-carousel-wrapper {
  border-radius: 0.9rem;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  padding: 1.25rem 1.4rem;
}

/* شريط التقدّم العلوي */
.tips-carousel-top {
  gap: 0.75rem;
}

.tips-progress-track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.tips-progress-fill {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-base), var(--brand-accent));
  transition: width 0.25s ease-out;
}

/* حاوية الشرائح */
.tips-carousel-inner {
  position: relative;
  min-height: 180px;
  margin-top: 0.75rem;
}

/* بطاقة الشريحة – تستفيد من test-card */
.tip-slide {
  display: none;
  border-radius: 0.75rem;
  background: var(--card-bg);
  box-shadow: 0 6px 16px rgba(15,23,42,0.10);
  padding: 1rem 1.1rem;
  animation: tipsFadeIn 0.25s ease;
}

.tip-slide.is-active {
  display: block;
}

.tips-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* الميتاداتا العلوية على شكل حبوبات */
.tips-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tips-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  color: var(--brand-dark);
  font-size: 0.78rem;
}

.tips-meta-sub {
  opacity: 0.8;
  font-size: 0.75rem;
}

/* مستويات التحيز بألوان قريبة من نتائج الاختبار */
.tips-level-pill.level-low,
.tips-level-low {
  background-color: #dcfce7;
  color: #166534;
}

.tips-level-pill.level-medium,
.tips-level-medium {
  background-color: #fef9c3;
  color: #854d0e;
}

.tips-level-pill.level-high,
.tips-level-high {
  background-color: #fee2e2;
  color: #991b1b;
}

.tips-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.tips-body {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.7;
}

/* الميتاداتا السفلية – نستخدم test-meta-pill */
.tips-meta-bottom .test-meta-pill {
  width: 100%;
  justify-content: flex-start;
}

/* أزرار التنقل */
.tips-carousel-controls .btn {
  min-width: 110px;
}

/* حركة صغيرة عند الانتقال */
@keyframes tipsFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
  .tips-carousel-wrapper {
    padding: 1rem 0.9rem;
  }
}

/* ضمان سلوك سلايدر التلميحات */
.tip-slide {
  display: none !important;
}

.tip-slide.is-active {
  display: block !important;
}
