/* ============================================================
   الوضع الليلي — ملف مستقل يُحمَّل بعد بقية ملفات CSS ليغلب
   على القواعد المتأخرة. لا يؤثر على الوضع النهاري إطلاقًا.
   ============================================================ */

/* ============================================================
   الوضع الليلي للصفحة الرئيسية — مشروط بـ data-theme="dark"
   فلا يتأثر الوضع النهاري إطلاقًا.
   ============================================================ */
html[data-theme="dark"] {
  --white: #151f33;
  --bg-light: #0d1524;
  --border: #243349;
  --text: #dbe4f2;
  --text-light: #9aabc4;
  --text2: #9aabc4;
  --text3: #b6c4d8;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background: #0d1524;
  color: var(--text);
}
html[data-theme="dark"] section,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
  background: #0d1524 !important;
}
html[data-theme="dark"] .hero {
  background: #0a1120;
}
html[data-theme="dark"] .nav .btn-gold,
html[data-theme="dark"] .pillar .ic {
  background: #0492c2;
  color: white;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .single-course,
html[data-theme="dark"] .edu-card,
html[data-theme="dark"] .service-item,
html[data-theme="dark"] .testimonial-item,
html[data-theme="dark"] .team-item,
html[data-theme="dark"] .modal-content {
  background: #151f33 !important;
  border-color: #243349 !important;
  color: var(--text);
}
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .dnav,
html[data-theme="dark"] header,
html[data-theme="dark"] .artifact-top {
  background: #111a2b !important;
}
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
  color: #eaf1fb;
}
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] span,
html[data-theme="dark"] td,
html[data-theme="dark"] label {
  color: var(--text);
}

html[data-theme="dark"] .soc,
html[data-theme="dark"] .drop-menu a,
html[data-theme="dark"] .dtopbar-social a {
  /* color: #0492c2; */
  color: white;
}
html[data-theme="dark"] .dtopbar-left span {
  color: #0492c2;
}
html[data-theme="dark"] .soc.act {
  color: #0492c2;
  /* color: white; */
}
html[data-theme="dark"] a,
html[data-theme="dark"] .lesson span {
  color: #0492c2;
  /* color: white; */
}

html[data-theme="dark"] .dt-icon,
html[data-theme="dark"] .hero-cta a,
html[data-theme="dark"] .btns a {
  /* color: #7cc4e8; */
  color: white;
}
html[data-theme="dark"] .brand b span {
  /* color: #7cc4e8; */
  color: #f7631b;
}
html[data-theme="dark"] .burger {
  /* color: #7cc4e8; */
  color: #0492c2;
}
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body {
  color: var(--text) !important;
}
html[data-theme="dark"] .c-title,
html[data-theme="dark"] .c-meta span,
html[data-theme="dark"] .tech {
  /* color: var(--text) !important; */
  color: black !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control {
  background: #0f1828;
  border-color: #243349;
  color: var(--text);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #6f819b;
}
html[data-theme="dark"] .table {
  color: var(--text);
}
html[data-theme="dark"] .footer,
html[data-theme="dark"] footer {
  background: #0a1120 !important;
}

/* زر تبديل الثيم في الهيدر */
.theme-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  /* background: var(--white); */
  background: #0492c2;
  /* color: var(--text); */
  color: white;
  cursor: pointer;
  font-size: 14px;
  margin-inline-start: 8px;
  transition: var(--transition);
}
.theme-btn:hover {
  /* background: var(--bg-light); */
  background: #f7631b;
  color: white;
}
html[data-theme="dark"] .theme-btn:hover {
  background: #233150;
}

/* روابط القائمة والبطاقات تستخدم --dark (#1a1a2e) كلون نص،
   فتبقى غير مقروءة على خلفية داكنة. نعالجها هنا فقط. */
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .navbar-nav .nav-link,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .dnav a {
  color: #dbe4f2 !important;
}
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .dropdown-item:hover {
  color: #7cc4e8 !important;
}
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .flag-orbit {
  background: #151f33;
  border-color: #243349;
}
html[data-theme="dark"] .single-course *,
html[data-theme="dark"] .edu-card *,
html[data-theme="dark"] .service-item *,
html[data-theme="dark"] .card * {
  color: inherit;
}
html[data-theme="dark"] .single-course .c-title a,
html[data-theme="dark"] .edu-card .edu-title a {
  color: #eaf1fb;
}
html[data-theme="dark"] .c-desc,
html[data-theme="dark"] .edu-desc,
html[data-theme="dark"] .edu-teacher {
  color: #9aabc4;
}
html[data-theme="dark"] .c-desc,
html[data-theme="dark"] .flagship .eyebrow,
html[data-theme="dark"] .flagship .intro,
html[data-theme="dark"] .feat b,
html[data-theme="dark"] .feat p,
html[data-theme="dark"] .outcome p {
  /* color: #9aabc4; */
  color: black;
}

