:root {
            --c-purple: #2D0854;
            --c-purple-dark: #1A0330;
            --c-purple-light: #4A148C;
            --c-gold: #FBC02D;
            --c-gold-hover: #F59E0B;
            --c-bg: #F8FAFC;
            --c-card-border: #E2E8F0;
        }
        body {
            background-color: var(--c-bg);
            font-family: 'Tajawal', sans-serif;
            color: #1E293B;
            margin: 0;
            padding: 0;
        }

        /* البانر البطولي الملكي (Hero Section) */
        .royal-hero-section {
            background: linear-gradient(135deg, var(--c-purple) 0%, var(--c-purple-dark) 100%);
            padding: 60px 20px 70px;
            text-align: center;
            color: #FFF;
            position: relative;
            border-bottom: 4px solid var(--c-gold);
            box-shadow: 0 10px 30px rgba(45, 8, 84, 0.2);
        }
        .royal-hero-section h1 {
            font-size: 38px;
            font-weight: 900;
            margin: 0 0 12px 0;
            color: #FFF;
            letter-spacing: -0.5px;
        }
        .royal-hero-section p {
            font-size: 17px;
            color: #E2E8F0;
            max-width: 800px;
            margin: 0 auto;
            line-height: 1.7;
        }

        /* شريط التبويبات الفاخر الموحد */
        .hub-tabs-container {
            max-width: 1200px;
            margin: -35px auto 30px;
            padding: 0 20px;
            position: relative;
            z-index: 20;
        }
        .hub-tabs-wrapper {
            background: #FFF;
            padding: 10px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(45, 8, 84, 0.08);
            border: 2px solid var(--c-gold);
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .hub-tab-btn {
            flex: 1;
            min-width: 180px;
            padding: 15px 20px;
            border: none;
            background: #F8FAFC;
            border-radius: 14px;
            font-family: inherit;
            font-size: 16px;
            font-weight: 800;
            color: #64748B;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        .hub-tab-btn:hover {
            color: var(--c-purple);
            background: #FAF5FF;
            transform: translateY(-2px);
        }
        .hub-tab-btn.active {
            background: var(--c-purple);
            color: var(--c-gold);
            box-shadow: 0 6px 18px rgba(45, 8, 84, 0.25);
        }
        .hub-badge-count {
            background: rgba(251, 192, 45, 0.25);
            color: var(--c-gold);
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 900;
        }
        .hub-tab-btn:not(.active) .hub-badge-count {
            background: #E2E8F0;
            color: #475569;
        }

        /* شريط التصفية والتقسيم الذكي للمناهج */
        .curricula-nav-bar {
            max-width: 1200px;
            margin: 0 auto 35px;
            padding: 22px 25px;
            background: #FFF;
            border-radius: 20px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.03);
            border: 1px solid var(--c-card-border);
        }
        .filter-header-title {
            font-size: 15px;
            font-weight: 900;
            color: var(--c-purple);
            margin: 0 0 15px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .filter-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 15px;
        }
        .filter-box label {
            display: block;
            font-size: 13px;
            font-weight: 800;
            color: #475569;
            margin-bottom: 6px;
        }
        .filter-select {
            width: 100%;
            padding: 12px 14px;
            border-radius: 12px;
            border: 1.5px solid #CBD5E1;
            font-family: inherit;
            font-size: 14px;
            font-weight: 700;
            background: #F8FAFC;
            color: #1E293B;
            outline: none;
            cursor: pointer;
            transition: 0.25s;
            box-sizing: border-box;
        }
        .filter-select:focus {
            border-color: var(--c-purple);
            background: #FFF;
            box-shadow: 0 0 0 3px rgba(45, 8, 84, 0.08);
        }
        .search-input-wrapper {
            position: relative;
        }
        .search-input-wrapper input {
            padding-right: 38px;
        }
        .search-input-wrapper i {
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: #94A3B8;
        }

        /* حاويات المحتوى للتبويبات */
        .tab-panel-content {
            display: none;
            max-width: 1200px;
            margin: 0 auto 80px;
            padding: 0 20px;
            animation: fadeIn 0.4s ease;
        }
        .tab-panel-content.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        /* ==========================================================
           1. بطاقات الكورسات 
           ========================================================== */
        .videos-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
            gap: 25px;
        }
        .pro-course-card {
            position: relative;
            border-radius: 20px;
            overflow: hidden;
            aspect-ratio: 4 / 5;
            box-shadow: 0 10px 25px rgba(0,0,0,0.08);
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            background: #FFF;
            border: 1.5px solid var(--c-card-border);
        }
        .pro-course-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 45px rgba(45, 8, 84, 0.18);
            border-color: var(--c-gold);
        }
        .pro-course-img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.6s ease;
            z-index: 1;
        }
        .pro-course-card:hover .pro-course-img {
            transform: scale(1.08);
        }
        
        .pro-card-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(26, 3, 48, 0.95) 0%, rgba(26, 3, 48, 0.4) 35%, transparent 65%);
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: 26px 22px; 
            z-index: 2;
            transition: all 0.4s ease;
        }
        .pro-course-card:hover .pro-card-overlay {
            background: linear-gradient(to top, rgba(26, 3, 48, 0.98) 0%, rgba(26, 3, 48, 0.7) 45%, rgba(26, 3, 48, 0.1) 100%);
        }

        .pro-badges-container {
            position: absolute;
            top: 16px;
            left: 16px;
            right: 16px;
            display: flex;
            justify-content: space-between;
            z-index: 3;
        }
        .pro-badge {
            background: rgba(255, 255, 255, 0.25);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            color: #FFF;
            padding: 6px 14px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 800;
            border: 1px solid rgba(255, 255, 255, 0.35);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .pro-badge.gold {
            background: var(--c-gold);
            color: var(--c-purple-dark);
            border-color: var(--c-gold);
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }

        .pro-card-content {
            position: relative;
            z-index: 3;
            transform: translateY(8px); 
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .pro-course-card:hover .pro-card-content {
            transform: translateY(-44px); 
        }
        
        .pro-card-content h3 {
            color: #FFF;
            font-size: 21px;
            font-weight: 900;
            margin: 0 0 10px;
            line-height: 1.4;
            text-shadow: 0 2px 6px rgba(0,0,0,0.8);
        }
        .pro-card-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid rgba(255, 255, 255, 0.25);
            padding-top: 12px;
        }
        .pro-card-meta span {
            color: var(--c-gold);
            font-size: 13.5px;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .pro-hover-btn {
            position: absolute;
            bottom: 22px;
            left: 22px;
            right: 22px;
            background: var(--c-gold);
            color: var(--c-purple-dark);
            text-align: center;
            padding: 12px;
            border-radius: 12px;
            font-weight: 900;
            font-size: 15px;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            z-index: 3;
            box-shadow: 0 6px 15px rgba(251, 192, 45, 0.4);
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
        }
        .pro-course-card:hover .pro-hover-btn {
            opacity: 1;
            transform: translateY(0);
        }

        /* ==========================================================
           2. بطاقات الكتب المدرسية 
           ========================================================== */
        .books-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 25px;
        }
        .book-card {
            background: #FFF;
            border-radius: 20px;
            border: 1.5px solid var(--c-card-border);
            overflow: hidden;
            box-shadow: 0 6px 20px rgba(0,0,0,0.03);
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
        }
        .book-card:hover {
            transform: translateY(-6px);
            border-color: var(--c-gold);
            box-shadow: 0 15px 35px rgba(45, 8, 84, 0.12);
        }
        .book-cover-wrap {
            position: relative;
            aspect-ratio: 3 / 4;
            background: #F1F5F9;
            overflow: hidden;
        }
        .book-cover-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.4s ease;
        }
        .book-card:hover .book-cover-img {
            transform: scale(1.05);
        }
        .book-card-body {
            padding: 18px;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }
        .book-card-body h3 {
            font-size: 17px;
            font-weight: 900;
            color: var(--c-purple);
            margin: 0 0 10px;
            line-height: 1.4;
        }
        .book-meta-tags {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 15px;
        }
        .book-tag {
            background: #FAF5FF;
            color: var(--c-purple);
            border: 1px solid #D8B4FE;
            padding: 4px 10px;
            border-radius: 8px;
            font-size: 11.5px;
            font-weight: 800;
        }
        .book-btn-download {
            background: var(--c-purple);
            color: var(--c-gold);
            border: none;
            padding: 12px;
            border-radius: 12px;
            font-weight: 900;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            text-decoration: none;
            transition: 0.25s;
        }
        .book-btn-download:hover {
            background: var(--c-purple-dark);
            box-shadow: 0 4px 12px rgba(45,8,84,0.3);
        }

        /* ==========================================================
           3. بطاقات أوراق العمل الفاخرة 
           ========================================================== */
        .worksheets-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 30px;
        }
        .ws-luxury-card {
            background: #FFF;
            border-radius: 22px;
            border: 1.5px solid #E2E8F0;
            padding: 16px;
            box-shadow: 0 8px 24px rgba(45, 8, 84, 0.05);
            transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            display: flex;
            flex-direction: column;
            position: relative;
        }
        .ws-luxury-card:hover {
            transform: translateY(-8px);
            border-color: var(--c-purple);
            box-shadow: 0 20px 45px rgba(45, 8, 84, 0.16);
        }

        .ws-a4-frame-wrap {
            position: relative;
            aspect-ratio: 1 / 1.35;
            background: #F8FAFC;
            border-radius: 16px;
            overflow: hidden;
            border: 2px solid #E2E8F0;
            box-shadow: inset 0 0 15px rgba(0,0,0,0.03);
            margin-bottom: 16px;
        }
        .ws-luxury-card:hover .ws-a4-frame-wrap {
            border-color: var(--c-gold);
        }

        .ws-grade-ribbon {
            position: absolute;
            top: 12px;
            right: 12px;
            background: linear-gradient(135deg, var(--c-gold), #F59E0B);
            color: var(--c-purple);
            font-weight: 900;
            font-size: 12px;
            padding: 5px 14px;
            border-radius: 20px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.25);
            z-index: 5;
            display: flex;
            align-items: center;
            gap: 5px;
            border: 1px solid rgba(255,255,255,0.4);
        }

        .ws-type-pill {
            position: absolute;
            top: 12px;
            left: 12px;
            background: rgba(45, 8, 84, 0.85);
            backdrop-filter: blur(4px);
            color: #FFF;
            font-weight: 800;
            font-size: 11px;
            padding: 4px 10px;
            border-radius: 10px;
            z-index: 5;
        }

        .ws-preview-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: top center;
            transition: transform 0.5s ease;
            cursor: pointer;
        }
        .ws-luxury-card:hover .ws-preview-image {
            transform: scale(1.04);
        }

        .ws-doc-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
            color: #92400E;
            padding: 20px;
            text-align: center;
            box-sizing: border-box;
        }
        .ws-doc-placeholder i {
            font-size: 64px;
            margin-bottom: 12px;
            color: #D97706;
        }

        .ws-hover-actions {
            position: absolute;
            inset: 0;
            background: rgba(45, 8, 84, 0.7);
            backdrop-filter: blur(2px);
            opacity: 0;
            transition: opacity 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 12px;
            z-index: 6;
        }
        .ws-luxury-card:hover .ws-hover-actions {
            opacity: 1;
        }
        .btn-ws-zoom {
            background: var(--c-gold);
            color: var(--c-purple);
            border: none;
            padding: 10px 20px;
            border-radius: 12px;
            font-weight: 900;
            font-size: 13.5px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            transition: 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .btn-ws-zoom:hover {
            transform: scale(1.05);
            background: #FFF;
        }

        .ws-details-wrap {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }
        .ws-details-wrap h3 {
            font-size: 17px;
            font-weight: 900;
            color: var(--c-purple);
            margin: 0 0 8px;
            line-height: 1.4;
        }
        .ws-meta-pills {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }
        .ws-pill {
            background: #F1F5F9;
            color: #475569;
            padding: 3px 9px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 800;
        }
        .ws-action-bar {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 8px;
        }
        .btn-ws-dl {
            background: var(--c-purple);
            color: var(--c-gold);
            padding: 11px;
            border-radius: 12px;
            font-weight: 900;
            font-size: 13.5px;
            text-align: center;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: 0.25s;
        }
        .btn-ws-dl:hover {
            background: var(--c-purple-dark);
            box-shadow: 0 4px 12px rgba(45,8,84,0.25);
        }
        .btn-ws-ans {
            background: #ECFDF5;
            color: #059669;
            border: 1px solid #A7F3D0;
            padding: 11px 14px;
            border-radius: 12px;
            font-weight: 800;
            font-size: 13px;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .btn-ws-ans:hover { background: #D1FAE5; }

        /* ==========================================================
           4. نافذة تكبير الصور
           ========================================================== */
        .lightbox-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            z-index: 999999;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .lightbox-content {
            position: relative;
            max-width: 90vw;
            max-height: 92vh;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .lightbox-img {
            max-width: 100%;
            max-height: 82vh;
            object-fit: contain;
            border-radius: 14px;
            box-shadow: 0 20px 50px rgba(0,0,0,0.6);
            border: 3px solid var(--c-gold);
        }
        .lightbox-toolbar {
            margin-top: 15px;
            display: flex;
            gap: 15px;
            align-items: center;
        }
        .btn-lightbox-close {
            position: absolute;
            top: -45px;
            left: 0;
            background: #EF4444;
            color: #FFF;
            border: none;
            width: 38px;
            height: 38px;
            border-radius: 50%;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

       /* ==========================================================
           مشغل الكورس المتكامل (LMS Cinema Studio) 
           ========================================================== */
        .course-modal {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.98);
            z-index: 99999;
            display: none;
            padding: 15px;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(8px);
        }
        .lms-player-container {
            display: flex;
            width: 100%;
            max-width: 1260px;
            height: 90vh;
            max-height: 780px;
            background: #FFF;
            border-radius: 22px;
            overflow: hidden;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
            position: relative;
            border: 1.5px solid var(--c-purple);
            animation: popModal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        }

        /* القائمة الجانبية */
        .lms-sidebar {
            flex: 1.1;
            min-width: 310px;
            background: var(--c-purple);
            color: #FFF;
            border-left: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            flex-direction: column;
        }
        .sidebar-header {
            background: rgba(0, 0, 0, 0.25);
            color: var(--c-gold);
            padding: 16px;
            text-align: center;
            font-weight: 900;
            font-size: 17px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }
        .sidebar-list {
            flex: 1;
            overflow-y: auto;
            padding: 12px;
            scrollbar-width: thin;
            scrollbar-color: var(--c-gold) transparent;
        }
        .playlist-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            border-radius: 12px;
            margin-bottom: 10px;
            transition: all 0.25s ease;
            position: relative;
            border: 1.5px solid transparent;
            background: rgba(255, 255, 255, 0.03);
        }
        .playlist-item.locked { opacity: 0.45; pointer-events: none; }
        .playlist-item.unlocked { cursor: pointer; }
        .playlist-item.unlocked:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); transform: translateX(-4px); }
        .playlist-item.active-playing { background: rgba(251, 192, 45, 0.12); border-color: var(--c-gold); box-shadow: inset 4px 0 0 var(--c-gold); }

        .item-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            flex-shrink: 0;
            font-weight: bold;
            background: rgba(255, 255, 255, 0.1);
            color: #FFF;
        }
        .active-playing .item-icon { background: var(--c-gold); color: var(--c-purple); }
        .completed .item-icon { background: #10B981; color: #FFF; }

        .item-details h4 { margin: 0 0 4px; font-size: 13.5px; font-weight: 800; color: #FFF; line-height: 1.35; }
        .item-details span { font-size: 11px; color: rgba(255, 255, 255, 0.65); font-weight: bold; }

        .cert-container { padding: 14px; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.1); display: none; background: rgba(0, 0, 0, 0.2); }
        .btn-certificate {
            background: linear-gradient(135deg, var(--c-gold), #F59E0B);
            color: var(--c-purple);
            width: 100%;
            padding: 12px;
            border-radius: 12px;
            border: none;
            font-weight: 900;
            font-size: 14.5px;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(251, 192, 45, 0.3);
            transition: 0.25s;
        }
        .btn-certificate:hover { transform: translateY(-2px); background: #FFF; }

        /* منطقة الشاشة والمشغل (احتواء كامل بدون سحاب) */
        .lms-main-area {
            flex: 3;
            display: flex;
            flex-direction: column;
            justify-content: space-between; 
            background: #F8FAFC;
            height: 100%;
            overflow: hidden; 
            box-sizing: border-box;
            padding-bottom: 15px; 
        }

        /* حاوية الفيديو المضبوطة هندسياً لتتكيف مع الشاشة عمودياً وأفقياً */
        .video-wrapper {
            padding: 15px 20px 10px; 
            width: 100%;
            flex: 1; 
            display: flex;
            align-items: center; 
            justify-content: center;
            box-sizing: border-box;
            min-height: 0; 
        }
        .video-container {
            width: 100%;
            max-width: 820px; 
            max-height: 100%; 
            background: #000;
            aspect-ratio: 16 / 9;
            position: relative;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            border: 2px solid var(--c-gold);
            flex-shrink: 1;
        }
        
        /* إجبار إخفاء أدوات يوتيوب الأساسية ومنع اللمس نهائياً */
        .video-container iframe, 
        .video-container #ytPlayerDiv { 
            position: absolute;
            top: 0; left: 0;
            width: 100% !important; 
            height: 100% !important; 
            border: none; 
            display: block;
            pointer-events: none !important; /* إجبار المنع */
            user-select: none !important;
        }

        /* طبقة الحماية الفولاذية فوق الفيديو - تلتقط أي نقرة قبل أن تصل ليوتيوب */
        .video-blocker {
            position: absolute; 
            top: 0; left: 0; right: 0; bottom: 0;
            width: 100%; height: 100%;
            z-index: 5; 
            cursor: pointer;
            background: rgba(0, 0, 0, 0.01); /* خلفية شبه شفافة ضرورية لصد النقرات بقوة */
        }

        /* لوحة تحكم الميديا الخاصة بالمعهد (ظاهرة دائماً لتعطيل يوتيوب تماماً) */
        .custom-video-controls {
            position: absolute; bottom: 0; left: 0; width: 100%; z-index: 10;
            background: linear-gradient(to top, rgba(26, 3, 48, 0.98) 0%, rgba(26, 3, 48, 0.7) 50%, transparent 100%);
            padding: 40px 20px 15px; display: flex; flex-direction: column; gap: 10px;
            opacity: 1; 
            box-sizing: border-box; /* هذا هو السطر السحري الذي سيُدخل الأيقونة داخل الإطار تماماً */
        }

        .custom-progress-container { 
            width: 100%; height: 6px; background: rgba(255,255,255,0.25); border-radius: 5px; position: relative; cursor: pointer; transition: 0.2s;
        }
        .custom-progress-container:hover { height: 8px; }
        .custom-progress-max { position: absolute; height: 100%; background: rgba(251, 192, 45, 0.35); border-radius: 5px; width: 0%; left: 0; top: 0; z-index: 1; pointer-events: none; }
        .custom-progress-fill { position: absolute; height: 100%; background: var(--c-gold); border-radius: 5px; width: 0%; left: 0; top: 0; z-index: 2; pointer-events: none; }
        .progress-thumb { position: absolute; right: -6px; top: -3px; width: 12px; height: 12px; background: #FFF; border-radius: 50%; box-shadow: 0 0 5px rgba(0,0,0,0.5); }
        .custom-progress-container:hover .progress-thumb { transform: scale(1.3); }

        .custom-controls-row { display: flex; justify-content: space-between; align-items: center; }
        .custom-ctrl-btn { background: none; border: none; color: #FFF; cursor: pointer; font-size: 18px; padding: 5px; transition: 0.2s; outline: none; }
        .custom-ctrl-btn:hover { color: var(--c-gold); transform: scale(1.15); }
        .custom-time-display { color: #FFF; font-size: 13.5px; font-weight: 800; font-family: monospace; letter-spacing: 1px; }

        /* ==========================================================
           منطقة السؤال المدمجة وقفل الاختبار
           ========================================================== */
        .quiz-stage-container {
            padding: 0 20px 5px;
            max-width: 820px;
            margin: 0 auto;
            width: 100%;
            box-sizing: border-box;
            flex-shrink: 0;
        }
        .quiz-stage-box {
            background: #FFFFFF;
            border-radius: 18px; 
            padding: 20px 24px; 
            border: 2px solid #E2E8F0;
            box-shadow: 0 8px 20px rgba(45, 8, 84, 0.05);
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            gap: 15px; 
            min-height: 180px; 
        }

        /* شاشة القفل لمنع الحل قبل المشاهدة */
        .quiz-locked-overlay {
            position: absolute; inset: 0; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(6px);
            display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 50;
            text-align: center; transition: opacity 0.5s ease;
        }
        .quiz-locked-overlay i { font-size: 45px; color: var(--c-purple); margin-bottom: 12px; }
        .quiz-locked-overlay h3 { color: var(--c-purple); font-size: 20px; font-weight: 900; margin: 0 0 8px; }
        .quiz-locked-overlay p { color: #64748B; font-weight: 700; font-size: 14.5px; margin: 0; max-width: 80%; line-height: 1.6; }

        .quiz-header-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1.5px dashed #CBD5E1;
            padding-bottom: 12px;
        }
        .quiz-lesson-heading {
            font-size: 16px;
            font-weight: 900;
            color: var(--c-purple);
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }
        .quiz-status-pill {
            background: rgba(251, 192, 45, 0.15); 
            color: #B45309;
            padding: 5px 12px;
            border-radius: 20px; 
            font-size: 12.5px;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 6px;
            border: 1px solid rgba(251, 192, 45, 0.3);
        }

        .quiz-progress-track {
            background: #F1F5F9;
            height: 6px; 
            border-radius: 10px;
            overflow: hidden;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
        }
        .quiz-progress-bar {
            background: linear-gradient(90deg, var(--c-purple-light), var(--c-purple)); 
            height: 100%;
            width: 0%;
            transition: width 0.4s ease-out;
            border-radius: 10px;
        }

        .question-card-wrapper {
            position: relative;
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
            background: #FAFCFE; 
            padding: 20px;
            border-radius: 14px;
            border: 1px solid #E2E8F0;
        }
        .question-card-wrapper.slide-out-right {
            transform: translateX(100px);
            opacity: 0;
            pointer-events: none;
        }
        .question-card-wrapper.slide-in-left {
            transform: translateX(-100px);
            opacity: 0;
        }
        .question-card-wrapper.slide-normal {
            transform: translateX(0);
            opacity: 1;
        }

        .quiz-question-title {
            font-size: 18px; 
            font-weight: 900;
            color: var(--c-purple);
            margin: 0 0 16px;
            line-height: 1.5;
            text-align: center; 
        }

        .pro-quiz-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
            gap: 12px;
        }
        .pro-quiz-card {
            background: #FFFFFF;
            border: 2px solid #CBD5E1;
            border-radius: 14px; 
            padding: 14px 16px;
            cursor: pointer;
            font-weight: 800;
            font-size: 15px;
            color: #334155;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 55px; 
            user-select: none;
            box-sizing: border-box;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.03);
        }
        .pro-quiz-card:hover {
            border-color: var(--c-gold); 
            background: #FFFBEB;
            transform: translateY(-3px);
            color: var(--c-purple);
            box-shadow: 0 6px 12px rgba(251, 192, 45, 0.15);
        }
        .pro-quiz-card.correct {
            background: #ECFDF5 !important;
            border-color: #10B981 !important;
            color: #065F46 !important;
            transform: scale(1.03);
            box-shadow: 0 6px 15px rgba(16, 185, 129, 0.2);
        }
        .pro-quiz-card.wrong {
            background: #FEF2F2 !important;
            border-color: #EF4444 !important;
            color: #991B1B !important;
            animation: shake 0.4s ease;
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-6px); }
            40%, 80% { transform: translateX(6px); }
        }

        .lesson-unlock-celebration {
            text-align: center;
            padding: 15px;
            animation: fadeIn 0.5s ease;
        }
        .lesson-unlock-celebration h4 {
            margin: 0 0 8px;
            color: #059669;
            font-size: 19px;
            font-weight: 900;
        }
        .lesson-unlock-celebration p {
            margin: 0;
            color: #475569;
            font-size: 14px;
            font-weight: 700;
            line-height: 1.6;
        }

        .btn-close-course {
            position: absolute;
            top: 20px; 
            left: 20px; 
            background: #EF4444;
            border: 2px solid #FFF;
            color: #FFF;
            width: 42px;
            height: 42px;
            border-radius: 50%;
            font-size: 20px;
            cursor: pointer;
            z-index: 100;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
            transition: all 0.3s ease;
        }
        .btn-close-course:hover {
            background: #DC2626;
            transform: scale(1.1) rotate(90deg);
        }

        /* رسالة عدم وجود نتائج التصفية */
        .no-results-msg {
            display: none;
            grid-column: 1 / -1;
            text-align: center;
            padding: 50px 20px;
            background: #FFF;
            border-radius: 20px;
            border: 1.5px dashed #CBD5E1;
            color: #64748B;
        }
        .no-results-msg i {
            font-size: 45px;
            color: #E2E8F0;
            margin-bottom: 15px;
            display: block;
        }

        .swal2-container {
            z-index: 999999 !important;
        }

        @media (max-width: 900px) {
            .lms-player-container { flex-direction: column; height: 100vh; max-height: 100vh; border-radius: 0; border: none; }
            .lms-main-area { flex: 1; overflow-y: auto; padding-bottom: 15px; }
            .btn-close-course { top: 15px; left: 15px; width: 38px; height: 38px; font-size: 18px; background: #DC2626; }
            .video-wrapper { padding: 60px 15px 15px; } 
            .video-container { border-radius: 12px; border-width: 1.5px; }
            .quiz-stage-container { padding: 10px 15px; }
            .lms-sidebar { flex: none; max-height: 35vh; overflow-y: auto; border-left: none; border-top: 2px solid rgba(255, 255, 255, 0.1); order: 3; }
        }
/* ==========================================================
   التصميم المفصول الحديث لكروت الدورات (Split Course Card 16:9)
   يمنع تداخل النصوص مع غلاف الدورة نهائياً
   ========================================================== */
.hero-section-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(251, 192, 45, 0.16);
    border: 1.5px solid rgba(251, 192, 45, 0.45);
    color: var(--c-gold);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 13.5px;
    font-weight: 800;
    margin-bottom: 14px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.course-split-card {
    background: #FFFFFF;
    border-radius: 22px;
    border: 1.5px solid #E2E8F0;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(45, 8, 84, 0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.course-split-card:hover {
    transform: translateY(-8px);
    border-color: var(--c-gold);
    box-shadow: 0 20px 45px rgba(45, 8, 84, 0.14);
}

/* الجزء العلوي: صورة الغلاف بنسبة 16:9 كاملة الوضوح دون أي نصوص فوقها */
.course-split-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1A0330;
    overflow: hidden;
    border-bottom: 2px solid rgba(251, 192, 45, 0.35);
}

.course-split-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s ease;
}

