/* --- Departments & Branch View --- */

/* Views container */
#departments-view {
    position: relative;
    min-height: 400px;
    padding-bottom: 3rem;
}

/* 1. Grid View (Main Depts) */
.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dept-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.dept-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.dept-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.dept-count {
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

/* 2. Branches Grid View (Level 2) */
.branches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.branch-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.branch-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.branch-icon {
    width: 48px;
    height: 48px;
    background: var(--off-white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* RTL Support for Branch Icon margin */
html[lang="ar"] .branch-icon {
    margin-left: 1rem;
}

html[lang="en"] .branch-icon {
    margin-right: 1rem;
}

.branch-card h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

/* 3. Course Table View (Level 3) */
.dept-detail-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-back {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.1);
    /* Transparent Orange */
    color: var(--accent-color);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-back:hover {
    background: var(--accent-color);
    color: #fff !important;
    border-color: var(--accent-color);
}

/* Layout */
.course-layout-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

@media (max-width: 991px) {
    .course-layout-container {
        flex-direction: column;
    }

    .course-filters-sidebar {
        width: 100% !important;
        flex: none !important;
    }
}

/* Sidebar */
.course-filters-sidebar {
    flex: 0 0 280px;
    width: 100%;
    min-width: 280px;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.filter-group {
    margin-bottom: 1rem;
}

.search-box-wrapper {
    position: relative;
}

.search-box-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box-wrapper input:focus {
    border-color: var(--accent-color);
}

.search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

html[lang="ar"] .search-box-wrapper input {
    padding-left: 1rem;
    padding-right: 2.5rem;
}

html[lang="en"] .search-box-wrapper input {
    padding-right: 1rem;
    padding-left: 2.5rem;
}

html[lang="ar"] .search-icon {
    right: 1rem;
}

html[lang="en"] .search-icon {
    left: 1rem;
}

.filter-item {
    background: #eee;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    transition: background 0.2s;
}

.filter-item:hover {
    background: #e2e2e2;
}

/* Table Rows */
.course-table-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.course-row-card {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.5fr;
    /* Title, Date, Loc, Price */
    gap: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s;
}

.course-row-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.col-title {
    font-weight: 600;
    color: var(--text-dark);
}

.col-meta {
    color: #64748b;
    font-size: 0.9rem;
}

.col-price {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

html[lang="ar"] .col-price {
    text-align: left;
}

html[lang="en"] .col-price {
    text-align: right;
}

@media (max-width: 768px) {
    .course-row-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .col-price {
        align-self: flex-start;
        color: var(--accent-color);
    }
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    color: #777;
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}


/* --- New Details Page Redesign --- */

/* Layout Grid */
.details-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    /* Main content | Sidebar */
    gap: 40px;
    margin-top: 3rem;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .registration-benefits {
        grid-template-columns: 1fr;
    }
}

/* Dynamic Colors and Animations for Branch Icons */
.branch-card .branch-icon i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.branch-card:hover .branch-icon i {
    transform: rotate(15deg) scale(1.15);
}

.branch-card:nth-child(16n+1) .branch-icon { color: #4f46e5 !important; }
.branch-card:nth-child(16n+1):hover .branch-icon { background: #4f46e5 !important; color: #fff !important; }

.branch-card:nth-child(16n+2) .branch-icon { color: #059669 !important; }
.branch-card:nth-child(16n+2):hover .branch-icon { background: #059669 !important; color: #fff !important; }

.branch-card:nth-child(16n+3) .branch-icon { color: #ea580c !important; }
.branch-card:nth-child(16n+3):hover .branch-icon { background: #ea580c !important; color: #fff !important; }

.branch-card:nth-child(16n+4) .branch-icon { color: #db2777 !important; }
.branch-card:nth-child(16n+4):hover .branch-icon { background: #db2777 !important; color: #fff !important; }

.branch-card:nth-child(16n+5) .branch-icon { color: #0284c7 !important; }
.branch-card:nth-child(16n+5):hover .branch-icon { background: #0284c7 !important; color: #fff !important; }

.branch-card:nth-child(16n+6) .branch-icon { color: #7c3aed !important; }
.branch-card:nth-child(16n+6):hover .branch-icon { background: #7c3aed !important; color: #fff !important; }

.branch-card:nth-child(16n+7) .branch-icon { color: #b45309 !important; }
.branch-card:nth-child(16n+7):hover .branch-icon { background: #b45309 !important; color: #fff !important; }

.branch-card:nth-child(16n+8) .branch-icon { color: #1d4ed8 !important; }
.branch-card:nth-child(16n+8):hover .branch-icon { background: #1d4ed8 !important; color: #fff !important; }

.branch-card:nth-child(16n+9) .branch-icon { color: #be123c !important; }
.branch-card:nth-child(16n+9):hover .branch-icon { background: #be123c !important; color: #fff !important; }

.branch-card:nth-child(16n+10) .branch-icon { color: #0f766e !important; }
.branch-card:nth-child(16n+10):hover .branch-icon { background: #0f766e !important; color: #fff !important; }

.branch-card:nth-child(16n+11) .branch-icon { color: #9333ea !important; }
.branch-card:nth-child(16n+11):hover .branch-icon { background: #9333ea !important; color: #fff !important; }

.branch-card:nth-child(16n+12) .branch-icon { color: #4338ca !important; }
.branch-card:nth-child(16n+12):hover .branch-icon { background: #4338ca !important; color: #fff !important; }

.branch-card:nth-child(16n+13) .branch-icon { color: #c2410c !important; }
.branch-card:nth-child(16n+13):hover .branch-icon { background: #c2410c !important; color: #fff !important; }

.branch-card:nth-child(16n+14) .branch-icon { color: #1e40af !important; }
.branch-card:nth-child(16n+14):hover .branch-icon { background: #1e40af !important; color: #fff !important; }

.branch-card:nth-child(16n+15) .branch-icon { color: #86198f !important; }
.branch-card:nth-child(16n+15):hover .branch-icon { background: #86198f !important; color: #fff !important; }

.branch-card:nth-child(16n+16) .branch-icon { color: #0369a1 !important; }
.branch-card:nth-child(16n+16):hover .branch-icon { background: #0369a1 !important; color: #fff !important; }

@media (max-width: 991px) {
    .details-layout-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .details-sidebar {
        order: -1;
        /* Sidebar details (like quick actions) might want to be lower, or sticky top? 
                      User said: "Main Column (Left - appears first on mobile)".
                      So defaults are fine, Main is first in DOM. Sidebar second.
                      But User said: "Sidebar... moves below content on small screens".
                      So standard block order is correct. */
    }
}

/* Info Bar (Sticky) */
.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    align-items: center;

    /* Sticky Behavior */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    /* High z-index to stay above scrolling content */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    /* Shadow when sticky */
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.info-item i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Tabs Navigation (Sticky below Info Bar) */
.details-tabs-nav {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding-bottom: 0;

    /* Sticky Behavior */
    position: -webkit-sticky;
    position: sticky;
    top: 80px;
    /* Sit below the sticky Info Bar */
    z-index: 90;
    /* Below Info Bar (100) but above content */
    background: #fff;
    /* Opaque background so content slides under invisible */
    padding-top: 10px;
    /* Spacing */
    border-top: 1px solid #f8f9fa;
    /* Visual separation */
}

.tab-link {
    padding: 10px 15px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    top: 2px;
}

.tab-link:hover {
    color: var(--primary-color);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content Area */
.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Overview & Target Audience Special Behavior */
.tab-pane p {
    line-height: 1.8;
    color: #4b5563;
    font-size: 1.05rem;
}

/* Objectives List */
.objectives-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.objectives-list li {
    position: relative;
    padding-right: 25px;
    /* RTL default */
    padding-left: 0;
}

html[lang="en"] .objectives-list li {
    padding-left: 25px;
    padding-right: 0;
}

.objectives-list li::before {
    content: '\f00c';
    /* FontAwesome Check */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    color: var(--accent-color);
}

html[lang="en"] .objectives-list li::before {
    left: 0;
    right: auto;
}

/* Course Outline (Days) */
.outline-days-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.day-btn {
    padding: 8px 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.day-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.day-content-pane {
    display: none;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.day-content-pane.active {
    display: block;
    animation: checkIn 0.3s ease;
}

@keyframes checkIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.day-topics-list {
    list-style: none;
    padding: 0;
}

.day-topics-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.day-topics-list li:last-child {
    border-bottom: none;
}

.day-topics-list li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

/* Sidebar Styling */
.details-sidebar {
    /* Sticky behavior handled by parent or self */
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
    /* Adjust based on header height */
    /* Adjust based on header height (approx 100-120px) */
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 90;
}

/* Sidebar Card Styling (Fees & Actions) */
.action-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    /* More rounded as per image */
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.fees-card-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.fees-price-display {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-dark);
    margin: 15px 0;
    line-height: 1;
}

.fees-subtitle {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 25px;
    display: block;
}

.btn-register-orange {
    background: #e67e00;
    /* Orange from image */
    color: #fff;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 15px;
    width: 100%;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(230, 126, 0, 0.3);
    margin-bottom: 15px;
    display: block;
    text-decoration: none;
}

.btn-register-orange:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(230, 126, 0, 0.4);
}

.fees-note {
    font-size: 0.85rem;
    color: #888;
}

.price-tag {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    display: block;
}

.price-label {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
    display: block;
}

.sidebar-actions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-actions-list li {
    margin-bottom: 15px;
}

.sidebar-actions-list a,
.sidebar-actions-list button {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.sidebar-actions-list a:hover,
.sidebar-actions-list button:hover {
    color: var(--primary-color);
}


/* --- Layout Container (Overlap Video) --- */
/* --- Layout Container (Global Overlap) --- */
/* --- Layout Container (No Overlap) --- */
.details-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
    z-index: 20;
    margin-top: 0;
    /* Reset overlap */
}

/* Reset overlap on mobile */
@media (max-width: 991px) {
    .details-layout {
        flex-direction: column;
        margin-top: 0;
    }
}

/* Sidebar Sticky Behavior */
/* Sidebar Sticky & Overlap Behavior */
/* flex: 0 0 320px; handled inline or elsewhere */
/* position: sticky removed to allow inner sticky to work properly in full height track */
.details-sidebar {
    align-self: flex-start;
    height: auto;
    /* Allow full height for inner sticky tracking */
    margin-top: 0;
    /* Align with content */
    z-index: 20;
}

/* Ensure sticky works */
.details-layout {
    overflow: visible !important;
    /* Critical for sticky */
}

/* ... existing mobile sidebar rules ... */

/* --- Video Banner Styles (Redesign) --- */
/* ... existing video rules ... */


/* Align right (RTL) or Left (LTR) based on container */
.video-banner-content {
    max-width: 1320px;
    /* Standard Container Width */
    width: 95%;
    margin: 0 auto;
    right: 0;
    left: 0;
    /* Center horizontally relative to viewport, but content constrained */

    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertically Center */
    align-items: center !important;
    /* Force Center Alignment */

    text-align: center;
    /* Center Text */

    color: #fff;
    padding: 0 2rem;
    /* Container padding */
    z-index: 2;
}

html[lang="en"] .video-banner-content {
    align-items: center !important;
    text-align: center;
}

.video-banner-content .program-title,
.video-banner-content .program-meta,
.video-banner-content .program-type {
    max-width: 65%;
    /* Limit width to avoiding hitting the sidebar */
    /* In RTL, items align to right (start). Ensure they don't stretch */
}

.video-banner-content .program-type {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
}

.video-banner-content .program-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    max-width: 900px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-banner-content .program-meta {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.video-banner-content .program-meta span {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    /* Glass effect */
    backdrop-filter: blur(5px);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    font-size: 1rem;
    color: #fff;
}

.video-banner-content .program-meta i {
    color: var(--accent-color);
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .video-banner-container {
        height: 300px;
    }

    .video-banner-content .program-title {
        font-size: 1.8rem;
    }

    .video-banner-content .program-meta {
        gap: 15px;
        font-size: 0.95rem;
    }
}

/* --- FORCE FULL WIDTH VIDEO BANNER (Event Details Model) --- */
.video-banner-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    right: auto !important;
    border-radius: 0 !important;
    height: 280px;
    /* Approx 6-7cm equivalent */
    position: relative;
    overflow: hidden;
    display: block;
}

.video-banner-container video,
.video-banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .video-banner-container {
        height: 200px;
    }
}