/* =====================================================
   منصة فجر التعليمية — ملف التنسيق المشترك
   كل ألوان المنصة وخطها وقطعها الجاهزة هنا
   ===================================================== */

/* ---------- 1) الألوان والمقاسات (الوضع العادي) ---------- */
:root {
    --fj-font: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;

    --fj-navy: #1F3A56;        /* الكحلي: العناوين والأزرار */
    --fj-gold: #F2B705;        /* ذهبي الشمس: الإبراز */
    --fj-gold-soft: #FFF6D6;
    --fj-gold-ink: #7A5A00;    /* نص فوق الذهبي الفاتح */
    --fj-teal: #0E7C8C;        /* الفيروزي: الروابط واللمسات */
    --fj-teal-soft: #E3F4F6;
    --fj-danger: #C0392B;
    --fj-danger-soft: #FBEAEA;
    --fj-danger-ink: #9E2B20;
    --fj-success: #1A8A4A;
    --fj-success-soft: #E6F4EC;
    --fj-success-ink: #14673A;

    --fj-bg: #F7F9FC;          /* خلفية الصفحة */
    --fj-surface: #FFFFFF;     /* البطاقات والشريط العلوي */
    --fj-soft: #EEF3F8;        /* الصناديق الداخلية والشارات */
    --fj-border: #E6ECF2;
    --fj-text: #1F3A56;
    --fj-muted: #4A5D70;

    --fj-primary: #1F3A56;     /* لون الزر الرئيسي */
    --fj-on-primary: #FFFFFF;

    --fj-radius: 12px;
    --fj-radius-lg: 18px;
    --fj-shadow: 0 6px 20px rgba(31, 58, 86, 0.06);
    --fj-net: 52, 152, 219;    /* لون الشبكة المتحركة */
}

/* ---------- 2) الوضع المعتم: نفس الأسماء بقيم داكنة ---------- */
body.dark-mode {
    --fj-gold-soft: #3A3110;
    --fj-gold-ink: #F7D766;
    --fj-teal: #4FC3D1;
    --fj-teal-soft: #173A40;

    --fj-bg: #0F1B24;
    --fj-surface: #1E2A33;
    --fj-soft: #26343F;
    --fj-border: #3A4A57;
    --fj-text: #E8EEF3;
    --fj-muted: #A9B6C2;

    --fj-primary: #F2B705;
    --fj-on-primary: #1F3A56;
    --fj-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    --fj-net: 120, 180, 230;

    --fj-danger: #E5675A;
    --fj-danger-soft: #3D2222;
    --fj-danger-ink: #F2A49B;
    --fj-success: #3CC47A;
    --fj-success-soft: #173A2A;
    --fj-success-ink: #8EDDB0;
}

/* ---------- 3) أساسيات الصفحة ---------- */
body {
    margin: 0;
    font-family: var(--fj-font);
    background: var(--fj-bg);
    color: var(--fj-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: clip; /* شبكة أمان: لا تمرير أفقي على الجوال */
}
button, input, select, textarea { font-family: inherit; }
.fj-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; width: 100%; }
.content-container { flex: 1; }

/* ---------- 4) القطع الجاهزة ---------- */
.fj-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--fj-radius);
    font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s;
    white-space: nowrap;
}
.fj-btn:hover { transform: translateY(-1px); }
.fj-btn-primary { background: var(--fj-primary); color: var(--fj-on-primary); }
.fj-btn-primary:hover { box-shadow: var(--fj-shadow); color: var(--fj-on-primary); }
.fj-btn-secondary { background: var(--fj-surface); color: var(--fj-text); border-color: var(--fj-border); }
.fj-btn-gold { background: var(--fj-gold); color: #1F3A56; font-weight: 700; }
.fj-btn-ghost { background: transparent; color: var(--fj-muted); }
.fj-btn-ghost:hover { color: var(--fj-danger); }

.fj-icon-btn {
    width: 44px; height: 44px; border-radius: var(--fj-radius);
    border: 1px solid var(--fj-border); background: var(--fj-surface); color: var(--fj-text);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.fj-icon-btn svg { width: 20px; height: 20px; }

.fj-card { background: var(--fj-surface); border: 1px solid var(--fj-border); border-radius: var(--fj-radius-lg); }
.fj-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--fj-soft); color: var(--fj-text); padding: 5px 11px; border-radius: 999px; font-size: 13px; }
.fj-badge-gold { background: var(--fj-gold-soft); color: var(--fj-gold-ink); font-weight: 700; }
.fj-section-title { margin: 0 0 6px; font-size: 30px; font-weight: 700; color: var(--fj-text); }
.fj-section-sub { margin: 0; color: var(--fj-muted); font-size: 16px; }

