/* ===== PWA: دعم الشاشات بالنتوءات (iPhone X وما بعده) ===== */
body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ===== زر تثبيت التطبيق ===== */
#installBanner {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1B3A4B, #0D1F2D);
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 340px;
    width: calc(100% - 40px);
    border: 1px solid rgba(212, 175, 55, 0.4);
}
#installBanner.show { display: flex; }
#installBanner .install-icon { font-size: 1.5rem; }
#installBanner .install-text { flex: 1; }
#installBanner .install-text strong { display: block; font-size: 1rem; color: var(--gold); }
#installBanner .install-text span { font-size: 0.8rem; color: rgba(255,255,255,0.75); }
#installBanner .install-btns { display: flex; gap: 8px; }
#installBanner .btn-install {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.9rem;
    white-space: nowrap;
}
#installBanner .btn-dismiss {
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ===== شاشة التحميل الأولية ===== */
#splashScreen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1B3A4B 0%, #0D1F2D 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s ease;
}
#splashScreen .splash-icon { font-size: 4rem; color: var(--gold); margin-bottom: 16px; }
#splashScreen h1 { color: var(--gold); font-size: 2rem; font-weight: 900; }
#splashScreen p { color: rgba(255,255,255,0.7); margin-top: 8px; }
#splashScreen .splash-loader {
    width: 50px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    margin-top: 30px;
    overflow: hidden;
}
#splashScreen .splash-loader::after {
    content: '';
    display: block;
    width: 0%;
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    animation: splashLoad 1.2s ease forwards;
}
@keyframes splashLoad { to { width: 100%; } }

/* ===== تحسينات الجوال ===== */
* { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, a[onclick] { cursor: pointer; }
.lesson-link { -webkit-user-select: none; user-select: none; }

/* ===== شريط التقدم العام في أعلى الشاشة ===== */
#topProgressBar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: var(--gold);
    width: 0%;
    z-index: 2000;
    transition: width 0.3s ease;
}
:root {
    --primary-dark: #1B3A4B;
    --primary-darker: #0D1F2D;
    --gold: #D4AF37;
    --gold-light: #F0D060;
    --green: #2E8B57;
    --white: #FFFFFF;
    --light-bg: #F8F9FA;
    --text-dark: #1a1a1a;
    --text-light: #555;
    --font: 'Cairo', sans-serif;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.18);
    --radius: 20px;
    --radius-sm: 12px;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font);
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.8;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* ===== شريط التنقل ===== */
.navbar {
    background: rgba(27, 58, 75, 0.95);
    backdrop-filter: blur(10px);
    padding: 14px 30px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.navbar .logo {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--gold);
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar .logo i {
    color: var(--gold-light);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
    align-items: center;
}
.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
}
.nav-links a:hover {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.15);
}
.btn-nav {
    background: var(--gold);
    color: #000 !important;
    padding: 8px 22px;
    border-radius: 30px;
    font-weight: 700;
}
.btn-nav:hover {
    background: var(--gold-light) !important;
    color: #000 !important;
}

.hamburger {
    display: none;
    font-size: 1.8rem;
    color: var(--white);
    cursor: pointer;
}

@media (max-width: 992px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 0;
        background: var(--primary-dark);
        width: 100%;
        padding: 20px 30px;
        gap: 14px;
        border-radius: 0 0 var(--radius) var(--radius);
        box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2);
    }
    .nav-links.active {
        display: flex;
    }
    .hamburger {
        display: block;
    }
    .navbar .logo {
        font-size: 1.4rem;
    }
}

/* ===== الحاوية الرئيسية ===== */
.app-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px 24px;
    min-height: 75vh;
}

/* ===== الأقسام ===== */
.section {
    display: none;
}
.section.active {
    display: block;
}

/* ===== الصفحة الرئيسية ===== */
.hero {
    background: linear-gradient(135deg, #1B3A4B 0%, #0D1F2D 100%);
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    color: var(--white);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 80%;
    height: 160%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold);
    position: relative;
}
.hero p {
    font-size: 1.2rem;
    margin: 12px 0;
    position: relative;
}
.hero .sub-meta {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}
.hero .btn-hero {
    margin-top: 22px;
    font-size: 1.2rem;
    padding: 14px 40px;
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.hero .hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}
.hero .hero-actions .btn-hero {
    margin-top: 0;
}
.hero .btn-game {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--green);
    color: #fff;
    text-decoration: none;
}
.hero .btn-hero:hover {
    transform: scale(1.05);
    background: var(--gold-light);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}