.course-split-card:hover .course-split-img {
    transform: scale(1.06);
}

.course-play-Floating-icon {
    position: absolute;
    inset: 0;
    background: rgba(26, 3, 48, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.course-play-Floating-icon i {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-gold);
    color: var(--c-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.course-split-card:hover .course-play-Floating-icon {
    opacity: 1;
}

.course-split-card:hover .course-play-Floating-icon i {
    transform: scale(1);
}

/* الجزء السفلي: قاعدة الكارت الملكية للتفاصيل */
.course-split-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    gap: 16px;
    background: #FFFFFF;
}

.course-split-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 12px;
}

.c-split-badge {
    font-size: 11.5px;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.c-split-badge.purple {
    background: #FAF5FF;
    color: var(--c-purple);
    border: 1px solid #E9D5FF;
}

.c-split-badge.gold {
    background: #FFFDF0;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.c-split-badge.slate {
    background: #F1F5F9;
    color: #475569;
}

.course-split-title {
    font-size: 19px;
    font-weight: 900;
    color: var(--c-purple);
    margin: 0;
    line-height: 1.45;
}

.course-split-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-bottom: 14px;
    border-top: 1px dashed #E2E8F0;
    font-size: 13px;
    font-weight: 800;
}

.lessons-pill {
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lessons-pill i {
    color: var(--c-purple);
}

.cert-pill {
    color: #B45309;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cert-pill i {
    color: var(--c-gold-hover);
}

.course-split-cta {
    width: 100%;
    background: linear-gradient(135deg, var(--c-purple) 0%, var(--c-purple-dark) 100%);
    color: var(--c-gold);
    border: none;
    padding: 13px 18px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(45, 8, 84, 0.18);
}

.course-split-card:hover .course-split-cta {
    background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-gold-hover) 100%);
    color: var(--c-purple-dark);
    box-shadow: 0 6px 20px rgba(251, 192, 45, 0.4);
}

