/* ==========================================================================
   المركز الليبي للاستشارات والتنمية البشرية - دليل البرامج والكتالوج (Catalog Stylesheet)
   ========================================================================== */

/* ----------------------------------------------------
   1. المتغيرات اللونية والتصميم الأساسي (Design Tokens)
   ---------------------------------------------------- */
:root {
    --navy-dark: #0A0F1D;
    --navy-corporate: #141F36;
    --blue-identity: #344E97;
    --gold-premium: #B68D2E;
    --gold-glow: #D4AF37;
    --cream-clean: #FDFBF7;
    --text-main: #1A222E;
    --white: #FFFFFF;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

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

*:focus-visible {
    outline: 2px solid var(--gold-premium) !important;
    outline-offset: 3px !important;
    border-radius: 4px;
}

body {
    font-family: var(--font-official, 'Cairo', sans-serif);
    background-color: var(--cream-clean);
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* الزخرفة الهندسية بشفافية منخفضة في خلفية الصفحة */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cg stroke='%23B68D2E' stroke-width='1.5' stroke-opacity='0.03' fill='none'%3E%3Cpath d='M50 15L58 35L75 25L65 42L85 50L65 58L75 75L58 65L50 85L42 65L25 75L35 58L15 50L35 42L25 25L42 35Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px;
    pointer-events: none;
    z-index: -1;
}

/* ----------------------------------------------------
   2. شريط تقدم التمرير (Scroll Progress Bar)
   ---------------------------------------------------- */
#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-premium), var(--gold-glow));
    z-index: 999999;
    transition: width 0.1s ease;
}

/* ----------------------------------------------------
   3. قسم البطل (Hero Banner) لصفحة الكاتلوج
   ---------------------------------------------------- */
.catalog-hero-banner {
    background: linear-gradient(135deg, #0B121F 0%, #162238 50%, #233554 100%);
    color: var(--white);
    padding: 70px 6% 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.catalog-hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cg stroke='%23B68D2E' stroke-width='1.5' stroke-opacity='0.04' fill='none'%3E%3Cpath d='M50 15L58 35L75 25L65 42L85 50L65 58L75 75L58 65L50 85L42 65L25 75L35 58L15 50L35 42L25 25L42 35Z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 120px;
    pointer-events: none;
    z-index: 1;
}
.catalog-hero-container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: auto;
}
.catalog-hero-banner h1 {
    font-family: var(--font-official, 'Cairo', sans-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.35;
}
.catalog-hero-banner h1 span {
    color: var(--gold-glow);
}
.catalog-hero-banner p {
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    opacity: 0.9;
    max-width: 720px;
    margin: 0 auto 20px;
    line-height: 1.7;
    color: #e2e8f0;
}

/* شريط الثقة التنفيذي (Executive Trust Bar) */
.executive-trust-bar {
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 10px 25px;
    border-radius: 40px;
    flex-wrap: wrap;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gold-glow);
}
.trust-item i {
    color: var(--gold-premium);
}
.trust-divider {
    width: 1px;
    height: 16px;
    background: rgba(212, 175, 55, 0.3);
}

/* ----------------------------------------------------
   4. التخطيط الرئيسي للكاتلوج (Catalog Main Layout)
   ---------------------------------------------------- */
.catalog-main-layout {
    width: 100%;
    padding: 48px clamp(16px, 4vw, 56px) 72px;
    max-width: 1440px;
    margin: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "content filters";
    gap: clamp(24px, 3vw, 40px);
    align-items: start;
    direction: ltr;
}

html[dir="ltr"] .catalog-main-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-areas: "filters content";
}

/* زر إظهار الفلاتر على الهواتف */
.filter-mobile-toggle {
    display: none;
}

/* ----------------------------------------------------
   5. شريط التصفية الجانبي (Filters Sidebar)
   ---------------------------------------------------- */