.hero .btn-game:hover {
    background: #257247;
    color: #fff;
}

.section-title {
    text-align: center;
    color: var(--primary-dark);
    font-size: 2rem;
    font-weight: 900;
    margin: 30px 0 20px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gold);
    margin: 8px auto 0;
    border-radius: 4px;
}

/* ===== شبكة الكراسات ===== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 18px 22px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
}
.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--gold);
}
.course-card .icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.course-card h3 {
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.course-card .badge {
    display: inline-block;
    background: var(--light-bg);
    padding: 2px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--text-light);
}
.course-card .progress-indicator {
    margin-top: 12px;
    height: 4px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.course-card .progress-indicator .fill {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ===== تفاصيل الكراسة ===== */
.course-detail-layout {
    display: flex;
    gap: 24px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* القائمة الجانبية */
.sidebar {
    flex: 0 0 var(--sidebar-width);
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 0;
    max-height: 600px;
    overflow-y: auto;
    position: sticky;
    top: 100px;
}
.sidebar h4 {
    padding: 8px 18px;
    color: var(--primary-dark);
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}
.sidebar .lesson-link {
    display: block;
    padding: 8px 18px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    border-right: 3px solid transparent;
    cursor: pointer;
}
.sidebar .lesson-link:hover {
    background: #f1f3f5;
}
.sidebar .lesson-link.active {
    background: #f1f3f5;
    border-right-color: var(--gold);
    font-weight: 700;
}
.sidebar .lesson-link .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    background: #ccc;
}
.sidebar .lesson-link .status-dot.done {
    background: var(--green);
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    min-width: 280px;
}

.course-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    background: var(--white);
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.btn-back {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-back:hover {
    background: var(--primary-darker);
    transform: scale(1.02);
}
.course-title {
    font-size: 1.8rem;
    color: var(--primary-dark);
    font-weight: 900;
    flex: 1;
}
.course-stats {
    font-size: 0.95rem;
    color: var(--text-light);
    background: var(--light-bg);
    padding: 4px 18px;
    border-radius: 30px;
    white-space: nowrap;
}

/* ===== بطاقة الدرس ===== */
.lesson-card {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid #e9ecef;
}
.lesson-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    cursor: pointer;
    background: var(--light-bg);
    transition: var(--transition);
    user-select: none;
}
.lesson-header:hover {
    background: #e9ecef;
}
.lesson-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.lesson-header .lesson-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lesson-header .lesson-meta .status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
}
.lesson-header .lesson-meta .status-dot.done {
    background: var(--green);
}
.lesson-header i {
    color: var(--primary-dark);
    transition: var(--transition);
}

.lesson-body {
    display: none;
    padding: 20px 22px 24px;
    border-top: 1px solid #eee;
    animation: fadeSlide 0.3s ease;
}
.lesson-body.active {
    display: block;
}

@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== تنسيق محتوى الدرس (الأقسام) ===== */
.lesson-content {
    margin-bottom: 18px;
}
.lesson-content .section-block {
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: #f8f9fa;
    border-right: 4px solid var(--gold);
}
.lesson-content .section-block.quote {
    background: #f1f3f5;
    border-right-color: #6c757d;
}
.lesson-content .section-block.quote .source {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--text-light);
}
.lesson-content .section-block.explanation {
    background: #e3f2fd;
    border-right-color: #1a73e8;
}
.lesson-content .section-block.application {
    background: #e8f5e9;
    border-right-color: var(--green);
}
.lesson-content .section-block.benefit {
    background: #fff3e0;
    border-right-color: #f39c12;
}
.lesson-content .section-block .section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.lesson-content .section-block .section-label i {
    width: 1.4rem;
    color: var(--gold);
}
.lesson-content .section-block p {
    margin: 0;
    font-size: 1rem;
}
.lesson-content .section-block ul,
.lesson-content .section-block ol {
    margin: 6px 0 0 20px;
}
.lesson-content .section-block ul li,
.lesson-content .section-block ol li {
    margin-bottom: 4px;
}

/* ===== أزرار الدرس ===== */
.lesson-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    align-items: center;
}
.btn-complete {
    background: var(--green);
    color: white;
    border: none;
    padding: 10px 26px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}