/* ---------- 5) الشريط العلوي ---------- */
.fj-header { background: var(--fj-surface); border-bottom: 1px solid var(--fj-border); position: relative; z-index: 10; }
.fj-header-inner { display: flex; align-items: center; gap: 24px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.fj-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fj-text); font-weight: 700; font-size: 19px; }
.fj-brand img { width: 40px; height: 40px; object-fit: contain; }
.fj-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 500; }
.fj-nav a { color: var(--fj-muted); text-decoration: none; transition: color 0.2s; }
.fj-nav a:hover, .fj-nav a.is-active { color: var(--fj-text); }
.fj-nav a.is-active { box-shadow: 0 2px 0 var(--fj-gold); }
.fj-nav-auth { display: none; }
.fj-header-actions { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.fj-user { color: var(--fj-muted); font-size: 14px; }
.fj-user strong { color: var(--fj-text); }
.fj-burger { display: none; }

/* أيقونة القمر/الشمس حسب الوضع */
.fj-icon-sun { display: none; }
body.dark-mode .fj-icon-sun { display: block; }
body.dark-mode .fj-icon-moon { display: none; }

/* الجوال: الروابط تُطوى خلف زر القائمة */
@media (max-width: 900px) {
    .fj-header-inner { gap: 12px; }
    .fj-brand { font-size: 17px; }
    .fj-brand img { width: 34px; height: 34px; }
    .fj-burger { display: inline-flex; }
    .fj-hide-mobile { display: none !important; }
    .fj-nav { display: none; order: 3; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-top: 6px; }
    .fj-nav.is-open { display: flex; }
    .fj-nav a { padding: 13px 4px; border-top: 1px solid var(--fj-border); }
    .fj-nav a.is-active { box-shadow: none; color: var(--fj-text); }
    .fj-nav-auth { display: flex; gap: 10px; padding: 14px 0 6px; border-top: 1px solid var(--fj-border); }
    .fj-nav-auth .fj-btn { flex: 1; border-top: 1px solid var(--fj-border); padding: 11px 14px; }
    .fj-nav-auth .fj-btn-primary { border-color: transparent; color: var(--fj-on-primary); }
    .fj-nav-auth .fj-btn-secondary { color: var(--fj-text); }
}

/* ---------- 5ب) شريط الإعلانات ---------- */
.fj-announce { background: var(--fj-gold-soft); border-bottom: 1px solid var(--fj-border); position: relative; z-index: 5; }
.fj-announce[hidden] { display: none; }
.fj-announce-inner { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.fj-announce-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--fj-gold); color: #1F3A56; display: flex; align-items: center; justify-content: center; }
.fj-announce-icon svg { width: 20px; height: 20px; }
.fj-announce-slides { flex: 1; min-width: 0; }
.fj-announce-slide { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; animation: fjFadeIn 0.35s ease; }
.fj-announce-slide[hidden] { display: none; }
.fj-announce-text { flex: 1 1 260px; min-width: 0; font-size: 14px; color: var(--fj-gold-ink); line-height: 1.7; }
.fj-announce-text strong { color: var(--fj-text); font-size: 15px; }
.fj-announce-cta { padding: 8px 16px; font-size: 14px; }
.fj-announce-controls { flex: none; display: flex; align-items: center; gap: 2px; }
.fj-announce-btn { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--fj-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fj-announce-btn:hover { background: rgba(0, 0, 0, 0.06); }
.fj-announce-btn svg { width: 18px; height: 18px; }
.fj-announce-count { font-size: 13px; color: var(--fj-gold-ink); min-width: 44px; text-align: center; }
.fj-announce.is-single [data-ann="prev"],
.fj-announce.is-single [data-ann="next"],
.fj-announce.is-single .fj-announce-count { display: none; }
@keyframes fjFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
    .fj-announce-icon { display: none; }
    .fj-announce-inner { gap: 8px; align-items: flex-start; }
}

/* ---------- 6) التذييل ---------- */
.fj-footer { background: var(--fj-surface); border-top: 1px solid var(--fj-border); margin-top: auto; position: relative; z-index: 1; }
.fj-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 28px; }
.fj-footer .fj-brand { font-size: 16px; }
.fj-footer .fj-brand img { width: 32px; height: 32px; }
.fj-footer-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.fj-footer-links a { color: var(--fj-muted); text-decoration: none; }
.fj-footer-links a:hover { color: var(--fj-teal); }
.fj-copy { margin: 0; font-size: 14px; color: var(--fj-muted); }

