[hidden] {
  display: none !important;
}

/* ============================================
   نظام الألوان والخطوط (Design Tokens)
   ============================================ */
:root {
  --ui-scale: 0.9;
  --ink: #EAEFF8;
  --ink-soft: #8EAC9F;
  --teal-deep: #00BFA6;
  --teal-darker: #008F7C;
  --teal-tint: rgba(0, 191, 166, 0.12);
  --parchment: #021E19;
  --parchment-dark: rgba(255, 255, 255, 0.06);
  --gold: #FFD700;
  --gold-dark: #C5A028;

  --site-font: 'Amiri', serif;
  --font-display: var(--site-font);
  --font-body: var(--site-font);

  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  zoom: var(--ui-scale);
  scroll-behavior: smooth;
}

@supports not (zoom: 1) {
  html {
    font-size: calc(100% * var(--ui-scale));
  }
}

/* ضمان عدم نزول خط حقول الإدخال على الموبايل عن 16px بعد التصغير لمنع zoom التلقائي في iOS */
@media (max-width: 768px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: max(16px, calc(16px / var(--ui-scale))) !important;
  }
}

body {
  background: radial-gradient(ellipse at center, #062820 0%, #041B15 45%, #020F0C 80%, #010806 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--site-font);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea,
button {
  font-family: inherit;
}

/* ============================================
   الإطار الزخرفي (التوقيع البصري)
   ============================================ */
.frame-border {
  display: none !important;
}

/* ============================================
   شريط التنقل
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 23, 19, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* توسيط مجموعة الروابط في منتصف شريط التنقل بالصفحة الرئيسية */
@media (min-width: 761px) {
  body:has(.hero) .navbar-inner,
  .navbar:has(a[href="#about"]) .navbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  body:has(.hero) .navbar-inner .brand,
  .navbar:has(a[href="#about"]) .brand {
    grid-column: 1;
    justify-self: start;
  }

  body:has(.hero) .navbar-inner .nav-links,
  .navbar:has(a[href="#about"]) .nav-links {
    grid-column: 2;
    justify-self: center;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Reem Kufi', sans-serif;
  font-size: 1.4rem;
  color: #FFFFFF;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  color: var(--gold);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 10px 16px;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--teal-tint);
  color: #fff;
}

.nav-link.is-active {
  background: #c9a227;
  color: #fff !important;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.nav-link.is-active:hover,
.nav-link.is-active:focus-visible {
  background: #c9a227;
  color: #fff !important;
}

.nav-link:active {
  background: var(--parchment-dark);
}

/* شريط التنقل بالصفحة الرئيسية العامة */
body:has(.hero) .navbar .nav-link,
.navbar:has(a[href="#about"]) .nav-link {
  color: #fff;
}

.nav-link--cta {
  background: transparent;
  color: #fff !important;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: none;
}

.nav-link--cta:hover,
.nav-link--cta:focus-visible {
  background: transparent;
  color: #fff !important;
}

.nav-link--cta:active {
  background: transparent;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  margin: 0 auto;
  background: var(--teal-deep);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   الهيرو
   ============================================ */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}

.hero {
  text-align: center;
  margin-bottom: 56px;
}

.eyebrow {
  color: #c9a227;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ============================================
   بطاقات المسارين
   ============================================ */
.paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  scroll-margin-top: 90px;
}

.path-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  scroll-margin-top: 90px;
}

.path-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.path-icon {
  color: var(--teal-deep);
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.path-card--halaqa {
  border-top: 2px solid #14b8a0;
}

.path-card--halaqa .path-kicker {
  background: transparent;
  border: 1px solid #14b8a0;
  color: #fff;
  border-radius: 999px;
}

.path-card--tasmee {
  border-top: 2px solid #c9a227;
}

.path-card--tasmee .path-icon {
  color: #c9a227;
}

.path-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: var(--teal-tint);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.path-card--tasmee .path-kicker {
  color: #fff;
  background: #c9a227;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.path-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: #ffffff;
  margin-bottom: 12px;
}

.path-desc {
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 26px;
  font-size: 0.95rem;
}

.path-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: white;
  background: var(--teal-deep);
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  min-height: 48px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  touch-action: manipulation;
}

.path-btn:hover {
  background: var(--teal-darker);
}

.path-btn:active {
  transform: scale(0.97);
}

.path-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.path-btn svg {
  transition: transform 0.15s ease;
}

.path-btn:hover svg {
  transform: translateX(-3px);
}

.path-card--tasmee .path-btn {
  background: #c9a227;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.path-card--tasmee .path-btn:hover {
  background: #c9a227;
  filter: brightness(1.08);
}

/* ============================================
   شريط الرسائل التتابعي (Features Ticker Carousel)
   ============================================ */
.features-ticker {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 64px;
  padding: 36px 20px 30px;
  border-top: 1px solid var(--parchment-dark);
  border-bottom: 1px solid var(--parchment-dark);
  width: 100%;
}

.ticker-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  outline: none;
}

.ticker-slides {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  min-height: 96px;
}

.ticker-slide {
  grid-area: 1 / 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  pointer-events: none;
}

.ticker-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ticker-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.ticker-hadith {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 6px;
}

.ticker-source {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.ticker-title {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
}

.ticker-desc {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 560px;
}

.ticker-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.ticker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  outline: none;
}

.ticker-dot:hover,
.ticker-dot:focus-visible {
  background: rgba(255, 255, 255, 0.45);
  transform: scale(1.2);
}

.ticker-dot.is-active {
  background: var(--teal-deep);
  transform: scale(1.15);
}

/* ============================================
   الفوتر
   ============================================ */
.page-footer {
  text-align: center;
  padding: 40px 24px;
  background: rgba(0, 17, 42, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-verse {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 8px;
}

.footer-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ============================================
   إشعار Toast بديل عن alert()
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(2, 30, 25, 0.95);
  color: white;
  padding: 14px 24px;
  border: 1px solid rgba(0, 191, 166, 0.3);
  border-radius: 10px;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1000;
  max-width: 90vw;
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   التجاوب مع الشاشات الصغيرة واللمس
   ============================================ */
@media (max-width: 760px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: rgba(2, 23, 19, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 0;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-sm);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: 14px 16px;
  }

  .paths {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 40px 18px 32px;
  }

  .features-ticker {
    margin-top: 40px;
    padding: 24px 14px 20px;
  }
  .ticker-slides {
    min-height: 108px;
  }
  .ticker-hadith {
    font-size: 1.15rem;
  }
  .ticker-title {
    font-size: 1.05rem;
  }
  .ticker-desc {
    font-size: 0.92rem;
  }
  .ticker-dot {
    width: 9px;
    height: 9px;
  }
}

/* احترام تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .path-card,
  .path-btn,
  .nav-links,
  .toast,
  .ticker-slide,
  .ticker-dot {
    transition: none !important;
  }
}

/* ============================================
   الشارات الموحدة للحالات (Unified Status Badges Base)
   قاعدة قياسية موحدة لجميع الشارات (الحجم، الارتفاع، الحشو، ونصف القطر)
   ============================================ */
.badge-status,
.live-badge,
.live-indicator {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  box-sizing: border-box !important;
  padding: 2px 8px !important;
  font-family: inherit !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  border-radius: 9999px !important;
  border-width: 1px !important;
  border-style: solid !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  text-decoration: none !important;
  user-select: none !important;
  box-shadow: none !important;
  margin: 0 !important;
}

/* حاوية تكديس الشارات في عمود الحالة */
.status-badge-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  vertical-align: middle;
}

/* 1. نوع شارة البث المباشر (أحمر فاتح + نقطة حمراء) */
.live-badge,
.live-indicator {
  flex-direction: row-reverse !important;
  gap: 5px !important;
  background-color: #fef2f2 !important;
  color: #1a1a1a !important;
  border-color: #fecaca !important;
}

.live-badge::before,
.live-indicator::before,
.live-badge .dot,
.live-indicator .dot {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  min-width: 5px;
  min-height: 5px;
  border-radius: 50%;
  background-color: #ef4444;
  flex-shrink: 0;
}

/* 2. شارة التسجيل بالحلقة (أخضر فاتح + علامة صح خضراء) */
.badge-status.enrolled-badge {
  background-color: #e8f5e9 !important;
  color: #2e7d32 !important;
  border-color: #a5d6a7 !important;
  gap: 4px !important;
}

/* 3. شارة الجلسة الفائتة / لم تنعقد */
.badge-status.missed,
.badge-status.expired {
  background-color: #fef2f2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
  gap: 4px !important;
}

/* ============================================
   تذكير الواجب والتكليف القادم للطالب في نموذج التسميع
   ============================================ */
.student-next-review-reminder {
  margin: -6px 0 16px 0;
  animation: fadeIn 0.25s ease;
}

.student-next-review-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.student-next-review-box.has-review {
  background: #fff;
  color: #1a1a1a;
  font-weight: 700;
  border: 2px solid #c9a227;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.student-next-review-box.has-review strong {
  color: #1a1a1a;
  font-weight: 700;
}

.student-next-review-box.has-review .review-highlight {
  color: #a07d12;
}

.student-next-review-box.has-review .review-icon {
  color: #c9a227;
}

.student-next-review-box.no-review {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: var(--ink-soft, #8EAC9F);
  font-size: 0.82rem;
}

.student-next-review-box .review-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* ============================================
   أزرار إجراءات جدول الحلقات (نظام الصفين المدمجين)
   ============================================ */
.halaqa-actions-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  vertical-align: middle;
  padding: 2px 0;
  box-sizing: border-box;
}

.halaqa-actions-subrow,
.halaqa-actions-group .halaqa-actions-row,
.halaqa-actions-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  vertical-align: middle;
}