.btn-complete:hover {
    background: #1f6e3e;
    transform: scale(1.03);
}
.btn-complete.done {
    background: #6c757d;
    cursor: default;
}
.btn-complete.done:hover {
    transform: none;
    background: #6c757d;
}
.btn-youtube {
    background: #FF0000;
    color: white;
    border: none;
    padding: 10px 26px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-decoration: none;
}
.btn-youtube:hover {
    background: #cc0000;
    transform: scale(1.03);
    color: white;
}
.btn-book {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 10px 26px;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    text-decoration: none;
}
.btn-book:hover {
    background: #1557b0;
    transform: scale(1.03);
    color: white;
}

/* ===== التنقل بين الدروس ===== */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}
.lesson-navigation button {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}
.lesson-navigation button:hover:not(:disabled) {
    background: var(--primary-darker);
    transform: scale(1.02);
}
.lesson-navigation button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== نافذة التشجيع ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: white;
    padding: 40px 36px 36px;
    border-radius: 30px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: popIn 0.4s ease;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}
@keyframes popIn {
    0% {
        transform: scale(0.6) rotate(-4deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}
.modal-content .stars {
    font-size: 3.2rem;
    color: var(--gold);
    margin-bottom: 10px;
}
.modal-content h2 {
    color: var(--primary-dark);
    font-size: 1.8rem;
}
.modal-content p {
    color: var(--text-light);
    margin: 8px 0 16px;
}
.modal-content .modal-btn {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 10px 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}
.modal-content .modal-btn:hover {
    background: var(--gold-light);
    transform: scale(1.04);
}
.close-modal {
    position: absolute;
    top: 12px;
    left: 20px;
    font-size: 1.6rem;
    cursor: pointer;
    color: #aaa;
    transition: var(--transition);
}
.close-modal:hover {
    color: #333;
    transform: rotate(90deg);
}

/* ===== خطة التدريس ===== */
.plan-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}
.plan-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 500px;
}
.plan-wrapper thead tr {
    background: var(--primary-dark);
    color: white;
}
.plan-wrapper th,
.plan-wrapper td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #eee;
}
.plan-wrapper tbody tr:hover {
    background: #f1f3f5;
}
.plan-wrapper tbody tr:nth-child(even) {
    background: #fafbfc;
}

/* ===== جهات الاتصال ===== */
.contact-box {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.contact-box h2 {
    color: var(--primary-dark);
    font-size: 2rem;
}
.contact-box .contact-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin-top: 28px;
}
.contact-box .contact-buttons a {
    padding: 14px 34px;
    border-radius: 40px;
    font-weight: 700;
    text-decoration: none;
    color: white;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}
.contact-box .contact-buttons .wa {
    background: #25D366;
}
.contact-box .contact-buttons .wa:hover {
    background: #1da851;
    transform: scale(1.04);
}
.contact-box .contact-buttons .tg {
    background: #0088cc;
}
.contact-box .contact-buttons .tg:hover {
    background: #006699;
    transform: scale(1.04);
}
.contact-box .contact-buttons .em {
    background: #6c757d;
}
.contact-box .contact-buttons .em:hover {
    background: #5a6268;
    transform: scale(1.04);
}

/* ===== بطاقة المؤلف ===== */
.author-card {
    background: linear-gradient(135deg, #1B3A4B 0%, #0D1F2D 100%);
    border-radius: var(--radius);
    padding: 32px 24px;
    margin: 40px 0 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.25);
}
.author-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(212,175,55,0.07) 0%, transparent 65%);
    pointer-events: none;
}
.author-card .author-emblem {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #D4AF37, #F0D060);
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 6px 20px rgba(212,175,55,0.35);
    position: relative;
}
.author-card .author-label {
    font-size: 0.82rem;
    color: rgba(212,175,55,0.8);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
}
.author-card .author-name {
    font-size: 1.55rem;
    font-weight: 900;
    color: #D4AF37;
    margin-bottom: 6px;
}
.author-card .author-dua {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.65);
    font-style: italic;
}
.author-card .author-divider {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    margin: 14px auto;
}
.author-card .author-edition {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.25);
    padding: 6px 18px;
    border-radius: 30px;
    color: rgba(255,255,255,0.8);
    font-size: 0.88rem;
}

