/* =========================================================
   منصة زادُنا التعليمية — style.css
   لوحة ألوان مريحة: أبيض، رمادي فاتح، ولمسات أخضر غامق
   ========================================================= */

:root {
    --green: #14724f;
    --green-dark: #0e5238;
    --green-soft: #e7f3ee;
    --gold: #d4a017;
    --accent: #2563eb;

    --white: #ffffff;
    --bg: #f6f8fa;
    --surface: #ffffff;
    --ink: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px -12px rgba(16, 24, 40, 0.18);
    --shadow-sm: 0 4px 14px -8px rgba(16, 24, 40, 0.25);
    --container: 1140px;
}

/* =========================================================
   الوضع الداكن (Dark Mode) — يُفعّل عبر زر التبديل
   ========================================================= */
html[data-theme="dark"] {
    --green-soft: #16352b;
    --white: #1e293b;
    --bg: #0b1220;
    --surface: #1e293b;
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 4px 14px -8px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .navbar { background: rgba(11, 18, 32, 0.85); border-bottom-color: var(--border); }
html[data-theme="dark"] .nav-links a { color: var(--ink); }
html[data-theme="dark"] .path,
html[data-theme="dark"] .courses,
html[data-theme="dark"] .features { background: var(--bg); }
html[data-theme="dark"] .hero { background: var(--bg); }
html[data-theme="dark"] .hero::before { opacity: .38; filter: saturate(.9) brightness(.7); }
html[data-theme="dark"] .hero::after {
    background:
        linear-gradient(105deg, rgba(11,18,32,.92) 0%, rgba(11,18,32,.78) 45%, rgba(11,18,32,.62) 100%),
        radial-gradient(ellipse 70% 55% at 12% 48%, rgba(20,184,166,.12), transparent 68%);
}
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .teacher-card,
html[data-theme="dark"] .course-card { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .section-head p,
html[data-theme="dark"] .course-desc,
html[data-theme="dark"] .teacher-tags { color: var(--muted); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background: var(--surface); color: var(--ink); border-color: var(--border); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b; }

/* =========================================================
   زر تبديل المظهر (Theme Toggle) — تصميم احترافي
   ========================================================= */
.theme-toggle {
    background: none; border: none; padding: 0; margin: 0; cursor: pointer;
    display: inline-flex; align-items: center; -webkit-tap-highlight-color: transparent;
}
.theme-toggle .tt-track {
    position: relative; width: 62px; height: 30px; border-radius: 999px;
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, .25); transition: background .3s ease;
}
.theme-toggle .tt-ic { font-size: 14px; line-height: 1; z-index: 1; transition: opacity .3s ease; }
.theme-toggle .tt-sun { color: #fffbeb; }
.theme-toggle .tt-moon { color: #fde68a; opacity: .55; }
.theme-toggle .tt-knob {
    position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    transition: transform .3s cubic-bezier(.4, 1.3, .5, 1), background .3s ease;
}
.theme-toggle.is-dark .tt-track { background: linear-gradient(135deg, #1e293b, #475569); }
.theme-toggle.is-dark .tt-knob { transform: translateX(-32px); background: #f8fafc; }
.theme-toggle.is-dark .tt-sun { opacity: .45; }
.theme-toggle.is-dark .tt-moon { opacity: 1; }
.theme-toggle:hover .tt-track { filter: brightness(1.05); }
.theme-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 999px; }
.theme-toggle-float { position: fixed; top: 14px; left: 14px; z-index: 1300; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Tajawal', system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Cairo', 'Tajawal', sans-serif; line-height: 1.35; color: var(--ink); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { width: min(var(--container), 92%); margin-inline: auto; }

/* ===== الأزرار — تصميم عصري بتدرّجات وظلال متعددة الطبقات وتفاعلات ناعمة ===== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 26px;
    border-radius: 999px;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .2px;
    cursor: pointer;
    border: 1.5px solid transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease, background .25s ease, color .2s ease, border-color .2s ease, filter .2s ease;
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(20, 114, 79, .28); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.btn-lg { padding: 15px 34px; font-size: 1.06rem; }
.btn-sm { padding: 9px 18px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn svg, .btn i[data-lucide] { width: 18px; height: 18px; stroke-width: 2.4; flex-shrink: 0; }
.btn-sm svg, .btn-sm i[data-lucide] { width: 16px; height: 16px; }
.btn-lg svg, .btn-lg i[data-lucide] { width: 20px; height: 20px; }

/* تأثير زجاجي لامع ثلاثي الأبعاد للزر الأساسي */
.btn-primary {
    background: linear-gradient(160deg, #2bb672 0%, var(--green) 50%, var(--green-dark) 100%);
    color: #fff;
    box-shadow:
        0 10px 26px -10px rgba(20, 114, 79, .6),
        inset 0 2px 1px rgba(255, 255, 255, .35),
        inset 0 -4px 8px rgba(3, 40, 26, .22);
}
.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow:
        0 18px 34px -10px rgba(20, 114, 79, .7),
        inset 0 2px 1px rgba(255, 255, 255, .45),
        inset 0 -4px 8px rgba(3, 40, 26, .25);
}
.btn-primary:active {
    filter: brightness(.98);
    box-shadow:
        0 6px 14px -8px rgba(20, 114, 79, .6),
        inset 0 2px 6px rgba(3, 40, 26, .35);
}
.btn-primary:disabled { background: #9bbdb0; color: #f0f4f2; box-shadow: none; cursor: default; transform: none; filter: none; }

.btn-outline {
    background: linear-gradient(160deg, #ffffff, var(--surface));
    color: var(--green);
    border-color: var(--green);
    box-shadow: 0 6px 16px -11px rgba(16, 24, 40, .4), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.btn-outline:hover { background: var(--green-soft); color: var(--green-dark); border-color: var(--green-dark); box-shadow: 0 14px 26px -12px rgba(20, 114, 79, .45), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-outline:active { background: var(--green-soft); box-shadow: inset 0 2px 6px rgba(20, 114, 79, .18); }
.btn-outline:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* ===== الشريط العلوي Navbar ===== */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.logo { display: flex; align-items: center; }
.logo-img { height: 58px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-weight: 600; color: var(--ink); position: relative; transition: color .2s; }
.nav-links a:hover { color: var(--green); }
.nav-links a::after {
    content: ""; position: absolute; bottom: -6px; right: 0;
    width: 0; height: 2px; background: var(--green); transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.7rem; cursor: pointer; color: var(--green-dark); }

/* ===== القوائم المنسدلة في شريط التنقّل (Dropdown) ===== */
.nav-item { position: relative; display: inline-flex; align-items: center; }
.nav-trigger { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.nav-trigger .dd-chevron { width: 15px; height: 15px; transition: transform .28s ease; opacity: .8; }
.nav-item:hover .nav-trigger { color: var(--green); }
.nav-item:hover .dd-chevron, .nav-item.open-dd .dd-chevron { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; top: calc(100% + 14px); right: 0; width: 250px;
    background: #ffffff; border: 1px solid #eef0f3; border-radius: 12px;
    box-shadow: 0 16px 34px -16px rgba(16, 24, 40, .26); padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
    z-index: 1300;
}
/* جسر شفّاف يمنع اختفاء القائمة عند عبور الفجوة بالماوس */
.dropdown-menu::before { content: ""; position: absolute; top: -16px; left: 0; right: 0; height: 16px; }
.nav-item:hover .dropdown-menu, .nav-item.open-dd .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dd-head { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .3px; color: #94a3b8; padding: 4px 10px 8px; text-transform: uppercase; }
.dd-list { display: flex; flex-direction: column; gap: 2px; }
.dd-list.dd-scroll { max-height: 290px; overflow-y: auto; padding-left: 2px; }
.dd-list.dd-scroll::-webkit-scrollbar { width: 7px; }
.dd-list.dd-scroll::-webkit-scrollbar-thumb { background: rgba(20, 114, 79, .35); border-radius: 999px; }
.dd-list.dd-scroll::-webkit-scrollbar-track { background: transparent; }
.dd-list.dd-scroll { scrollbar-width: thin; scrollbar-color: rgba(20, 114, 79, .4) transparent; }
.dd-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; transition: background .18s ease, color .18s ease; }
.dd-item:hover { background: rgba(20, 194, 194, .12); }
.dd-thumb, .dd-ava { width: 38px; height: 38px; flex-shrink: 0; overflow: hidden; background: var(--green-soft); display: grid; place-items: center; font-size: 1rem; }
.dd-thumb { border-radius: 10px; }
.dd-ava { border-radius: 50%; font-weight: 800; color: var(--green-dark); }
.dd-thumb img, .dd-ava img { width: 100%; height: 100%; object-fit: cover; }
.dd-meta { display: flex; flex-direction: column; min-width: 0; }
.dd-meta b { font-size: .9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; transition: color .18s ease; }
.dd-meta small { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.dd-item:hover .dd-meta b { color: #0e9c9c; }
.dd-all {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px;
    padding: 11px; border-radius: 11px; font-weight: 800; font-size: .88rem; color: #fff;
    background-image: linear-gradient(120deg, #1a988e, #147a72); box-shadow: 0 8px 20px -12px rgba(20, 114, 79, .6);
    transition: filter .2s ease, transform .2s ease;
}
.dd-all svg { width: 16px; height: 16px; }
.dd-all:hover { filter: brightness(1.07); transform: translateY(-1px); }
.dd-loading, .dd-empty { padding: 16px; text-align: center; color: var(--muted); font-weight: 600; font-size: .85rem; }
.dropdown-menu a::after { content: none !important; }
.dropdown-menu a:hover { color: inherit; }

/* ===== إصلاح صارم لتخطيط شريط التنقّل والقوائم المنسدلة ===== */
.navbar svg, .dropdown-menu svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.navbar .nav-trigger .dd-chevron { width: 15px !important; height: 15px !important; }
.has-dropdown, .nav-item { position: relative !important; }
.dropdown-menu {
    position: absolute !important; top: calc(100% + 14px) !important; right: 0;
    min-width: 240px; z-index: 1300 !important;
}
.dropdown-menu .dd-item, .dropdown-menu .dd-all { display: flex !important; align-items: center; width: 100%; }
.dropdown-menu .dd-item .dd-meta { flex: 1; min-width: 0; }
html[data-theme="dark"] .dropdown-menu { background: #1e293b; border-color: #334155; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .dd-meta b { color: #e2e8f0; }
html[data-theme="dark"] .dd-item:hover { background: rgba(20, 194, 194, .18); }

/* ===== القسم الترحيبي Hero ===== */
.hero {
    position: relative; padding: 96px 0 88px; overflow: hidden;
    background: var(--bg);
}
.hero::before {
    content: "";
    position: absolute; inset: 0; z-index: 0;
    background:
        url("assets/hero-bg.png") center center / cover no-repeat;
    opacity: .52;
    transform: scale(1.03);
    filter: saturate(1.05) contrast(1.02);
}
.hero::after {
    content: "";
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(105deg, rgba(255,255,255,.88) 0%, rgba(255,255,255,.72) 42%, rgba(255,255,255,.55) 100%),
        radial-gradient(ellipse 80% 60% at 15% 50%, rgba(14,143,134,.08), transparent 70%);
}
.hero-inner { position: relative; z-index: 2; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.eyebrow {
    display: inline-block; background: var(--green-soft); color: var(--green-dark);
    padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: .9rem; margin-bottom: 20px;
}
.hero h1 {
    font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 800; margin-bottom: 18px;
    text-shadow: 0 1px 2px rgba(255,255,255,.6);
}
.hero h1 .highlight { color: var(--green); }
.hero p {
    font-size: 1.15rem; color: var(--ink); max-width: 540px; margin-bottom: 32px;
    line-height: 1.85; text-shadow: 0 1px 1px rgba(255,255,255,.45);
}
html[data-theme="dark"] .hero h1 { text-shadow: 0 2px 12px rgba(0,0,0,.35); }
html[data-theme="dark"] .hero p { color: var(--muted); text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.hero .eyebrow {
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(14,143,134,.12);
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; display: grid; place-items: center; isolation: isolate; }
.hero-visual::before {
    content: ""; position: absolute; z-index: -2; width: 86%; aspect-ratio: 1 / 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 114, 79, 0.30), transparent 66%);
    filter: blur(10px); animation: glowPulse 6s ease-in-out infinite;
}
.hero-visual::after {
    content: ""; position: absolute; z-index: -1; width: 60%; aspect-ratio: 1 / 1; border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.22), transparent 64%);
    filter: blur(16px); animation: glowPulse 7.5s ease-in-out infinite reverse;
}
.hero-logo {
    width: min(480px, 100%); height: auto;
    filter: drop-shadow(0 18px 26px rgba(14, 82, 56, 0.32)) drop-shadow(0 0 24px rgba(20, 114, 79, 0.30));
    animation: floaty 6s ease-in-out infinite; will-change: transform, filter;
}
@keyframes floaty { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-16px) scale(1.02); } }
@keyframes floatySoft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes glowPulse { 0%,100% { opacity: .5; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
    .hero-logo, .hero-visual::before, .hero-visual::after,
    .footer-logo img, .footer-logo::before { animation: none; }
}

/* ===== رؤوس الأقسام ===== */
.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* ===== قسم: اختر مسارك التعليمي ===== */
.path { padding: 80px 0; background: var(--bg); }
.path-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 22px;
    max-width: 720px;
    margin: 0 auto 44px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-weight: 700; color: var(--ink); font-size: .98rem; }
.select-wrap { position: relative; }
.select-wrap::after {
    content: "⌄";
    position: absolute; left: 16px; top: 50%; transform: translateY(-60%);
    font-size: 1.2rem; color: var(--green); pointer-events: none;
}
.select-wrap select {
    width: 100%;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    font-family: 'Tajawal', sans-serif; font-size: 1rem; font-weight: 600;
    color: var(--ink); background: var(--surface);
    border: 1.5px solid var(--border); border-radius: 12px;
    padding: 13px 18px 13px 40px;
    cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.select-wrap select:hover { border-color: #c7d0da; }
.select-wrap select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,114,79,.15); }
.field.is-disabled { opacity: .55; }
.field.is-disabled .select-wrap select { cursor: not-allowed; background: #f1f3f5; }
.field.is-disabled .select-wrap::after { color: var(--muted); }
.field-hint { font-size: .82rem; color: var(--muted); min-height: 1.1em; }
.field.is-disabled .field-hint { color: var(--green); font-weight: 600; }
.field:not(.is-disabled) .field-hint { visibility: hidden; }

/* شبكة المدرّبين */
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}
.teacher-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 22px;
    text-align: center;
    transition: opacity .35s ease, transform .35s ease, box-shadow .25s ease, border-color .25s ease;
}
.teacher-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--green-soft); }
.teacher-card.is-hidden { opacity: 0; transform: translateY(12px) scale(.96); }
.teacher-avatar {
    width: 76px; height: 76px; margin: 0 auto 14px;
    border-radius: 50%; display: grid; place-items: center; font-size: 2.1rem;
    background: var(--green-soft);
}
.teacher-avatar.a1 { background: #e0f2fe; }
.teacher-avatar.a2 { background: #fef3c7; }
.teacher-avatar.a3 { background: #ede9fe; }
.teacher-avatar.a4 { background: #dcfce7; }
.teacher-avatar.a5 { background: #ffe4e6; }
.teacher-avatar.a6 { background: #cffafe; }
.teacher-avatar.a7 { background: #fae8ff; }
.teacher-avatar.a8 { background: #ecfccb; }
.teacher-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.teacher-subject { color: var(--green-dark); font-weight: 700; margin-bottom: 4px; }
.teacher-tags { color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.no-results {
    text-align: center; color: var(--muted); font-weight: 600;
    margin-top: 28px; padding: 22px; border: 1.5px dashed var(--border); border-radius: var(--radius);
}

/* ===== قسم المميزات Features ===== */
.features { padding: 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 26px; }
.feature-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 34px 28px; text-align: center;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--green-soft); }
.feature-icon {
    position: relative; width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, #1aa899, #0e8f86 55%, #0c7a72);
    box-shadow: 0 12px 26px -10px rgba(14,143,134,.65), inset 0 1px 0 rgba(255,255,255,.35);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
}
.feature-icon::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(120% 80% at 30% 18%, rgba(255,255,255,.45), rgba(255,255,255,0) 55%);
}
.feature-icon svg.lucide, .feature-icon svg {
    width: 34px; height: 34px; color: #fff; stroke-width: 2.1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); position: relative; z-index: 1;
}
.feature-card:hover .feature-icon {
    transform: translateY(-4px) rotate(-4deg) scale(1.06);
    box-shadow: 0 18px 34px -10px rgba(14,143,134,.75), inset 0 1px 0 rgba(255,255,255,.45);
}
html[data-theme="dark"] .feature-icon {
    background: linear-gradient(145deg, #14b8a6, #0d9488 55%, #0f766e);
    box-shadow: 0 12px 26px -10px rgba(13,148,136,.6), inset 0 1px 0 rgba(255,255,255,.25);
}
.feature-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.feature-card p { color: var(--muted); }

/* =========================================================
   قسم الكورسات المتاحة — بطاقات احترافية متداخلة (RTL)
   ========================================================= */
.courses { padding: 80px 0; background: linear-gradient(180deg, var(--white), var(--bg)); }
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.courses-load-more {
    display: none; align-items: center; justify-content: center; gap: .5rem;
    margin: 1.75rem auto 0; padding: .85rem 1.8rem; border: 0; border-radius: 999px;
    background: linear-gradient(135deg, #0e8f86, #147a72); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer;
    box-shadow: 0 10px 24px -8px rgba(14,143,134,.55);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.courses-load-more:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(14,143,134,.65); }
.courses-load-more:disabled { opacity: .7; cursor: wait; }
.course-card {
    position: relative;
    transition: transform .3s ease;
}
.course-card:hover { transform: translateY(-8px); }

/* صورة الغلاف (تأخذ العرض بالكامل) */
.course-media {
    position: relative;
    height: 190px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.course-thumb {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    font-size: 3.6rem; color: #fff;
}
.course-banner-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.c-arabic  { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.c-math    { background: linear-gradient(135deg, #14724f, #22c55e); }
.c-physics { background: linear-gradient(135deg, #7c3aed, #db2777); }

/* ===== لوحة «من نحن» القابلة للطي في الفوتر ===== */
.about-toggle {
    margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: rgba(20,194,194,.12); color: #14c2c2; border: 1.5px solid rgba(20,194,194,.45);
    font-family: inherit; font-weight: 800; font-size: .9rem; padding: 10px 18px; border-radius: 999px;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.about-toggle:hover { background: rgba(20,194,194,.22); transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(20,194,194,.6); }
.about-toggle svg.lucide { width: 18px; height: 18px; }
.about-toggle .about-chev { transition: transform .3s ease; }
.about-toggle[aria-expanded="true"] .about-chev { transform: rotate(180deg); }

.about-panel { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .55s ease, opacity .45s ease, margin .45s ease; }
.about-panel.open { max-height: 3200px; opacity: 1; margin: 6px 0 26px; }
.about-card {
    max-width: 920px; margin: 0 auto; text-align: start; line-height: 1.95;
    background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px; padding: 30px 32px; color: #cbd5e1;
}
.about-card .about-title { color: #14c2c2; font-size: 1.45rem; margin: 0 0 16px; text-align: center; font-weight: 800; }
.about-card h4 { color: #14c2c2; font-weight: 800; font-size: 1.1rem; margin: 22px 0 8px; }
.about-card p { margin: 0 0 12px; }
.about-card ul { margin: 0 0 12px; padding: 0; list-style: none; }
.about-card li { position: relative; padding-inline-start: 26px; margin-bottom: 11px; }
.about-card li::before { content: "✦"; position: absolute; inset-inline-start: 0; top: 0; color: #14c2c2; font-weight: 800; }
.about-card li b { color: #f1f5f9; }
.about-dua { color: #14c2c2; font-weight: 700; text-align: center; line-height: 2.1;
    background: rgba(20,194,194,.1); border: 1px solid rgba(20,194,194,.25); border-radius: 14px; padding: 16px; margin-top: 16px; }
@media (max-width: 600px) { .about-card { padding: 22px 18px; } }

/* شريط مميز مائل بلون وردي فاقع */
.course-ribbon {
    position: absolute;
    top: 20px;
    left: -44px;
    transform: rotate(-45deg);
    background: #ec4899;
    color: #fff;
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .3px;
    padding: 7px 48px;
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.45);
}

/* صندوق المحتوى الأبيض المتداخل مع الصورة */
.course-content {
    position: relative;
    z-index: 2;
    margin: -44px 16px 0;              /* الهامش العلوي السالب يصنع التداخل */
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 16px 36px -16px rgba(16, 24, 40, 0.28);
    padding: 20px 20px 16px;
}

/* شارة المادة الصفراء */
.course-badge {
    display: inline-block;
    background: #facc15;
    color: #4a3700;
    font-weight: 800;
    font-size: .76rem;
    padding: 5px 12px;
    border-radius: 9px;
    margin-bottom: 12px;
    box-shadow: 0 5px 12px -5px rgba(250, 204, 21, 0.9);
}
.course-title { font-size: 1.18rem; margin-bottom: 8px; }
.course-desc { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }

/* أزرار الإجراء */
.course-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.tag {
    display: inline-flex; align-items: center;
    padding: 7px 16px; border-radius: 999px;
    font-size: .82rem; font-weight: 700;
    cursor: pointer; border: 1.6px solid transparent;
    transition: transform .2s, background .2s, color .2s;
}
.tag:hover { transform: translateY(-2px); }
.tag-outline { color: var(--green); border-color: var(--green); background: transparent; }
.tag-outline:hover { background: var(--green-soft); }
.tag-solid { background: var(--green); color: #fff; }
.tag-solid:hover { background: var(--green-dark); }

/* تذييل البطاقة */
.course-footer {
    display: flex; flex-wrap: wrap; gap: 14px;
    padding-top: 12px; border-top: 1px solid var(--border);
}
.cf-item { font-size: .74rem; color: #9aa3af; display: inline-flex; align-items: center; gap: 5px; }
/* شارة اسم المعلّم المتوهجة على بطاقة الكورس */
.cf-teacher-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 800;
    color: #fff; padding: .32rem .8rem; border-radius: 999px;
    background: linear-gradient(135deg,#0f766e,#115e56);
    box-shadow: 0 0 0 1px rgba(20,184,166,.35), 0 4px 12px rgba(15,118,110,.4);
    animation: cfBadgeGlow 2.6s ease-in-out infinite; }
@keyframes cfBadgeGlow { 0%,100% { box-shadow: 0 0 0 1px rgba(20,184,166,.35), 0 4px 12px rgba(15,118,110,.35); } 50% { box-shadow: 0 0 0 1px rgba(45,212,191,.6), 0 6px 18px rgba(45,212,191,.55); } }
html[data-theme="dark"] .cf-teacher-badge { background: linear-gradient(135deg,#0d9488,#0f766e); }

/* =========================================================
   صفحة تفاصيل الكورس
   ========================================================= */
.course-page { padding: 28px 0 70px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; margin-bottom: 26px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb .current { color: var(--ink); font-weight: 700; }

.course-hero {
    display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
    padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 48px;
}
.course-cover {
    position: relative; height: 280px; border-radius: 18px; overflow: hidden;
    background: linear-gradient(135deg, var(--green), var(--green-dark) 60%, #0a3f2b);
    display: grid; place-items: center;
}
.course-cover::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(360px circle at 30% 25%, rgba(212,160,23,.25), transparent 60%);
}
.course-cover-icon { font-size: 6rem; filter: drop-shadow(0 8px 16px rgba(0,0,0,.25)); z-index: 1; }
.course-cover-badge {
    position: absolute; top: 16px; right: 16px; z-index: 2;
    background: var(--gold); color: #3b2a00; font-weight: 800; font-size: .82rem;
    padding: 6px 14px; border-radius: 999px;
}
.course-intro h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); margin-bottom: 14px; }
.course-intro p { color: var(--muted); margin-bottom: 20px; }
.course-stats { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 26px; color: var(--ink); font-weight: 600; font-size: .95rem; }
.subscribe-btn { min-width: 200px; }
.subscribe-msg {
    margin-top: 16px; color: var(--green-dark); font-weight: 700; background: var(--green-soft);
    border: 1px solid #cde7dd; border-radius: 12px; padding: 12px 18px;
    opacity: 0; transform: translateY(10px); max-height: 0; overflow: hidden;
    transition: opacity .45s ease, transform .45s ease, max-height .45s ease, margin-top .45s ease;
    margin-block: 0;
}
.subscribe-msg.show { opacity: 1; transform: translateY(0); max-height: 80px; margin-top: 16px; }

/* محتوى الكورس Accordion */
.course-content-section h2 { font-size: 1.6rem; margin-bottom: 22px; }
.accordion { display: flex; flex-direction: column; gap: 14px; }
.accordion-item {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    transition: box-shadow .25s ease, border-color .25s ease;
}
.accordion-item.open { box-shadow: var(--shadow-sm); border-color: var(--green-soft); }
.accordion-header {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: none; border: none; cursor: pointer; text-align: right;
    padding: 18px 22px; font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1.08rem; color: var(--ink);
}
.accordion-title { display: flex; align-items: center; gap: 12px; }
.unit-no {
    background: var(--green-soft); color: var(--green-dark); font-size: .8rem; font-weight: 800;
    padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.accordion-icon { color: var(--green); font-size: 1.5rem; transition: transform .35s ease; }
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-panel { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.lesson-list { padding: 4px 22px 20px; }
.lesson {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-top: 1px solid var(--border); color: var(--ink);
}
.lesson:first-child { border-top: none; }
.lesson-icon {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
    display: grid; place-items: center; font-size: .9rem;
}
.lesson-icon.play { background: var(--green-soft); color: var(--green-dark); }
.lesson-icon.file { background: #fef3c7; color: #92660a; }
.lesson-name { flex: 1; font-weight: 600; }
.lesson-dur { color: var(--muted); font-size: .88rem; }
.lesson-action { color: var(--green); font-weight: 700; font-size: .9rem; }
.lesson-action:hover { text-decoration: underline; }

/* =========================================================
   صفحة تسجيل الدخول / إنشاء حساب
   ========================================================= */
.auth-body {
    min-height: 100vh; display: grid; place-items: center;
    background:
        radial-gradient(600px circle at 12% 18%, var(--green-soft), transparent 60%),
        radial-gradient(600px circle at 88% 82%, rgba(212,160,23,.12), transparent 60%),
        var(--bg);
    padding: 28px 16px;
}
.auth { width: 100%; }
.auth-card {
    display: grid; grid-template-columns: 1fr 1fr;
    max-width: 940px; margin: 0 auto;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 24px; overflow: hidden; box-shadow: var(--shadow);
}
.auth-aside {
    background: linear-gradient(150deg, var(--green), var(--green-dark) 70%, #0a3f2b);
    color: #eaf4f0; padding: 48px 40px; display: flex; flex-direction: column; justify-content: center;
}
.auth-logo img { width: 220px; max-width: 80%; margin-bottom: 22px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.25)); }
.auth-aside h2 { color: #fff; font-size: 1.7rem; margin-bottom: 12px; }
.auth-aside p { color: #cfe6dd; margin-bottom: 22px; }
.auth-points { display: flex; flex-direction: column; gap: 10px; }
.auth-points li { color: #eaf4f0; font-weight: 600; }

.auth-form-wrap { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-mobile-logo { display: none; margin-bottom: 18px; }
.auth-mobile-logo img { height: 54px; }
.auth-form-wrap h1 { font-size: 1.9rem; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label { font-weight: 700; font-size: .95rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; right: 14px; font-size: 1.05rem; opacity: .8; pointer-events: none; }
.input-wrap input {
    width: 100%; font-family: 'Tajawal', sans-serif; font-size: 1rem; color: var(--ink);
    background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
    padding: 13px 44px 13px 44px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-wrap input::placeholder { color: #9aa3af; }
.input-wrap input:focus { outline: none; background: var(--surface); border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,114,79,.15); }
.pwd-toggle {
    position: absolute; left: 8px; background: none; border: none; cursor: pointer;
    font-size: 1.15rem; padding: 6px; border-radius: 8px; line-height: 1; transition: background .2s;
}
.pwd-toggle:hover { background: var(--green-soft); }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .92rem; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.remember input { accent-color: var(--green); width: 16px; height: 16px; }
.forgot-link { color: var(--green); font-weight: 600; }
.forgot-link:hover { text-decoration: underline; }
.auth-form .btn { margin-top: 2px; }
.auth-note {
    margin-top: 6px; text-align: center; color: var(--green-dark); font-weight: 700;
    background: var(--green-soft); border: 1px solid #cde7dd; border-radius: 12px; padding: 11px 16px;
    opacity: 0; transform: translateY(8px); max-height: 0; overflow: hidden;
    transition: opacity .4s ease, transform .4s ease, max-height .4s ease, margin-top .4s ease; margin-block: 0;
}
.auth-note.show { opacity: 1; transform: translateY(0); max-height: 220px; margin-top: 6px; }
.auth-note.is-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* أدوات إضافية لصفحات الحساب */
.auth-divider {
    display: flex; align-items: center; text-align: center;
    color: var(--muted); font-size: .88rem; margin: 6px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { padding: 0 12px; }
.auth-switch { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 6px; }
.auth-switch a { color: var(--green); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }
.remember.terms { align-items: flex-start; gap: 8px; font-size: .9rem; line-height: 1.6; }
.remember.terms a { color: var(--green); font-weight: 600; }
.remember.terms a:hover { text-decoration: underline; }

/* ===== التذييل Footer ===== */
.footer { background: linear-gradient(180deg, #101a2e 0%, #0b1322 100%); color: #c7d2e0; padding: 54px 0 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 36px; }
.footer-brand { max-width: 360px; }
.footer-logo { display: inline-block; position: relative; margin-bottom: 16px; isolation: isolate; }
.footer-logo::before {
    content: ""; position: absolute; z-index: -1; inset: -12%;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.20), transparent 62%);
    filter: blur(16px); animation: glowPulse 6s ease-in-out infinite;
}
.footer-logo img {
    width: min(230px, 70%); height: auto;
    filter: drop-shadow(0 0 13px rgba(212, 160, 23, 0.35));
    animation: floatySoft 7s ease-in-out infinite; will-change: transform;
}
.footer-brand p { color: #aeb9c9; }
.footer-social-label { display: block; font-weight: 700; color: var(--white); margin-bottom: 14px; }
.social-icons { display: flex; gap: 12px; flex-wrap: wrap; }
.social-icons a {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.08); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background .22s ease, transform .22s ease, box-shadow .22s ease, color .22s ease, border-color .22s ease;
}
.social-icons a svg { width: 20px; height: 20px; display: block; }
.social-icons a:hover { transform: translateY(-3px); border-color: transparent; }
/* ألوان كل منصة الرسمية عند المرور */
.social-icons .soc-x:hover  { background: #000000; color: #fff; box-shadow: 0 10px 22px -10px rgba(0,0,0,.8); }
.social-icons .soc-ig:hover { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); color: #fff; box-shadow: 0 10px 22px -10px rgba(214,36,159,.7); }
.social-icons .soc-yt:hover { background: #ff0000; color: #fff; box-shadow: 0 10px 22px -10px rgba(255,0,0,.7); }
.social-icons .soc-fb:hover { background: #1877f2; color: #fff; box-shadow: 0 10px 22px -10px rgba(24,119,242,.7); }
.social-icons .soc-tk:hover { background: #010101; color: #fff; box-shadow: 0 10px 22px -10px rgba(0,0,0,.8); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.10); padding: 20px 0;
    text-align: center; color: #93a0b4; font-size: .92rem;
}

/* ===== الاستجابة Responsive ===== */
@media (max-width: 980px) {
    .courses-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero p { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { order: -1; }
    .hero-logo { width: min(360px, 86%); }

    .logo-img { height: 50px; }

    .menu-toggle { display: block; }
    .nav-links {
        position: absolute; top: 70px; right: 4%; left: 4%;
        flex-direction: column; align-items: stretch; gap: 10px;
        background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 18px 22px; box-shadow: var(--shadow); display: none;
    }
    .nav-links.open { display: flex; }
    /* القوائم المنسدلة على الموبايل: عرض ضمن القائمة بالنقر بدل التمرير */
    .nav-item { display: block; width: 100%; }
    .nav-trigger { justify-content: space-between; width: 100%; padding: 4px 0; }
    .dropdown-menu {
        position: static !important; top: auto !important; width: 100%; min-width: 0;
        box-shadow: none; border: none; background: transparent;
        padding: 0; margin: 0; transform: none !important; max-height: 0; overflow: hidden;
        opacity: 1 !important; visibility: visible !important; transition: max-height .3s ease;
    }
    .dropdown-menu::before { display: none; }
    .nav-item.open-dd .dropdown-menu { max-height: 520px; padding: 6px 0 4px; }
    /* على الموبايل لا نعتمد على hover */
    .nav-item:hover .dropdown-menu { max-height: 0; }
    .nav-item.open-dd:hover .dropdown-menu { max-height: 520px; }
    .dd-item { padding: 8px 6px; }
    .dd-head { padding: 2px 6px 6px; }

    .course-hero { grid-template-columns: 1fr; }
    .course-cover { height: 220px; }

    .auth-card { grid-template-columns: 1fr; max-width: 460px; }
    .auth-aside { display: none; }
    .auth-mobile-logo { display: block; }
    .auth-form-wrap { padding: 34px 26px; }
}

@media (max-width: 560px) {
    .path-controls { grid-template-columns: 1fr; }
    .courses-grid { grid-template-columns: 1fr; max-width: 380px; margin-inline: auto; }
}

@media (max-width: 520px) {
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .course-stats { gap: 12px; font-size: .9rem; }
}

/* =========================================================
   صفحة بيئة التعلّم Course Player — واجهة نظيفة، RTL، متجاوبة
   ========================================================= */
.player-body { background: var(--bg); min-height: 100vh; }

.player-topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 10px clamp(16px, 4vw, 40px);
}
.player-topbar .logo-img { height: 46px; }
.player-course-name { font-family: 'Cairo', sans-serif; font-weight: 700; color: var(--ink); font-size: 1.02rem; }

.player-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
    width: min(1240px, 94%);
    margin: 24px auto;
}

/* منطقة الفيديو */
.video-wrap {
    aspect-ratio: 16 / 9;
    background: #0b1220;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.video-player { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }

.lesson-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    margin-top: 18px;
}
.lesson-eyebrow { color: var(--green); font-weight: 700; font-size: .85rem; }
.lesson-title { font-size: 1.4rem; margin: 6px 0 18px; }
.notes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.notes label { font-weight: 700; font-size: .95rem; }
.notes textarea {
    width: 100%; min-height: 110px; resize: vertical;
    font-family: 'Tajawal', sans-serif; font-size: 1rem; color: var(--ink);
    background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px;
    padding: 12px 14px; line-height: 1.8; transition: border-color .2s, box-shadow .2s, background .2s;
}
.notes textarea:focus { outline: none; background: var(--surface); border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,114,79,.15); }
.next-lesson-btn { width: 100%; }

/* القائمة الجانبية */
.player-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 16px;
    position: sticky; top: 84px;
    max-height: calc(100vh - 108px);
    overflow-y: auto;
}
.sidebar-title { font-size: 1.15rem; margin-bottom: 14px; padding: 0 6px; }
.player-accordion { gap: 10px; }
.player-accordion .accordion-header { padding: 14px 14px; font-size: 1rem; }
.player-accordion .accordion-panel { background: #fbfdfc; }
.player-lessons { padding: 8px; display: flex; flex-direction: column; gap: 4px; }

.player-lesson {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    transition: background .2s ease;
}
.player-lesson:hover { background: #f1f5f9; }
.player-lesson.active { background: #eff6ff; }          /* أزرق فاتح جداً للدرس النشط */

.pl-icon {
    width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: .68rem;
    background: #eef2f7; color: #8a93a3; transition: background .2s, color .2s;
}
.player-lesson.active .pl-icon {
    background: #2563eb; color: #fff;
    animation: plPulse 1.8s ease-out infinite;          /* تأثير "قيد التشغيل" */
}
.player-lesson.done .pl-icon { background: #16a34a; color: #fff; animation: none; }
@keyframes plPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
    50%      { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
}
.pl-name { flex: 1; font-weight: 600; font-size: .92rem; }
.player-lesson.active .pl-name { color: #1d4ed8; }
.player-lesson.done .pl-name { color: var(--muted); }
.pl-dur { font-size: .78rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
    .player-lesson.active .pl-icon { animation: none; }
}

/* تجاوب: الفيديو بالأعلى وقائمة الدروس بالأسفل */
@media (max-width: 900px) {
    .player-layout { grid-template-columns: 1fr; }
    .player-sidebar { position: static; max-height: none; }
    .player-course-name { display: none; }
}

/* =========================================================
   الوضع الداكن — صفحات المعاينة والبث المباشر
   ========================================================= */
body.dark {
    background: linear-gradient(160deg, #05070a 0%, #0e131b 50%, #1b212d 100%);
    background-attachment: fixed;
    color: #e5e7eb;
    min-height: 100vh;
}
.dark .btn-ghost-dark {
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.14);
}
.dark .btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.12); }

.dark-topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: rgba(7, 10, 15, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px clamp(16px, 4vw, 40px);
}
.dark-logo { height: 46px; width: auto; }
.dark-video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }

/* ===== صفحة معاينة الكورس ===== */
.preview-wrap {
    display: flex;
    gap: 28px;
    align-items: stretch;
    width: min(1200px, 94%);
    margin: 36px auto;
}
.preview-video {
    flex: 1 1 auto;
    display: flex; flex-direction: column; gap: 12px;
    min-width: 0;
}
.preview-video-label { color: #9aa3af; font-weight: 700; font-size: .9rem; }
.preview-video-frame {
    flex: 1;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
.preview-details {
    flex: 0 0 380px;
    background: #11151d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px 26px;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
}
.preview-tag {
    display: inline-block; background: rgba(20, 184, 134, 0.16); color: #34d399;
    font-weight: 700; font-size: .8rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
.preview-title { color: #fff; font-size: 1.9rem; margin-bottom: 10px; }
.preview-desc { color: #9aa3af; font-size: .95rem; margin-bottom: 22px; }
.detail-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.detail-list li {
    display: flex; align-items: center; gap: 10px;
    color: #cbd2dc; font-size: .95rem;
    padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.detail-list li:last-child { border-bottom: none; padding-bottom: 0; }
.detail-list strong { color: #fff; font-weight: 700; }
.d-ico {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
    display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); font-size: 1rem;
}

/* زر الاشتراك الأحمر العريض */
.btn-subscribe-red {
    width: 100%;
    border: none; cursor: pointer;
    font-family: 'Tajawal', sans-serif; font-weight: 800; font-size: 1.12rem; color: #fff;
    padding: 16px; border-radius: 14px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 14px 30px -10px rgba(239, 68, 68, 0.6);
    transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-subscribe-red:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -10px rgba(239, 68, 68, 0.7); }
.btn-subscribe-red:disabled { filter: grayscale(.3) brightness(.85); cursor: default; transform: none; }

.subscribe-note {
    margin: 0; text-align: center; color: #34d399; font-weight: 700;
    background: rgba(20, 184, 134, 0.12); border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 12px;
    padding: 0 14px; max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height .4s ease, opacity .4s ease, margin .4s ease, padding .4s ease;
}
.subscribe-note.show { max-height: 70px; opacity: 1; margin-top: 14px; padding: 11px 14px; }

.preview-actions { display: flex; gap: 12px; margin-top: 18px; }
.icon-action {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05); color: #cbd2dc;
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
    padding: 11px 10px; font-family: 'Tajawal', sans-serif; font-weight: 600; font-size: .88rem;
    cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.icon-action:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.icon-action.saved { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }

/* ===== صفحة البث المباشر ===== */
.live-topbar-title { font-family: 'Cairo', sans-serif; font-weight: 700; color: #e5e7eb; font-size: 1rem; }
.live-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 22px;
    width: min(1280px, 95%);
    margin: 24px auto;
    align-items: start;
}
.live-stage { min-width: 0; }
.live-video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
.live-badge {
    position: absolute; top: 16px; right: 16px; z-index: 3;
    display: inline-flex; align-items: center; gap: 7px;
    background: #dc2626; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .5px;
    padding: 6px 13px; border-radius: 999px;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.5);
}
.live-dot {
    width: 9px; height: 9px; border-radius: 50%; background: #fff;
    animation: liveBlink 1.1s ease-in-out infinite;
}
@keyframes liveBlink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.7); } }
.live-meta { margin-top: 16px; }
.live-meta h1 { color: #fff; font-size: 1.4rem; margin-bottom: 6px; }
.live-meta p { color: #9aa3af; }
.live-viewers { color: #34d399; font-weight: 600; }

.live-chat {
    background: #11151d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    display: flex; flex-direction: column;
    height: calc(100vh - 140px);
    min-height: 420px;
    overflow: hidden;
    position: sticky; top: 84px;
}
.chat-header {
    padding: 16px 18px; font-family: 'Cairo', sans-serif; font-weight: 700; color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08); flex: 0 0 auto;
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.chat-msg {
    background: rgba(255, 255, 255, 0.05); border-radius: 12px; padding: 9px 13px;
    font-size: .92rem; color: #d7dce4; line-height: 1.7; max-width: 92%;
    align-self: flex-start;
}
.chat-user { display: block; font-weight: 700; color: #93c5fd; font-size: .82rem; margin-bottom: 2px; }
.chat-msg.chat-teacher { background: rgba(20, 184, 134, 0.14); border: 1px solid rgba(52, 211, 153, 0.25); }
.chat-msg.chat-teacher .chat-user { color: #34d399; }
.chat-msg.chat-me {
    align-self: flex-end; background: rgba(37, 99, 235, 0.22); border: 1px solid rgba(96, 165, 250, 0.3);
}
.chat-msg.chat-me .chat-user { color: #bfdbfe; }
.chat-input {
    flex: 0 0 auto; display: flex; gap: 8px; padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.chat-input input {
    flex: 1; background: #0a0e15; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px;
    padding: 11px 16px; color: #e5e7eb; font-family: 'Tajawal', sans-serif; font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
}
.chat-input input::placeholder { color: #6b7280; }
.chat-input input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.chat-input button {
    background: var(--green); color: #fff; border: none; border-radius: 999px;
    padding: 0 20px; font-family: 'Tajawal', sans-serif; font-weight: 700; cursor: pointer;
    transition: background .2s, transform .2s;
}
.chat-input button:hover { background: var(--green-dark); transform: translateY(-1px); }

/* ===== تجاوب الوضع الداكن ===== */
@media (max-width: 900px) {
    .preview-wrap { flex-direction: column; }
    .preview-details { flex: 1 1 auto; order: 2; }
    .preview-video { order: 1; }

    .live-layout { grid-template-columns: 1fr; }
    .live-chat { position: static; height: auto; min-height: 0; }
    .chat-messages { max-height: 360px; }
    .live-topbar-title { display: none; }
}

.field-help { display:block; margin-top:6px; color:#94a3b8; font-size:.8rem; }
#recaptcha-container { margin: 6px 0; }

/* =========================================================
   زر المستخدم في شريط التنقّل + صفحة الملف الشخصي
   ========================================================= */
.btn-user {
    display: inline-flex; align-items: center; gap: 9px;
    background: #fff; color: var(--green-dark);
    border: 1px solid var(--border, #e2e8f0);
    padding: 7px 14px 7px 8px; border-radius: 999px;
    font-weight: 700; box-shadow: 0 4px 14px -8px rgba(0,0,0,.25);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.btn-user:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(0,0,0,.32); border-color: var(--green); }
.btn-user:active { transform: translateY(0) scale(.97); }
.btn-user:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(20,114,79,.25); }
.btn-user .user-ava {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #14a18f, var(--green-dark));
    color: #fff; font-size: .8rem; font-weight: 800;
    box-shadow: 0 2px 8px -2px rgba(15,118,110,.6), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-user .user-name { font-size: .92rem; }

/* ===== صفحة الملف الشخصي ===== */
.profile-page { padding: 40px 0 80px; background: var(--bg, #f8fafc); min-height: 70vh; }
.profile-header {
    display: flex; align-items: center; gap: 22px;
    background: #fff; border: 1px solid #eef1f5; border-radius: 20px;
    padding: 26px 28px; box-shadow: 0 18px 40px -28px rgba(0,0,0,.25);
    margin-bottom: 26px; flex-wrap: wrap;
}
.profile-ava {
    width: 84px; height: 84px; flex: 0 0 84px; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-size: 2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    box-shadow: 0 10px 26px -10px rgba(20,184,134,.6);
}
.profile-id { flex: 1; min-width: 180px; }
.profile-id h1 { font-size: 1.6rem; color: var(--ink, #0f172a); margin-bottom: 4px; }
.profile-id p { color: #64748b; margin-bottom: 8px; }
.profile-stage {
    display: inline-block; background: rgba(20,184,134,.12); color: var(--green-dark);
    font-weight: 700; font-size: .82rem; padding: 4px 13px; border-radius: 999px;
}
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.profile-card {
    background: #fff; border: 1px solid #eef1f5; border-radius: 18px;
    padding: 26px 26px; box-shadow: 0 18px 40px -30px rgba(0,0,0,.22);
}
.profile-card h2 { font-size: 1.2rem; color: var(--ink, #0f172a); margin-bottom: 18px; }
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 0; border-bottom: 1px solid #f1f5f9;
}
.info-list li:last-child { border-bottom: none; }
.info-list span { color: #64748b; font-size: .92rem; }
.info-list strong { color: var(--ink, #0f172a); font-weight: 700; }

@media (max-width: 760px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-header { justify-content: center; text-align: center; }
    .profile-header .btn-outline { width: 100%; }
}