.filter-sidebar {
    grid-area: filters;
    direction: rtl;
    background: rgba(255, 255, 255, 0.98);
    padding: 26px 22px;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(11, 18, 31, 0.06);
    border: 1px solid rgba(182, 141, 46, 0.16);
    border-top: 4px solid var(--gold-premium);
    height: fit-content;
    position: sticky;
    top: 105px;
    overflow: hidden;
}
html[dir="ltr"] .filter-sidebar {
    direction: ltr;
}
.filter-section {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #EDF0F4;
}
.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}
.filter-title {
    font-family: var(--font-official, 'Cairo', sans-serif);
    font-size: 15.5px;
    font-weight: 700;
    color: var(--navy-corporate);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(182, 141, 46, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-title i {
    color: var(--gold-premium);
    font-size: 14px;
}
.filter-options {
    list-style: none;
    margin: 0;
    padding: 0;
}
.filter-options li {
    margin-bottom: 6px;
}
.filter-options li:last-child {
    margin-bottom: 0;
}
.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #4A5568;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}
.filter-checkbox-label input {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #CBD5E1;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: grid;
    place-content: center;
    flex: 0 0 18px;
}
.filter-checkbox-label input::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: var(--white);
    transform: scale(0);
    transition: transform 0.2s ease-in-out;
}
.filter-checkbox-label input:checked {
    border-color: var(--gold-premium);
    background-color: var(--gold-premium);
}
.filter-checkbox-label input:checked::before {
    transform: scale(1);
}
.filter-checkbox-label:hover {
    color: var(--gold-premium);
    background: rgba(182, 141, 46, 0.07);
}

/* ----------------------------------------------------
   6. منطقة الكتالوج الرئيسية (Catalog Content Area)
   ---------------------------------------------------- */
.catalog-content-area {
    grid-area: content;
    direction: rtl;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
html[dir="ltr"] .catalog-content-area {
    direction: ltr;
}

/* أدوات التحكم العلوية والبحث */
.catalog-topbar-controls {
    background: rgba(255, 255, 255, 0.98);
    padding: 16px 18px;
    border-radius: 16px;
    box-shadow: 0 14px 36px rgba(11, 18, 31, 0.05);
    border: 1px solid rgba(182, 141, 46, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.search-box-wrapper {
    position: relative;
    flex: 1;
    min-width: 260px;
}
.search-box-wrapper i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 15px;
}
html[dir="ltr"] .search-box-wrapper i {
    right: auto;
    left: 18px;
}
.search-input-field {
    width: 100%;
    padding: 12px 48px 12px 18px;
    border: 1.5px solid #E2E8F0;
    background: var(--cream-clean);
    border-radius: 10px;
    font-family: var(--font-official, 'Cairo', sans-serif);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--navy-corporate);
    transition: var(--transition-smooth);
}
html[dir="ltr"] .search-input-field {
    padding: 12px 18px 12px 48px;
}
.search-input-field:focus {
    outline: none;
    border-color: var(--gold-premium);
    background: var(--white);
    box-shadow: 0 0 12px rgba(182, 141, 46, 0.12);
}

.view-switcher-box {
    display: flex;
    align-items: center;
    gap: 8px;
}
.view-btn {
    background: rgba(182, 141, 46, 0.06);
    border: 1px solid rgba(182, 141, 46, 0.14);
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: var(--navy-corporate);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.view-btn:hover {
    background: rgba(182, 141, 46, 0.12);
    color: var(--gold-premium);
}
.view-btn.active {
    background: var(--navy-corporate);
    border-color: var(--navy-corporate);
    color: var(--white);
}

.courses-count-text {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
}

/* شارات التصفية النشطة */
.active-filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filter-badge-item {
    background: rgba(182, 141, 46, 0.08);
    border: 1px solid rgba(182, 141, 46, 0.22);
    color: var(--gold-premium);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.filter-badge-item button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.filter-badge-item button:hover {
    color: red;
    transform: scale(1.1);
}
.clear-all-filters-btn {
    background: none;
    border: none;
    color: #E53E3E;
    font-size: 12.5px;
    font-weight: 700;
    font-family: var(--font-official, 'Cairo', sans-serif);
    cursor: pointer;
    margin-inline-start: 8px;
    transition: var(--transition-smooth);
}
.clear-all-filters-btn:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------
   7. شبكة كروت الدورات (Courses Grid & Cards)
   ---------------------------------------------------- */
.catalog-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 24px;
    transition: var(--transition-smooth);
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.course-card {
    min-width: 0;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(11, 18, 31, 0.05);
    border: 1px solid rgba(182, 141, 46, 0.12);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
    animation: cardFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(182, 141, 46, 0.15);
    border-color: rgba(182, 141, 46, 0.3);
}

.course-image-wrapper {
    position: relative;
    width: 100%;
    height: 185px;
    overflow: hidden;
    background: #F3F5F8;
}
.course-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}
.course-card:hover .course-image-wrapper img {
    transform: scale(1.06);
}

.course-status-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--white);
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
html[dir="ltr"] .course-status-badge {
    right: auto;
    left: 14px;
}
.status-open {
    background: linear-gradient(135deg, #25D366, #1EBE53);
}
.status-limited {
    background: linear-gradient(135deg, var(--gold-premium), var(--gold-glow));
}
.status-closed {
    background: linear-gradient(135deg, #64748b, #475569);
}

.course-category-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(4px);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
html[dir="ltr"] .course-category-badge {
    left: auto;
    right: 12px;
}

.course-info-body {
    min-width: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.course-info-body h3 {
    font-family: var(--font-official, 'Cairo', sans-serif);
    font-size: 17px;
    color: var(--navy-corporate);
    margin-bottom: 12px;
    line-height: 1.5;
    font-weight: 700;
    transition: var(--transition-smooth);
    min-height: 52px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-info-body h3 a {
    text-decoration: none;
    color: inherit;
}
.course-card:hover .course-info-body h3 {
    color: var(--gold-premium);
}

.course-desc-text {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 14px;
    display: none;
}

.course-details-list {
    list-style: none;
    margin-bottom: 16px;
}
.course-details-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 6px;
}
.course-details-list li i {
    color: var(--gold-premium);
    font-size: 13px;
    width: 16px;
    text-align: center;
    margin-top: 3px;
}

.course-instructor {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 12px;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.instructor-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--navy-corporate);
    display: flex;
    align-items: center;
    gap: 6px;
}
.instructor-name i {
    color: var(--gold-premium);
    font-size: 12px;
}
.course-duration {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* أزرار الإجراءات أسفل البطاقة */
.card-bottom-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    width: 100%;
}
.card-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: none;
    font-family: var(--font-official, 'Cairo', sans-serif);
}
.card-action-btn i {
    font-size: 13px;
    transition: transform 0.3s ease;
}
.card-action-btn.btn-quick-view {
    background: linear-gradient(135deg, rgba(182, 141, 46, 0.12), rgba(212, 175, 55, 0.22));
    color: var(--gold-premium) !important;
    border: 1.5px solid var(--gold-premium);
}
.card-action-btn.btn-quick-view:hover {
    background: linear-gradient(135deg, var(--gold-premium), var(--gold-glow));
    color: var(--white) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(182, 141, 46, 0.3);
}
.card-action-btn.btn-full-details {
    background: linear-gradient(135deg, var(--navy-dark), var(--navy-corporate));
    color: var(--white) !important;
    border: 1.5px solid var(--navy-dark);
}
.card-action-btn.btn-full-details:hover {
    background: var(--navy-dark);
    border-color: var(--gold-premium);
    color: var(--gold-glow) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 15, 29, 0.3);
}

/* أزرار التفاعل الاجتماعي (Like & Share) */
.course-social-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.social-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    font-family: var(--font-official, 'Cairo', sans-serif);
}
.share-actions-group {
    display: flex;
    gap: 5px;
}
.share-actions-group .social-action-btn {
    padding: 7px 9px;
    font-size: 11.5px;
}
.like-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.like-btn:hover {
    background: #f1f5f9;
    color: var(--gold-premium);
    border-color: var(--gold-premium);
}
.like-btn.liked {
    background: #eff6ff;
    color: #2563eb;
    border-color: #3b82f6;
}
.like-btn.liked i {
    animation: thumbsUpBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.share-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.share-btn:hover {
    background: #f1f5f9;
    color: #0c182b;
    border-color: #cbd5e1;
}
@keyframes thumbsUpBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.35) rotate(-15deg); }
    100% { transform: scale(1); }
}
.share-btn.fb-share-btn {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.25);
    background: rgba(24, 119, 242, 0.04);
}
.share-btn.fb-share-btn:hover {
    background: #1877f2;
    color: #fff;
    border-color: #1877f2;
}
.share-btn.wa-share-btn {
    color: #25d366;
    border-color: rgba(37, 211, 102, 0.25);
    background: rgba(37, 211, 102, 0.04);
}
.share-btn.wa-share-btn:hover {
    background: #25d366;
    color: #fff;
    border-color: #25d366;
}
.share-btn.tg-share-btn {
    color: #0088cc;
    border-color: rgba(0, 136, 204, 0.25);
    background: rgba(0, 136, 204, 0.04);
}
.share-btn.tg-share-btn:hover {
    background: #0088cc;
    color: #fff;
    border-color: #0088cc;
}
.share-btn.link-share-btn {
    color: #b68d2e;
    border-color: rgba(182, 141, 46, 0.25);
    background: rgba(182, 141, 46, 0.04);
}
.share-btn.link-share-btn:hover {
    background: #b68d2e;
    color: #fff;
    border-color: #b68d2e;
}