/* ===== تذييل ===== */
footer {
    background: var(--primary-darker);
    color: white;
    text-align: center;
    padding: 28px 20px 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(212,175,55,0.15);
}
footer .footer-author {
    font-size: 0.9rem;
    color: rgba(212,175,55,0.9);
    margin-bottom: 4px;
    font-weight: 600;
}
footer .footer-title {
    font-size: 1rem;
    color: white;
    font-weight: 700;
    margin-bottom: 12px;
}
footer .footer-copy {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 14px;
}
footer .social-links {
    display: flex;
    justify-content: center;
    gap: 18px;
}
footer .social-links a {
    color: var(--gold);
    font-size: 1.6rem;
    transition: var(--transition);
}
footer .social-links a:hover {
    color: var(--gold-light);
    transform: scale(1.15);
}

/* ===== استجابة ===== */
@media (max-width: 992px) {
    .sidebar {
        flex: 0 0 100%;
        max-height: 300px;
        position: relative;
        top: 0;
    }
    .course-detail-layout {
        flex-direction: column;
    }
}
@media (max-width: 600px) {
    .hero {
        padding: 32px 16px;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1rem;
    }
    .course-header {
        padding: 14px 18px;
        flex-direction: column;
        align-items: stretch;
    }
    .course-title {
        font-size: 1.4rem;
        text-align: center;
    }
    .lesson-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .lesson-header h3 {
        font-size: 1rem;
    }
    .lesson-body {
        padding: 16px;
    }
    .lesson-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .lesson-actions .btn-complete,
    .lesson-actions .btn-youtube,
    .lesson-actions .btn-book {
        justify-content: center;
        padding: 12px;
    }
    .modal-content {
        padding: 30px 20px;
    }
    .navbar {
        padding: 10px 16px;
    }
    .app-container {
        padding: 12px 14px;
    }
    .contact-box .contact-buttons a {
        width: 100%;
        justify-content: center;
    }
    .plan-wrapper table {
        font-size: 0.8rem;
    }
    .plan-wrapper th,
    .plan-wrapper td {
        padding: 8px 10px;
    }
    .lesson-navigation {
        flex-direction: column;
        gap: 12px;
    }
    .lesson-navigation button {
        width: 100%;
        justify-content: center;
    }
}
@media (max-width: 400px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    .course-card {
        padding: 18px 12px;
    }
    .course-card .icon {
        font-size: 2.2rem;
    }
}

/* ================================================================
   نظام الترحيب والإعداد — Welcome & Setup System
   ================================================================ */

/* ===== Overlay الخلفية ===== */
#welcomeOverlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 30, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: overlayFadeIn 0.6s ease forwards;
}
@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===== البطاقة الرئيسية ===== */
#welcomeCard {
    background: linear-gradient(145deg, #0f2335 0%, #1B3A4B 50%, #0f2335 100%);
    border-radius: 28px;
    padding: 0;
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.6),
        0 0 0 1px rgba(212,175,55,0.25),
        inset 0 1px 0 rgba(255,255,255,0.05);
    position: relative;
    animation: cardSlideUp 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes cardSlideUp {
    from { transform: translateY(60px) scale(0.92); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== الرأس المتدرج ===== */
.wc-header {
    background: linear-gradient(135deg, #1a4a60 0%, #0d2535 100%);
    padding: 36px 32px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 28px 28px 0 0;
}
.wc-header::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(212,175,55,0.1) 0%, transparent 65%);
    pointer-events: none;
    animation: pulseGlow 3s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
    from { opacity: 0.5; transform: scale(0.95); }
    to   { opacity: 1;   transform: scale(1.05); }
}

/* ===== الأيقونة الدوارة ===== */
.wc-shield {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #D4AF37, #F0D060, #D4AF37);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 16px;
    box-shadow:
        0 0 0 4px rgba(212,175,55,0.2),
        0 0 0 8px rgba(212,175,55,0.1),
        0 8px 24px rgba(212,175,55,0.4);
    animation: shieldPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}
@keyframes shieldPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(212,175,55,0.2), 0 0 0 8px rgba(212,175,55,0.1), 0 8px 24px rgba(212,175,55,0.4); }
    50%       { box-shadow: 0 0 0 8px rgba(212,175,55,0.3), 0 0 0 16px rgba(212,175,55,0.1), 0 8px 32px rgba(212,175,55,0.6); }
}