/* ==========================================================
   تحسينات مشغل الدروس السينمائي (LMS Studio Player Upgrades)
   ========================================================== */
.lms-top-studio-bar {
    background: #FFFFFF;
    border-bottom: 1.5px solid #E2E8F0;
    padding: 10px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.studio-lesson-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--c-purple);
    font-size: 15px;
    font-weight: 900;
}

.studio-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.btn-close-course-inline {
    background: #FEF2F2;
    color: #DC2626;
    border: 1.5px solid #FECACA;
    padding: 6px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-close-course-inline:hover {
    background: #DC2626;
    color: #FFFFFF;
    border-color: #DC2626;
}

/* تكبير وتمديد إطار يوتيوب قليلاً لإخفاء الشوائب العلوية والسفلية */
.video-container iframe,
.video-container #ytPlayerDiv {
    top: -12% !important;
    height: 124% !important;
}

/* تحسين شاشة قفل الاختبار لتكون أنيقة ومدمجة */
.quiz-stage-box {
    min-height: 120px !important;
    padding: 14px 20px !important;
}

.locked-pill-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #FAF5FF;
    border: 1.5px dashed #D8B4FE;
    padding: 14px 24px;
    border-radius: 16px;
    max-width: 560px;
}

.locked-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--c-purple);
    color: var(--c-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.locked-pill-box h3 {
    font-size: 16px !important;
    margin: 0 0 4px 0 !important;
    color: var(--c-purple) !important;
}

.locked-pill-box p {
    font-size: 13px !important;
    margin: 0 !important;
    max-width: 100% !important;
    color: #64748B !important;
}

.quiz-section-tag {
    font-size: 14px;
    font-weight: 900;
    color: var(--c-purple);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}