/* تنسيق نمط القائمة (List View Mode) */
.catalog-courses-grid.list-view-mode {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
}
.catalog-courses-grid.list-view-mode .course-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    height: auto !important;
}
.catalog-courses-grid.list-view-mode .course-image-wrapper {
    width: 300px !important;
    height: 100% !important;
    min-height: 220px !important;
    flex-shrink: 0 !important;
}
.catalog-courses-grid.list-view-mode .course-desc-text {
    display: block;
}
.catalog-courses-grid.list-view-mode .course-info-body {
    flex: 1 !important;
}

/* حالة عدم وجود نتائج (Empty State) */
.no-results-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border: 2px dashed rgba(182, 141, 46, 0.25);
    border-radius: 14px;
    margin: 20px 0;
    display: none;
}
.no-results-box i {
    font-size: 48px;
    color: rgba(182, 141, 46, 0.35);
    margin-bottom: 15px;
}
.no-results-box h3 {
    font-size: 19px;
    color: var(--navy-corporate);
    margin-bottom: 8px;
    font-family: var(--font-official, 'Cairo', sans-serif);
}
.no-results-box p {
    font-size: 14px;
    color: #64748b;
}

/* رسالة التوست عند نسخ الرابط */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--navy-corporate);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border: 1.5px solid var(--gold-premium);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}
.copy-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* نافذة المعاينة السريعة (Quick View Modal) */
.news-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    background-color: rgba(10, 15, 29, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.news-lightbox.active {
    display: flex !important;
}
.news-lightbox-content {
    animation: modalZoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalZoomIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ----------------------------------------------------
   8. قواعد التجاوب والشاشات للهواتف (Responsive Mobile Layout)
   ---------------------------------------------------- */
@media (max-width: 950px) {
    .catalog-main-layout,
    html[dir="ltr"] .catalog-main-layout {
        padding: 24px 16px 44px;
        display: flex;
        flex-direction: column;
        gap: 18px;
        direction: rtl;
        width: 100%;
        max-width: 100%;
    }
    html[dir="ltr"] .catalog-main-layout {
        direction: ltr;
    }

    /* إظهار زر تصفية البرامج الأنيق */
    .filter-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 18px;
        border-radius: 12px;
        border: 1.5px solid rgba(182, 141, 46, 0.3);
        background: var(--white);
        color: var(--navy-corporate);
        font-family: var(--font-official, 'Cairo', sans-serif);
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(11, 18, 31, 0.05);
        order: 1;
    }
    .filter-mobile-toggle span {
        display: inline-flex;
        align-items: center;
        gap: 9px;
    }
    .filter-mobile-toggle i {
        color: var(--gold-premium);
    }
    .filter-toggle-chevron {
        transition: transform 0.25s ease;
    }
    .filter-mobile-toggle[aria-expanded="true"] .filter-toggle-chevron {
        transform: rotate(180deg);
    }

    /* إخفاء القائمة الجانبية افتراضياً حتى يضغط المستخدم على زر التصفية */
    .filter-sidebar {
        display: none;
        position: static;
        top: 0;
        width: 100%;
        order: 2;
        border-radius: 14px;
        padding: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
    }
    .filter-sidebar.mobile-expanded {
        display: block;
        animation: cardFadeIn 0.3s ease;
    }
    .filter-section {
        margin-bottom: 18px;
        padding-bottom: 18px;
        border-bottom: 1px solid #EDF0F4;
    }
    .filter-section:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    /* منطقة محتوى الدورات بعرض كامل أسفل زر التصفية */
    .catalog-content-area {
        order: 3;
        width: 100%;
    }

    .catalog-topbar-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        gap: 12px;
    }
    .search-box-wrapper {
        width: 100%;
        min-width: 0;
    }
        .search-input-field {
        padding: 12px 44px 12px 16px !important;
        font-size: 16px !important;
        min-height: 48px !important;
        border-radius: 10px !important;
    }
    .filter-checkbox-label {
        padding: 10px 10px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        font-size: 14.5px !important;
    }
    .filter-checkbox-label input {
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        min-height: 20px !important;
        flex-shrink: 0 !important;
    }
    .card-action-btn {
        min-height: 44px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
    .search-box-wrapper i {
        right: 14px;
    }
    .view-switcher-box {
        width: 100%;
        justify-content: space-between;
    }
    .courses-count-text {
        font-size: 13.5px;
    }

    /* عرض فردي للبطاقات على الشاشات الصغيرة لتجنب الضغط العرضي */
    .catalog-courses-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .catalog-courses-grid.list-view-mode .course-card {
        flex-direction: column !important;
    }
    .catalog-courses-grid.list-view-mode .course-image-wrapper {
        width: 100% !important;
        height: 190px !important;
        min-height: 190px !important;
    }
    .catalog-courses-grid.list-view-mode .course-cta-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .catalog-hero-banner {
        padding: 40px 16px 35px;
    }
    .catalog-hero-banner h1 {
        font-size: 22px;
        line-height: 1.4;
    }
    .catalog-hero-banner p {
        font-size: 13.5px;
        line-height: 1.6;
        margin-bottom: 15px;
    }
    .executive-trust-bar {
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px;
        width: 100%;
        border-radius: 12px;
    }
    .trust-divider {
        display: none;
    }
    .course-info-body {
        padding: 16px 14px;
    }
    .course-info-body h3 {
        font-size: 15.5px;
        min-height: 0;
    }
    .card-bottom-actions {
        flex-direction: column;
        gap: 8px;
    }
    .card-action-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
    }
}