.wc-header h1 {
    color: #D4AF37;
    font-size: 1.9rem;
    font-weight: 900;
    margin: 0 0 8px;
    position: relative;
    z-index: 1;
}
.wc-header p {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    position: relative;
    z-index: 1;
}
.wc-header .wc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212,175,55,0.15);
    border: 1px solid rgba(212,175,55,0.35);
    color: #D4AF37;
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 12px;
}

/* ===== جسم البطاقة ===== */
.wc-body {
    padding: 28px 32px 32px;
}

/* ===== الخطوات (Stepper) ===== */
.wc-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}
.wc-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wc-step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.4);
    background: transparent;
    transition: all 0.4s ease;
}
.wc-step-circle.active {
    background: linear-gradient(135deg, #D4AF37, #F0D060);
    color: #000;
    border-color: #D4AF37;
    box-shadow: 0 0 16px rgba(212,175,55,0.5);
}
.wc-step-circle.done {
    background: #2E8B57;
    color: #fff;
    border-color: #2E8B57;
}
.wc-step-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    transition: color 0.4s;
}
.wc-step-item.active .wc-step-label { color: #D4AF37; }
.wc-step-item.done  .wc-step-label { color: #2E8B57; }

.wc-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.1);
    margin: 0 6px;
    margin-bottom: 22px;
    transition: background 0.4s;
    max-width: 60px;
}
.wc-step-line.done { background: #2E8B57; }
.wc-step-line.active { background: linear-gradient(90deg, #2E8B57, #D4AF37); }

/* ===== الخطوة Content ===== */
.wc-step-content {
    display: none;
    animation: stepFadeIn 0.4s ease;
}
.wc-step-content.visible { display: block; }
@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ===== بطاقات الاختيار ===== */
.wc-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}
.wc-option {
    background: rgba(255,255,255,0.04);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.wc-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212,175,55,0.06), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.wc-option:hover {
    border-color: rgba(212,175,55,0.5);
    background: rgba(212,175,55,0.06);
    transform: translateY(-2px);
}
.wc-option:hover::before { opacity: 1; }
.wc-option.selected {
    border-color: #D4AF37;
    background: rgba(212,175,55,0.1);
    box-shadow: 0 0 20px rgba(212,175,55,0.2);
}
.wc-option.selected::before { opacity: 1; }
.wc-option .opt-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.wc-option .opt-icon.gold { background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.1)); }
.wc-option .opt-icon.green { background: linear-gradient(135deg, rgba(46,139,87,0.2), rgba(46,139,87,0.1)); }
.wc-option .opt-text { flex: 1; }
.wc-option .opt-text strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 3px;
}
.wc-option .opt-text span {
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    line-height: 1.4;
}
.wc-option .opt-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.wc-option.selected .opt-check {
    background: #D4AF37;
    border-color: #D4AF37;
    color: #000;
    font-size: 0.7rem;
}