/* قواعد القائمة عندك بتحديد عالٍ (.navbar .navbar-nav .nav-item.nav-link)،
   فنطابق تحديدها داخل الوضع الليلي فقط. */
html[data-theme="dark"] .navbar .navbar-nav .nav-item.nav-link,
html[data-theme="dark"] .navbar .navbar-nav .nav-link,
html[data-theme="dark"] .navbar-nav .nav-link {
  color: #dbe4f2 !important;
}
html[data-theme="dark"] .navbar .navbar-nav .nav-item.nav-link:hover,
html[data-theme="dark"] .navbar .navbar-nav .nav-link.active {
  color: #7cc4e8 !important;
}

/* بطاقات المزايا وما شابهها تستخدم ألوان نص ثابتة داكنة */
html[data-theme="dark"] .single-feature,
html[data-theme="dark"] .single-feature *,
html[data-theme="dark"] .desc-wrap,
html[data-theme="dark"] .desc-wrap *,
html[data-theme="dark"] .feature-item,
html[data-theme="dark"] .feature-item * {
  color: #dbe4f2;
}
html[data-theme="dark"] .single-feature h1,
html[data-theme="dark"] .single-feature h2,
html[data-theme="dark"] .single-feature h3,
html[data-theme="dark"] .single-feature h4,
html[data-theme="dark"] .single-feature h5,
html[data-theme="dark"] .vision .by {
  color: #eaf1fb;
}
html[data-theme="dark"] .single-feature {
  background: #151f33;
  border-color: #243349;
}

/* قواعد بتحديد أعلى داخل الوضع الليلي فقط */
html[data-theme="dark"] .single-feature .desc-wrap p,
html[data-theme="dark"] .single-feature .desc-wrap h4,
html[data-theme="dark"] .single-feature .desc-wrap * {
  color: #dbe4f2;
}
html[data-theme="dark"] .single-feature .desc-wrap h4,
html[data-theme="dark"] .single-feature h4 {
  color: #eaf1fb;
}
/* ============================================================
   صفحة تفاصيل الكورس: تنسيقاتها داخلية بمتغيّرات خاصة
   (--paper / --parchment / --line) فلا تصلها القواعد العامة.
   نعيد تعريفها هنا داخل الوضع الليلي فقط.
   ============================================================ */
html[data-theme="dark"] {
  --paper: #151f33;
  --paper-2: #111a2b;
  --parchment: #111a2b;
  --parchment-2: #0d1524;
  --line: #243349;
  --line-2: #1d293d;
  --ink: #e8eef8;
  --ink-700: #c3d1e6;
  --ink-900: #f2f6fc;
  --text: #dbe4f2;
  --muted: #9aabc4;
}
html[data-theme="dark"] .nav {
  background: rgba(17, 26, 43, 0.92) !important;
  border-color: #243349;
}
html[data-theme="dark"] .subnav {
  background: #111a2b !important;
  border-color: #243349;
}
html[data-theme="dark"] .subnav a {
  /* color: #9aabc4; */
  color: white;
}
html[data-theme="dark"] .subnav a.active {
  color: #eaf1fb;
}
html[data-theme="dark"] .section {
  border-color: #1d293d;
}
html[data-theme="dark"] .enroll-band {
  background: #111a2b;
}
html[data-theme="dark"] .btn-light {
  color: #0492c2;
}

html[data-theme="dark"] .hero-watch {
  color: white;
}
html[data-theme="dark"] .mbar .p b,
html[data-theme="dark"] .mbar .p small {
  color: #0492c2;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .fmt-card,
html[data-theme="dark"] .rel-card,
html[data-theme="dark"] .enroll-card,
.enroll-top,
html[data-theme="dark"] .module,
html[data-theme="dark"] .obj-card,
html[data-theme="dark"] .aud-card,
html[data-theme="dark"] .assess-card {
  background: #151f33 !important;
  border-color: #243349;
  color: #dbe4f2;
}

html[data-theme="dark"] .enroll-top {
  background: #0492c2 !important;
  border-color: #243349;
  color: #151f33;
}
html[data-theme="dark"] .enroll-top .fmt {
  color: white;
}
html[data-theme="dark"] .mod-head {
  background: none;
  color: #e8eef8;
}
html[data-theme="dark"] .cert-frame {
  background: #141d2e;
  border-color: #2b3a52;
}
html[data-theme="dark"] .cert-frame * {
  color: #dbe4f2;
}
html[data-theme="dark"] .cert-frame h4,
html[data-theme="dark"] .cert-frame .name,
html[data-theme="dark"] .cert-frame .course b {
  color: #f2f6fc;
}
html[data-theme="dark"] .mobile-menu.open {
  background: #0d1524;
}
html[data-theme="dark"] .mobile-menu a {
  color: #dbe4f2;
}