/* ----------------------------------------------------
   9. دعم الوضع الليلي (Comprehensive Dark Theme)
   ---------------------------------------------------- */
[data-theme="dark"] .catalog-hero-banner {
    background: linear-gradient(135deg, #050a14 0%, #0a1324 50%, #122038 100%);
}
[data-theme="dark"] .filter-sidebar {
    background: rgba(13, 25, 46, 0.98);
    border-color: rgba(200, 157, 56, 0.22);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .filter-mobile-toggle {
    background: #0d192e;
    color: #e2e8f0;
    border-color: rgba(200, 157, 56, 0.3);
}
[data-theme="dark"] .filter-title {
    color: #e2e8f0;
    border-color: rgba(200, 157, 56, 0.2);
}
[data-theme="dark"] .filter-section {
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .filter-checkbox-label {
    color: #cbd5e1;
}
[data-theme="dark"] .filter-checkbox-label:hover {
    color: var(--gold-glow);
    background: rgba(200, 157, 56, 0.12);
}
[data-theme="dark"] .catalog-topbar-controls {
    background: rgba(13, 25, 46, 0.98);
    border-color: rgba(200, 157, 56, 0.22);
}
[data-theme="dark"] .search-input-field {
    background: #070d18;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .view-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}
[data-theme="dark"] .view-btn.active {
    background: var(--gold-premium);
    color: #0c182b;
}
[data-theme="dark"] .course-card {
    background: #0d192e;
    border-color: rgba(200, 157, 56, 0.22);
}
[data-theme="dark"] .course-info-body h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .course-details-list li {
    color: #cbd5e1;
}
[data-theme="dark"] .instructor-name {
    color: #e2e8f0;
}
[data-theme="dark"] .like-btn,
[data-theme="dark"] .share-btn {
    background: #122038;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .no-results-box {
    background: #0d192e;
    border-color: rgba(200, 157, 56, 0.25);
}
[data-theme="dark"] .no-results-box h3 {
    color: #e2e8f0;
}