/* ═══════════════════════════════════════════════════════════════
   الوضع الداكن — Younis Code — برمجة
   يُحمَّل آخرًا ليتجاوز account / exams / android / site
   ═══════════════════════════════════════════════════════════════ */

html[data-theme="dark"] body,
html[data-theme="dark"] body.yc-platform,
html[data-theme="dark"] body.yc-code {
  background:
    radial-gradient(ellipse 90% 60% at 8% -10%, var(--page-glow-1), transparent 58%),
    radial-gradient(ellipse 70% 50% at 100% 0%, var(--page-glow-2), transparent 52%),
    var(--page-bg) !important;
  color: var(--text);
}

html[data-theme="dark"] body.yc-platform::before,
html[data-theme="dark"] body::before {
  opacity: 0.22;
  background-image: var(--ornament-tile) !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 { color: var(--text-strong); }

html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] label,
html[data-theme="dark"] .muted { color: var(--muted-strong); }

html[data-theme="dark"] .yc-stats__row,
html[data-theme="dark"] .yc-promise,
html[data-theme="dark"] .yc-float,
html[data-theme="dark"] .yc-feature,
html[data-theme="dark"] .yc-grade,
html[data-theme="dark"] .yc-grade__body {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .yc-feature--dark {
  background: var(--grad-code, var(--grad-water-air));
  color: #ffffff;
}

/* نصوص الصفحة الرئيسية أوضح في الوضع الداكن */
html[data-theme="dark"] .yc-hero__title,
html[data-theme="dark"] .yc-promise__title,
html[data-theme="dark"] .yc-feature__title,
html[data-theme="dark"] .yc-section__title,
html[data-theme="dark"] .yc-grade__name {
  color: #fff8f3 !important;
}

html[data-theme="dark"] .yc-hero__desc,
html[data-theme="dark"] .yc-promise__text,
html[data-theme="dark"] .yc-feature__text,
html[data-theme="dark"] .yc-section__sub,
html[data-theme="dark"] .yc-stat__lbl {
  color: #f0e4dc !important;
}

html[data-theme="dark"] .yc-feature--dark .yc-feature__title,
html[data-theme="dark"] .yc-feature--dark .yc-feature__text {
  color: #ffffff !important;
}

html[data-theme="dark"] .yc-cta__box {
  color: #ffffff !important;
}
html[data-theme="dark"] .yc-cta__pattern {
  opacity: 0.08;
}
html[data-theme="dark"] .yc-cta__title,
html[data-theme="dark"] .yc-cta__sub,
html[data-theme="dark"] .yc-cta__box p,
html[data-theme="dark"] .yc-cta__box h2 {
  color: #ffffff !important;
  opacity: 1 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .yc-cta .yc-btn--gold {
  color: #1a1204 !important;
  background: linear-gradient(135deg, #f0c14d, #e0a21a);
  text-shadow: none;
}

html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .auth-formPane,
html[data-theme="dark"] .auth-panel {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .auth-head__title { color: var(--text-strong) !important; }
html[data-theme="dark"] .auth-head__sub,
html[data-theme="dark"] .auth-foot,
html[data-theme="dark"] .label { color: var(--muted-strong) !important; }

html[data-theme="dark"] .input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--field-bg) !important;
  color: var(--field-text) !important;
  border-color: var(--field-border) !important;
}

html[data-theme="dark"] .input:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: var(--brand-400) !important;
  box-shadow: 0 0 0 4px var(--primary-weak) !important;
}

html[data-theme="dark"] .phy-toast {
  background: color-mix(in srgb, var(--card-bg-strong) 94%, transparent);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .acc-page,
html[data-theme="dark"] .acc-main,
html[data-theme="dark"] .acc-shell,
html[data-theme="dark"] .acc-layout {
  color: var(--text);
  background: transparent;
}

html[data-theme="dark"] .acc-topbar { background: transparent; }

html[data-theme="dark"] .acc-card,
html[data-theme="dark"] .acc-stat,
html[data-theme="dark"] .acc-course,
html[data-theme="dark"] .acc-lecture,
html[data-theme="dark"] .acc-item,
html[data-theme="dark"] .acc-notif,
html[data-theme="dark"] .acc-notification,
html[data-theme="dark"] .acc-notifs,
html[data-theme="dark"] .acc-assess-card,
html[data-theme="dark"] .acc-feedCard,
html[data-theme="dark"] .acc-chatCard,
html[data-theme="dark"] .wallet-summary__card,
html[data-theme="dark"] .wallet-history__item,
html[data-theme="dark"] .acc-settingsCard,
html[data-theme="dark"] .acc-panel,
html[data-theme="dark"] .acc-box,
html[data-theme="dark"] .acc-empty,
html[data-theme="dark"] .acc-tableWrap {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .acc-card__head h2,
html[data-theme="dark"] .acc-course__title,
html[data-theme="dark"] .acc-lecture__title,
html[data-theme="dark"] .acc-item__title,
html[data-theme="dark"] .acc-notif__title,
html[data-theme="dark"] .acc-notification__title,
html[data-theme="dark"] .acc-notifs__title,
html[data-theme="dark"] .acc-assess-card__title,
html[data-theme="dark"] .wallet-history__title,
html[data-theme="dark"] .wallet-summary__value { color: var(--text-strong) !important; }

html[data-theme="dark"] .acc-card__head p,
html[data-theme="dark"] .acc-course__grade,
html[data-theme="dark"] .acc-item__meta,
html[data-theme="dark"] .acc-stat__lbl,
html[data-theme="dark"] .acc-hero__sub,
html[data-theme="dark"] .acc-assess-card__meta,
html[data-theme="dark"] .wallet-summary__label,
html[data-theme="dark"] .wallet-history__meta,
html[data-theme="dark"] .acc-assess-empty { color: var(--muted-strong) !important; }

html[data-theme="dark"] .acc-assess-empty {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .acc-input,
html[data-theme="dark"] .acc-field input,
html[data-theme="dark"] .acc-field select,
html[data-theme="dark"] select.acc-input,
html[data-theme="dark"] textarea.acc-input,
html[data-theme="dark"] .acc-commentForm textarea,
html[data-theme="dark"] .acc-chatSend textarea {
  background: var(--field-bg) !important;
  color: var(--field-text) !important;
  border-color: var(--field-border) !important;
}

html[data-theme="dark"] .acc-btn--ghost,
html[data-theme="dark"] .acc-btnx--ghost {
  background: var(--card-soft) !important;
  color: var(--primary) !important;
  border-color: var(--border-strong) !important;
}

html[data-theme="dark"] .acc-bell,
html[data-theme="dark"] .acc-burger {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--gold-border) !important;
  color: var(--gold-300) !important;
}

html[data-theme="dark"] .acc-notifs__head {
  background: linear-gradient(180deg, var(--card-bg-strong), var(--card-bg)) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .acc-notifs__close {
  background: var(--card-soft) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
}

html[data-theme="dark"] .acc-notifs__loading,
html[data-theme="dark"] .acc-notifs__empty,
html[data-theme="dark"] .acc-notifs__err,
html[data-theme="dark"] .acc-notifications-empty {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
  color: var(--muted) !important;
}

html[data-theme="dark"] .acc-course__cover {
  background:
    radial-gradient(circle at 20% 20%, var(--surface-highlight), transparent 40%),
    radial-gradient(circle at 80% 60%, var(--surface-strong), transparent 50%),
    linear-gradient(135deg, rgba(20, 163, 168, 0.16), rgba(0, 0, 0, 0.28));
}

html[data-theme="dark"] .acc-badge,
html[data-theme="dark"] .acc-reactionBtn {
  background: var(--card-soft) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .acc-lecture__row,
html[data-theme="dark"] .acc-lectureInfo__row,
html[data-theme="dark"] .acc-item,
html[data-theme="dark"] .acc-chatMsg,
html[data-theme="dark"] .acc-comment {
  background: var(--card-soft) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .acc-lecture__lock,
html[data-theme="dark"] .acc-item__lock {
  background: var(--surface-highlight) !important;
  border-color: var(--gold-border) !important;
  color: var(--gold-300) !important;
}

html[data-theme="dark"] .acc-sidebar.is-open,
html[data-theme="dark"] body:has(#accSideNavToggle:checked) .acc-sidebar,
html[data-theme="dark"] body.acc-sidebar-open .acc-sidebar,
html.android-native-app[data-theme="dark"] .acc-sidebar.is-open {
  background: var(--brand-900) !important;
  border-color: var(--gold-border) !important;
  color: var(--text-strong) !important;
}

html[data-theme="dark"] .acc-nav__ico { color: var(--beige-400); }
html[data-theme="dark"] .acc-nav__item.is-active .acc-nav__ico { color: var(--gold-300); }

html[data-theme="dark"] .acc-stat__ico {
  background: rgba(94, 228, 232, 0.12) !important;
  border: 1px solid var(--gold-border) !important;
  color: var(--gold-300) !important;
}

html[data-theme="dark"] .acc-alert--success {
  background: var(--success-soft-bg) !important;
  border-color: var(--success-soft-border) !important;
  color: #7dcea0 !important;
}

html[data-theme="dark"] .acc-alert--error {
  background: var(--danger-soft-bg) !important;
  border-color: var(--danger-soft-border) !important;
  color: #f0a0a0 !important;
}

html[data-theme="dark"] .wallet-history__amount.is-positive { color: #7dcea0 !important; }

html[data-theme="dark"] table,
html[data-theme="dark"] .as-table,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .as-modal__card,
html[data-theme="dark"] .as-q,
html[data-theme="dark"] .as-nav {
  background: var(--card-bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .metric-val { color: var(--gold-300); }

html[data-theme="dark"] .timer-pill {
  background: rgba(247, 210, 122, 0.12) !important;
  border-color: var(--gold-border) !important;
  color: var(--gold-300) !important;
}

html[data-theme="dark"] .as-choice,
html[data-theme="dark"] .as-option {
  background: var(--card-soft) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .acc-viewerChrome,
html[data-theme="dark"] .acc-lectureToolbar,
html[data-theme="dark"] .acc-videoShell,
html[data-theme="dark"] .acc-playerBar {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .theme-switch,
html[data-theme="dark"] .theme-switch--pro,
html[data-theme="dark"] .acc-theme.theme-switch--pro {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--gold-border) !important;
}

html[data-theme="dark"] .pr-topbar__bar,
html[data-theme="dark"] .pr-card,
html[data-theme="dark"] .pr-profile-card,
html[data-theme="dark"] .pr-section {
  background: var(--card-bg) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

/* تجاوز الخمري القديم في الحساب وتقارير ولي الأمر */
.acc-brand__logoFallback,
html[data-theme="dark"] .acc-brand__logoFallback,
.pr-brand__logoFallback {
  background: var(--grad-brand) !important;
}

body.yc-platform .acc-sidebar,
body.yc-platform .acc-side {
  background: var(--card-bg);
}

html[data-theme="dark"] body.yc-platform .acc-sidebar.is-open {
  background: #052028 !important;
}

html.theme-switching,
html.theme-switching * {
  transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease !important;
}