/* ---------- 7) الشبكة المتحركة في الخلفية ---------- */
#fjNetwork { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ---------- 8) زر العودة للأعلى ---------- */
#scrollToTopBtn {
    display: none; position: fixed; bottom: 24px; right: 24px; z-index: 50;
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--fj-primary); color: var(--fj-on-primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); align-items: center; justify-content: center;
    transition: transform 0.2s;
}
#scrollToTopBtn.is-visible { display: inline-flex; }
#scrollToTopBtn:hover { transform: translateY(-3px); }
#scrollToTopBtn svg { width: 22px; height: 22px; }

/* =====================================================
   10) الصفحة الرئيسية
   ===================================================== */
.fj-section { padding-top: 64px; padding-bottom: 64px; }
.fj-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.fj-center { text-align: center; }

/* القسم الترحيبي */
.fj-hero { display: flex; align-items: center; gap: 48px; flex-wrap: wrap; padding-top: 56px; padding-bottom: 48px; }
.fj-hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.fj-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; background: var(--fj-gold-soft); color: var(--fj-gold-ink); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.fj-pill svg { width: 16px; height: 16px; }
.fj-hero-title { margin: 0; font-size: clamp(32px, 5vw, 50px); line-height: 1.3; font-weight: 700; color: var(--fj-text); }
.fj-hero-title span { color: #C99700; }
body.dark-mode .fj-hero-title span { color: var(--fj-gold); }
.fj-hero-sub { margin: 0; font-size: clamp(18px, 2.4vw, 22px); color: var(--fj-muted); }
.fj-search { display: flex; align-items: center; gap: 10px; background: var(--fj-surface); border: 1px solid var(--fj-border); border-radius: 14px; padding: 6px 16px 6px 6px; max-width: 560px; box-shadow: var(--fj-shadow); }
.fj-search svg { width: 20px; height: 20px; color: var(--fj-muted); flex: none; }
.fj-search input { flex: 1; min-width: 0; width: 0; border: 0; outline: 0; background: transparent; color: var(--fj-text); font-size: 16px; padding: 10px 0; }
.fj-search input::placeholder { color: var(--fj-muted); }
.fj-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.fj-btn-lg { padding: 14px 26px; font-size: 16px; }
.fj-hero-art { flex: 1 1 320px; display: flex; justify-content: center; }
.fj-hero-orb { position: relative; width: min(360px, 80vw); aspect-ratio: 1; }
.fj-hero-glow { position: absolute; inset: 0; border-radius: 50%; background: var(--fj-gold-soft); animation: fjGlow 4s ease-in-out infinite; }
.fj-hero-logo { position: absolute; inset: 12%; border-radius: 50%; background: #FFFFFF; box-shadow: 0 20px 50px rgba(31, 58, 86, 0.14); display: flex; align-items: center; justify-content: center; animation: fjFloat 4s ease-in-out infinite; }
.fj-hero-logo img { width: 62%; height: auto; }
@keyframes fjFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes fjGlow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.05); opacity: 0.75; } }

/* الإحصائيات */
.fj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 18px; padding-bottom: 24px; }
.fj-stat { padding: 24px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.fj-stat-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--fj-navy); color: var(--fj-gold); display: flex; align-items: center; justify-content: center; }
body.dark-mode .fj-stat-icon { background: var(--fj-soft); }
.fj-stat-icon svg { width: 24px; height: 24px; }
.fj-stat-value { font-size: 32px; font-weight: 700; }
.fj-stat-label { font-size: 15px; color: var(--fj-muted); }