/* ===== منتقي التاريخ ===== */
.wc-date-section {
    margin-bottom: 8px;
}
.wc-date-label {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wc-date-label i { color: #D4AF37; }

.wc-date-picker {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(212,175,55,0.3);
    border-radius: 14px;
    padding: 14px 18px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.wc-date-picker:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}
.wc-date-picker::-webkit-calendar-picker-indicator {
    filter: invert(1) sepia(1) saturate(2) hue-rotate(10deg);
    cursor: pointer;
}

.wc-date-hint {
    background: rgba(46,139,87,0.12);
    border: 1px solid rgba(46,139,87,0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    line-height: 1.6;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.wc-date-hint i { color: #2E8B57; margin-top: 2px; flex-shrink: 0; }

/* ===== بطاقة التأكيد ===== */
.wc-confirm-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 16px;
}
.wc-confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.9rem;
}
.wc-confirm-row:last-child { border-bottom: none; }
.wc-confirm-row .cr-label { color: rgba(255,255,255,0.55); }
.wc-confirm-row .cr-val { color: #D4AF37; font-weight: 700; }

.wc-today-lessons {
    background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(46,139,87,0.05));
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 14px;
    padding: 16px;
    margin-top: 12px;
}
.wc-today-lessons h4 {
    color: #D4AF37;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wc-lesson-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212,175,55,0.12);
    border: 1px solid rgba(212,175,55,0.25);
    color: rgba(255,255,255,0.85);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 3px 3px 3px 0;
}
.wc-lesson-chip i { color: #D4AF37; font-size: 0.75rem; }

/* ===== الأزرار ===== */
.wc-btn-primary {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}
.wc-btn-primary.gold-btn {
    background: linear-gradient(135deg, #D4AF37 0%, #F0D060 50%, #D4AF37 100%);
    background-size: 200% 100%;
    color: #0d1f2d;
    box-shadow: 0 6px 24px rgba(212,175,55,0.4);
    animation: btnShimmer 3s ease-in-out infinite;
}
@keyframes btnShimmer {
    0%   { background-position: 100% 0; }
    50%  { background-position: 0% 0; }
    100% { background-position: 100% 0; }
}
.wc-btn-primary.gold-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 36px rgba(212,175,55,0.6);
}
.wc-btn-primary.gold-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255,255,255,0.3);
    transform: skewX(-20deg);
    animation: btnGlare 3s ease-in-out infinite 1s;
}
@keyframes btnGlare {
    0%   { left: -60%; }
    30%  { left: 120%; }
    100% { left: 120%; }
}
.wc-btn-primary.green-btn {
    background: linear-gradient(135deg, #2E8B57, #3aaa6e);
    color: #fff;
    box-shadow: 0 6px 24px rgba(46,139,87,0.4);
}
.wc-btn-primary.green-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 36px rgba(46,139,87,0.6);
}

.wc-btn-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.wc-btn-row .wc-btn-primary { margin-top: 0; }

.wc-btn-secondary {
    flex: 0 0 auto;
    padding: 16px 20px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s;
}
.wc-btn-secondary:hover {
    border-color: rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.9);
}

.wc-free-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-top: 12px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: color 0.3s;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.wc-free-btn:hover { color: rgba(255,255,255,0.7); }

/* ===== رسالة الجمعة ===== */
#fridayModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,20,30,0.85);
    backdrop-filter: blur(8px);
    z-index: 99980;
    justify-content: center;
    align-items: center;
    padding: 16px;
}
#fridayModal.show { display: flex; }
.friday-card {
    background: linear-gradient(145deg, #1a3a2a, #0d2518);
    border: 1px solid rgba(46,139,87,0.4);
    border-radius: 28px;
    padding: 40px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(46,139,87,0.2);
    animation: cardSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.friday-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}
.friday-card h2 { color: #2E8B57; font-size: 1.7rem; margin-bottom: 10px; }
.friday-card p  { color: rgba(255,255,255,0.75); font-size: 0.95rem; line-height: 1.7; margin-bottom: 6px; }
.friday-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
    padding: 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
}
.friday-stat { text-align: center; }
.friday-stat .fs-num { color: #D4AF37; font-size: 1.8rem; font-weight: 900; display: block; }
.friday-stat .fs-lbl { color: rgba(255,255,255,0.5); font-size: 0.78rem; }

/* ===== قفل الدروس ===== */
.lesson-locked {
    opacity: 0.45;
    pointer-events: none;
    cursor: not-allowed;
    position: relative;
}
.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(13,31,45,0.7);
    border-radius: inherit;
    z-index: 5;
    gap: 6px;
}
.lock-overlay i { color: #D4AF37; font-size: 1.4rem; }
.lock-overlay span { color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 700; }

/* badge وضع الدورة في الـ navbar */
.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(46,139,87,0.2);
    border: 1px solid rgba(46,139,87,0.4);
    color: #3aaa6e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.mode-badge.free-mode {
    background: rgba(212,175,55,0.1);
    border-color: rgba(212,175,55,0.3);
    color: #D4AF37;
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
    #welcomeCard { border-radius: 20px; }
    .wc-header   { padding: 28px 20px 22px; border-radius: 20px 20px 0 0; }
    .wc-body     { padding: 20px 20px 24px; }
    .wc-header h1 { font-size: 1.6rem; }
    .friday-card { padding: 32px 20px; }
    .wc-btn-row { flex-direction: column; }
    .wc-btn-secondary { width: 100%; }
}

/* ===== CMS compatibility: anchors used where legacy markup used buttons/divs ===== */
a.btn-hero, a.course-card, a.btn-back, a.btn-complete { text-decoration: none; }
.lesson-navigation a { text-decoration: none; }