/* بطاقات الكورسات */
.fj-course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.fj-course-card { display: flex; flex-direction: column; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.fj-course-card:hover { transform: translateY(-3px); box-shadow: var(--fj-shadow); }
.fj-course-cover { display: block; height: 170px; background: var(--fj-navy); }
.fj-course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fj-course-code { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--fj-gold); font-size: 38px; font-weight: 700; letter-spacing: 1px; direction: ltr; }
.fj-course-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.fj-course-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fj-course-title { margin: 0; font-size: 17px; line-height: 1.6; font-weight: 700; }
.fj-course-title a { color: var(--fj-text); text-decoration: none; }
.fj-course-title a:hover { color: var(--fj-teal); }
.fj-course-rating { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.fj-course-rating svg { width: 16px; height: 16px; color: var(--fj-gold); }
.fj-course-rating .fj-muted { color: var(--fj-muted); font-size: 13px; }
.fj-course-summary { margin: 0; font-size: 14px; line-height: 1.7; color: var(--fj-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fj-course-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.fj-course-meta .fj-badge { padding: 5px 9px; gap: 5px; font-size: 12.5px; white-space: nowrap; }
.fj-course-meta svg { width: 14px; height: 14px; }
.fj-course-btn { margin-top: 6px; width: 100%; box-sizing: border-box; }
.fj-empty { padding: 48px 24px; text-align: center; border-style: dashed; }

/* السعر والعرض (يُستخدم في البطاقات وصفحة الكورس) */
.fj-price { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; white-space: nowrap; }
.fj-price-old { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.fj-price-old del { color: var(--fj-muted); }
.fj-discount { background: var(--fj-danger); color: #FFFFFF; padding: 2px 6px; border-radius: 8px; font-weight: 700; direction: ltr; }

/* المدرس */
.fj-teacher { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fj-muted); }
.fj-teacher img, .fj-teacher-initial { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; }
.fj-teacher-initial { background: var(--fj-navy); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

/* كيف تبدأ */
.fj-band { background: var(--fj-surface); border-top: 1px solid var(--fj-border); border-bottom: 1px solid var(--fj-border); position: relative; }
.fj-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 24px; margin-top: 36px; }
.fj-step { display: flex; gap: 16px; align-items: flex-start; }
.fj-step-num { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--fj-gold); color: #1F3A56; font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.fj-step h3 { margin: 4px 0 6px; font-size: 18px; }
.fj-step p { margin: 0; color: var(--fj-muted); font-size: 15px; line-height: 1.8; }

/* أدوات البرمجة */
.fj-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.fj-tool { padding: 22px; display: flex; gap: 18px; align-items: center; text-decoration: none; color: var(--fj-text); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.fj-tool:hover { transform: translateY(-3px); box-shadow: var(--fj-shadow); color: var(--fj-text); }
.fj-tool-icon { flex: none; width: 56px; height: 56px; border-radius: 14px; background: var(--fj-teal-soft); color: var(--fj-teal); display: flex; align-items: center; justify-content: center; }
.fj-tool-icon svg { width: 26px; height: 26px; }
.fj-tool strong { display: block; font-size: 18px; margin-bottom: 4px; }
.fj-tool span { font-size: 15px; color: var(--fj-muted); }

/* شريط الدروس الخصوصية */
.fj-zoom { background: #1F3A56; color: #FFFFFF; border-radius: 22px; padding: 40px; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
body.dark-mode .fj-zoom { background: var(--fj-surface); border: 1px solid var(--fj-border); }
.fj-zoom h2 { margin: 0 0 10px; font-size: 28px; color: #FFFFFF; }
.fj-zoom h2 span { color: var(--fj-gold); }
.fj-zoom p { margin: 0; color: #D3DEE9; font-size: 16px; line-height: 1.8; max-width: 640px; }
.fj-zoom .fj-btn svg { width: 20px; height: 20px; }

/* الجوال: شعار أصغر، وإحصائيات في عمودين */
@media (max-width: 600px) {
    .fj-hero { padding-top: 32px; gap: 28px; }
    .fj-hero-actions .fj-btn { flex: 1 1 auto; }
    .fj-hero-orb { width: 190px; }
    .fj-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .fj-stat { padding: 18px 10px; }
    .fj-stat-icon { width: 44px; height: 44px; }
    .fj-stat-value { font-size: 26px; }
    .fj-section { padding-top: 44px; padding-bottom: 44px; }
    .fj-zoom { padding: 28px 22px; }
    .fj-zoom h2 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
    .fj-hero-glow, .fj-hero-logo { animation: none; }
    .fj-course-card:hover, .fj-tool:hover, .fj-btn:hover { transform: none; }
}

/* =====================================================
   11) الصفحات الداخلية: العنوان، اللوحات، النماذج، التنبيهات
   ===================================================== */
.fj-page { padding-top: 40px; padding-bottom: 64px; }
.fj-narrow { max-width: 500px; }
.fj-mid { max-width: 820px; }
.fj-page-head { text-align: center; margin-bottom: 28px; }
.fj-page-head h1 { margin: 0 0 8px; font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; color: var(--fj-text); }
.fj-page-head p { margin: 0 auto; color: var(--fj-muted); font-size: 16px; line-height: 1.8; max-width: 680px; }
.fj-panel { padding: 32px; box-shadow: var(--fj-shadow); }
.fj-panel-title { margin: 0 0 22px; text-align: center; font-size: 24px; font-weight: 700; color: var(--fj-text); }
.fj-muted { color: var(--fj-muted); }

/* النماذج: تنطبق على أي حقل داخل fj-form، بما فيها حقول Django الجاهزة */
.fj-form { display: flex; flex-direction: column; gap: 18px; }
.fj-field, .fj-form p { display: flex; flex-direction: column; gap: 7px; margin: 0; }
.fj-field > label, .fj-form p > label { font-weight: 500; font-size: 15px; color: var(--fj-text); }
.fj-input,
.fj-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
.fj-form select,
.fj-form textarea {
    width: 100%; box-sizing: border-box; padding: 12px 14px;
    border: 1px solid var(--fj-border); border-radius: 10px;
    background: var(--fj-surface); color: var(--fj-text); font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.fj-form textarea, textarea.fj-input { resize: vertical; line-height: 1.7; }
.fj-input:focus,
.fj-form input:focus, .fj-form select:focus, .fj-form textarea:focus {
    outline: none; border-color: var(--fj-teal); box-shadow: 0 0 0 3px var(--fj-teal-soft);
}
.fj-input::placeholder, .fj-form input::placeholder, .fj-form textarea::placeholder { color: var(--fj-muted); opacity: 0.8; }
.fj-help, .fj-form .helptext { font-size: 13px; color: var(--fj-muted); line-height: 1.7; }
.fj-form .helptext ul, .fj-form ul.helptext { margin: 2px 0 0; padding-right: 18px; }
.fj-field-error, .fj-form .errorlist { color: var(--fj-danger-ink); font-size: 13px; font-weight: 500; margin: 0; padding: 0; list-style: none; }
.fj-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fj-muted); cursor: pointer; user-select: none; }
.fj-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--fj-teal); cursor: pointer; }
.fj-btn-block { width: 100%; box-sizing: border-box; }
.fj-btn:disabled { opacity: 0.65; cursor: progress; transform: none; }
.fj-link { color: var(--fj-teal); text-decoration: none; font-weight: 500; }
.fj-link:hover { text-decoration: underline; }
.fj-form-foot { margin: 20px 0 0; text-align: center; font-size: 14px; color: var(--fj-muted); display: flex; flex-direction: column; gap: 10px; }

/* التنبيهات */
.fj-alert { padding: 13px 16px; border-radius: var(--fj-radius); font-size: 15px; line-height: 1.7; border: 1px solid transparent; margin: 0 0 18px; }
.fj-alert ul { margin: 6px 0 0; padding-right: 20px; }
.fj-alert-success { background: var(--fj-success-soft); color: var(--fj-success-ink); }
.fj-alert-danger, .fj-alert-error { background: var(--fj-danger-soft); color: var(--fj-danger-ink); }
.fj-alert-warning { background: var(--fj-gold-soft); color: var(--fj-gold-ink); }
.fj-alert-info { background: var(--fj-teal-soft); color: var(--fj-teal); }

/* حالة في وسط بطاقة (نجاح، انتظار، مقفل) */
.fj-state { text-align: center; padding: 40px 24px; }
.fj-state h2, .fj-state h3 { margin: 0 0 10px; font-size: 22px; color: var(--fj-text); }
.fj-state p { margin: 0 auto 22px; max-width: 520px; color: var(--fj-muted); line-height: 1.8; }
.fj-state-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--fj-soft); color: var(--fj-text); }
.fj-state-icon svg { width: 30px; height: 30px; }
.fj-state-icon.is-success { background: var(--fj-success-soft); color: var(--fj-success); }
.fj-state-icon.is-gold { background: var(--fj-gold-soft); color: var(--fj-gold-ink); }
.fj-state-icon.is-teal { background: var(--fj-teal-soft); color: var(--fj-teal); }

/* شريط التقدم والجدول */
.fj-progress { height: 10px; background: var(--fj-soft); border-radius: 999px; overflow: hidden; }
.fj-progress > span { display: block; height: 100%; background: var(--fj-teal); border-radius: 999px; transition: width 0.5s; }
.fj-table-wrap { overflow-x: auto; }
.fj-table { width: 100%; border-collapse: collapse; font-size: 15px; text-align: right; }
.fj-table th { background: var(--fj-soft); color: var(--fj-text); font-weight: 500; padding: 12px 14px; white-space: nowrap; }
.fj-table td { padding: 12px 14px; border-top: 1px solid var(--fj-border); }

@media (max-width: 600px) {
    .fj-page { padding-top: 24px; padding-bottom: 44px; }
    .fj-panel { padding: 22px 18px; }
}

/* =====================================================
   12) صفحات التعريف: التواصل، فريق العمل، دوراتي، الدفع
   ===================================================== */
.fj-social { display: flex; flex-direction: column; gap: 12px; }
.fj-social-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: var(--fj-text); font-weight: 500; transition: transform 0.2s, box-shadow 0.2s; }
.fj-social-link:hover { transform: translateY(-2px); box-shadow: var(--fj-shadow); color: var(--fj-text); }
.fj-social-link small { display: block; font-weight: 400; color: var(--fj-muted); font-size: 13px; }
.fj-social-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.fj-social-icon svg { width: 22px; height: 22px; }
.fj-social-arrow { margin-right: auto; color: var(--fj-muted); }
.fj-social-arrow svg { width: 18px; height: 18px; display: block; }

.fj-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 22px; }
.fj-member { padding: 28px 22px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.fj-member-photo { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; border: 3px solid var(--fj-gold-soft); margin-bottom: 8px; }
.fj-member-initial { background: var(--fj-navy); color: var(--fj-gold); display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 700; }
.fj-member h2 { margin: 0; font-size: 20px; }
.fj-member-title { margin: 0; color: var(--fj-teal); font-size: 14px; font-weight: 500; }
.fj-member-bio { margin: 10px 0 0; color: var(--fj-muted); font-size: 15px; line-height: 1.8; }
.fj-member-quals { margin-top: auto; width: 100%; box-sizing: border-box; background: var(--fj-soft); border-radius: var(--fj-radius); padding: 14px; font-size: 14px; line-height: 1.8; white-space: pre-line; color: var(--fj-text); }
.fj-member-quals strong { display: block; margin-bottom: 4px; }
.fj-member-bio + .fj-member-quals { margin-top: 16px; }

.fj-enrolled-date { font-size: 13px; color: var(--fj-muted); }

.fj-pay-box { background: var(--fj-soft); border-radius: var(--fj-radius); padding: 18px 20px; text-align: right; margin: 0 0 24px; }
.fj-pay-box h3 { margin: 0 0 8px; font-size: 16px; }
.fj-pay-box ul { margin: 0; padding-right: 20px; color: var(--fj-muted); line-height: 2; }

/* =====================================================
   13) أدوات البرمجة: المحرّر ومتتبّع الكود
   ===================================================== */
.fj-tool-page { max-width: 1400px; }
.fj-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 18px; }
.fj-toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.fj-select { width: auto; padding: 10px 12px; font-weight: 500; cursor: pointer; }
.fj-workspace { display: flex; gap: 18px; align-items: stretch; }
.fj-workspace.is-vertical { flex-direction: column; }
.fj-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.fj-pane-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: var(--fj-navy); color: #FFFFFF; font-size: 15px; font-weight: 500; direction: rtl; }
body.dark-mode .fj-pane-head { background: var(--fj-soft); color: var(--fj-text); }
.fj-pane-head svg { width: 18px; height: 18px; color: var(--fj-gold); }
.fj-pane .CodeMirror { flex: 1 1 auto; height: 460px; font-size: 15px; font-family: 'Courier New', Courier, monospace; text-align: left; }
.fj-terminal { flex: 1 1 auto; height: 460px; margin: 0; padding: 16px; overflow-y: auto; box-sizing: border-box; background: #0F1B24; color: #8EDDB0; font-family: 'Courier New', Courier, monospace; font-size: 15px; white-space: pre-wrap; text-align: left; direction: ltr; }
.fj-terminal.is-running { color: #F7D766; }
.fj-terminal.is-error { color: #F2A49B; }
.fj-stdin { margin-top: 18px; }
.fj-stdin .fj-pane-head { background: transparent; color: var(--fj-text); padding: 14px 18px 0; }
.fj-stdin textarea { margin: 10px 18px 18px; width: calc(100% - 36px); height: 90px; font-family: 'Courier New', Courier, monospace; }
.fj-visual-pane { flex: 1.2; }
.fj-visual-pane .fj-pane-body { flex: 1; min-height: 460px; display: flex; align-items: center; justify-content: center; background: var(--fj-soft); }
.fj-visual-pane iframe { width: 100%; height: 100%; min-height: 560px; border: 0; background: #FFFFFF; }
.fj-placeholder { text-align: center; color: var(--fj-muted); padding: 24px; }
.fj-placeholder svg { width: 46px; height: 46px; display: block; margin: 0 auto 10px; opacity: 0.7; }
.fj-workspace-tall .CodeMirror { height: 560px; }

@media (max-width: 900px) {
    .fj-workspace { flex-direction: column; }
    .fj-pane .CodeMirror, .fj-terminal { height: 360px; }
    .fj-visual-pane iframe { min-height: 480px; }
}

/* =====================================================
   14) الاختبارات ونتائجها
   ===================================================== */
.fj-quiz-hero { background: #1F3A56; color: #FFFFFF; border-radius: var(--fj-radius-lg); padding: 30px 24px; text-align: center; margin-bottom: 24px; }
body.dark-mode .fj-quiz-hero { background: var(--fj-surface); border: 1px solid var(--fj-border); }
.fj-quiz-hero h1 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 28px); color: #FFFFFF; }
body.dark-mode .fj-quiz-hero h1 { color: var(--fj-text); }
.fj-quiz-hero p { margin: 0; color: #D3DEE9; line-height: 1.8; }
body.dark-mode .fj-quiz-hero p { color: var(--fj-muted); }
.fj-question { overflow: hidden; margin-bottom: 18px; }
.fj-question-head { display: flex; gap: 10px; align-items: flex-start; padding: 16px 20px; background: var(--fj-soft); font-weight: 500; font-size: 16px; line-height: 1.8; }
.fj-question-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--fj-gold); color: #1F3A56; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.fj-question-text { flex: 1; white-space: pre-wrap; }
.fj-question-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.fj-option { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border: 1px solid var(--fj-border); border-radius: var(--fj-radius); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; line-height: 1.7; }
.fj-option:hover { border-color: var(--fj-teal); }
.fj-option input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--fj-teal); cursor: pointer; }
.fj-option > span:not(.fj-option-mark) { flex: 1; white-space: pre-wrap; }
.fj-option:has(input:checked) { border-color: var(--fj-teal); background: var(--fj-teal-soft); font-weight: 500; }
.fj-option.is-correct { border-color: transparent; background: var(--fj-success-soft); color: var(--fj-success-ink); font-weight: 500; cursor: default; }
.fj-option.is-wrong { border-color: transparent; background: var(--fj-danger-soft); color: var(--fj-danger-ink); font-weight: 500; cursor: default; }
.fj-option.is-wrong span { text-decoration: line-through; }
.fj-option.is-plain { color: var(--fj-muted); cursor: default; }
.fj-option.is-plain:hover { border-color: var(--fj-border); }
.fj-option-mark { flex: none; width: 22px; text-align: center; font-weight: 700; }
.fj-question.is-correct { border-inline-start: 4px solid var(--fj-success); }
.fj-question.is-wrong { border-inline-start: 4px solid var(--fj-danger); }
.fj-score { width: 140px; height: 140px; margin: 16px auto; border-radius: 50%; background: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; direction: ltr; }
.fj-score.is-pass { color: var(--fj-success); }
.fj-score.is-fail { color: var(--fj-danger); }
body.dark-mode .fj-score { background: var(--fj-soft); }
.fj-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

/* =====================================================
   15) صفحة الكورس: الفهرس، الفيديو، النقاشات، التقييمات
   ===================================================== */
.fj-course-intro { padding: 30px; margin-bottom: 24px; }
.fj-course-intro h1 { margin: 0 0 10px; font-size: clamp(24px, 3.2vw, 32px); }
.fj-course-intro > p { margin: 0; color: var(--fj-muted); font-size: 16px; line-height: 1.9; }
.fj-enroll-box { margin-top: 22px; padding: 20px; border-radius: var(--fj-radius); background: var(--fj-soft); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.fj-enroll-box h2 { margin: 0; font-size: 18px; }
.fj-enroll-status { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--fj-radius); font-weight: 500; line-height: 1.7; }
.fj-enroll-status svg { width: 20px; height: 20px; flex: none; }
.fj-enroll-status.is-success { background: var(--fj-success-soft); color: var(--fj-success-ink); }
.fj-enroll-status.is-pending { background: var(--fj-gold-soft); color: var(--fj-gold-ink); }
.fj-progress-row { margin-top: 22px; }
.fj-progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 500; font-size: 15px; }
.fj-progress-label strong { color: var(--fj-teal); }

.fj-course-layout { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.fj-course-sidebar { flex: 1 1 300px; overflow: hidden; position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.fj-sidebar-head { margin: 0; padding: 16px 18px; background: var(--fj-navy); color: #FFFFFF; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
body.dark-mode .fj-sidebar-head { background: var(--fj-soft); color: var(--fj-text); }
.fj-sidebar-head svg { width: 20px; height: 20px; color: var(--fj-gold); }
.fj-lesson-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.fj-lesson-list::-webkit-scrollbar { width: 6px; }
.fj-lesson-list::-webkit-scrollbar-thumb { background: var(--fj-border); border-radius: 3px; }
.fj-lesson-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: right; padding: 14px 18px; background: none; border: 0; border-bottom: 1px solid var(--fj-border); cursor: pointer; color: var(--fj-text); transition: background-color 0.2s; }
.fj-lesson-btn:hover { background: var(--fj-soft); }
.fj-lesson-btn.active { background: var(--fj-primary); color: var(--fj-on-primary); border-bottom-color: transparent; }
.fj-lesson-info { display: flex; flex-direction: column; gap: 4px; }
.fj-lesson-title { font-size: 15px; font-weight: 500; line-height: 1.6; }
.fj-lesson-duration { font-size: 12px; opacity: 0.8; direction: ltr; text-align: right; }
.fj-lesson-tags { display: flex; gap: 6px; flex: none; }
.fj-tag { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.fj-tag-free { background: var(--fj-gold-soft); color: var(--fj-gold-ink); }
.fj-tag-done { background: var(--fj-success-soft); color: var(--fj-success-ink); }
.fj-lesson-btn.active .fj-tag-free { background: var(--fj-on-primary); color: var(--fj-primary); }

.fj-course-content { flex: 3 1 600px; min-width: 0; padding: 32px; min-height: 500px; }
.fj-lesson-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--fj-border); padding-bottom: 16px; margin-bottom: 20px; }
.fj-lesson-head h2 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fj-lesson-head h2 small { font-size: 14px; font-weight: 400; color: var(--fj-muted); direction: ltr; }
.fj-lesson-desc { color: var(--fj-muted); line-height: 1.9; font-size: 16px; margin: 0 0 20px; white-space: pre-line; }
.fj-video { position: relative; padding-bottom: 56.25%; height: 0; border-radius: var(--fj-radius); overflow: hidden; background: #000; margin-bottom: 22px; }
.fj-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fj-lesson-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; background: var(--fj-soft); padding: 14px 16px; border-radius: var(--fj-radius); margin-bottom: 28px; }
.fj-lesson-actions form { margin: 0; }
.fj-btn-success { background: var(--fj-success); color: #FFFFFF; }
.fj-btn-success:hover { color: #FFFFFF; box-shadow: var(--fj-shadow); }
.fj-btn-outline { background: transparent; color: var(--fj-teal); border-color: var(--fj-teal); }
.fj-btn-outline:hover { background: var(--fj-teal-soft); color: var(--fj-teal); }
.fj-btn svg { width: 18px; height: 18px; flex: none; }

.fj-discussion { margin-top: 36px; border-top: 1px solid var(--fj-border); padding-top: 28px; }
.fj-discussion h3, .fj-reviews h3 { margin: 0 0 20px; font-size: 20px; }
.fj-comment { background: var(--fj-soft); padding: 16px 18px; border-radius: var(--fj-radius); margin-bottom: 12px; border-inline-start: 4px solid var(--fj-teal); }
.fj-comment-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.fj-comment-head strong { color: var(--fj-teal); font-size: 15px; }
.fj-comment-head span { color: var(--fj-muted); direction: ltr; }
.fj-comment p { margin: 0; line-height: 1.8; white-space: pre-line; }
.fj-form-end { display: flex; justify-content: flex-end; }

.fj-reviews { margin-top: 48px; border-top: 2px dashed var(--fj-border); padding-top: 32px; }
.fj-review-form { padding: 22px; margin-bottom: 24px; background: var(--fj-soft); border: 0; }
.fj-review-form h4 { margin: 0 0 16px; font-size: 17px; }
.fj-review-form input[type="number"] { max-width: 120px; }
.fj-review { padding: 20px; margin-bottom: 14px; }
.fj-review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.fj-review-head strong { color: var(--fj-teal); }
.fj-stars { display: inline-flex; gap: 2px; color: var(--fj-gold); }
.fj-stars svg { width: 16px; height: 16px; }
.fj-stars .is-off { color: var(--fj-border); }
.fj-review time { display: block; font-size: 13px; color: var(--fj-muted); margin-bottom: 10px; }
.fj-review p { margin: 0; line-height: 1.8; }

@media (max-width: 960px) {
    .fj-course-sidebar { position: static; max-height: none; }
    .fj-lesson-list { max-height: 45vh; }
    .fj-course-content { padding: 22px 18px; }
    .fj-course-intro { padding: 22px 18px; }
}

/* =====================================================
   16) لوحة الإحصائيات (للإدارة)
   ===================================================== */
.fj-dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 16px; margin-bottom: 18px; }
.fj-dash-stats .fj-stat-value { font-size: 28px; }
.fj-stat-icon.is-teal { background: var(--fj-teal-soft); color: var(--fj-teal); }
.fj-stat-icon.is-gold { background: var(--fj-gold-soft); color: var(--fj-gold-ink); }
.fj-stat-icon.is-success { background: var(--fj-success-soft); color: var(--fj-success); }
.fj-dash-block { padding: 22px; margin-bottom: 22px; }
.fj-dash-block h2 { margin: 0 0 18px; font-size: 19px; }
.fj-chart { height: 380px; position: relative; }

/* =====================================================
   17) العلامة المائية على الفيديو (اسم الطالب، ثابتة في الزاوية)
   ===================================================== */
.fj-watermark {
    position: absolute; z-index: 2; top: 10px; right: 12px;
    pointer-events: none; user-select: none;
    padding: 2px 8px; border-radius: 6px;
    color: rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.12);
    font-size: 12px; font-weight: 500; direction: ltr; white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}