/* --- CSS Custom Properties for VOD Design --- */
:root {
    --primary-blue: #3689d1;
    --title-blue: #2b7a8b;
    --text-dark: #333333;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --background-light: #ffffff;
    --gradient-start: #fdbb6d;
    --gradient-end: #3689d1;
}

/* --- Media Section Wrapper --- */
#mediaSection {
    padding: 1rem;
    background-color: #e0e0e0;
    margin-top: 20px;
    margin-bottom: 20px;
    transition: background-color .4s;
    width: 100%;
    box-sizing: border-box;
}

/* Enhanced flex support for better width control */
.media-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--media-container-gap, 20px);
    align-items: flex-start;
}

.vod-player-section {
    display: flex;
    flex-wrap: wrap;
    gap: var(--media-container-gap, 20px);
    align-items: flex-start;
    width: 100%;
}

/* Better responsive behavior for custom widths */
@media (max-width: 768px) {
    /* Override widget container padding to prevent double padding */
    .elementor-widget-zype-player {
        padding: 0 20px !important; /* Single source of truth for mobile padding */
    }
    
    /* Override Elementor full-width padding on mobile */
    .elementor-widget-zype-player.elementor-widget-full_width .media-container,
    .elementor-widget-zype-player.e-con-full .media-container,
    .elementor-section-stretched .elementor-widget-zype-player .media-container {
        padding: 0 !important; /* Remove the extra 1.5rem padding */
    }
    
    .elementor-widget-zype-player.elementor-widget-full_width #mediaSection,
    .elementor-widget-zype-player.e-con-full #mediaSection,
    .elementor-section-stretched .elementor-widget-zype-player #mediaSection {
        padding: 0 !important; /* Remove the 1.5rem vertical padding */
    }
    
    .media-container,
    .vod-player-section {
        flex-direction: column;
        gap: 16px !important; /* Consistent gap for mobile */
        padding: 0 !important; /* Remove padding since widget container handles it */
        margin: 0 auto;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .media-container .media-player,
    .media-container .playlist-card,
    .vod-player-section .media-player.vod-player,
    .vod-player-section .vod-info-section {
        width: 100% !important;
        flex: 1 1 100% !important;
        margin: 0 !important; /* Remove any margins */
    }
}

/* --- Season Selector --- */
.season-selector-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.season-selector-container:hover {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    /* Removed transform to fix native dropdown positioning */
}

.season-selector-label {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9rem;
}

.season-selector-label i {
    color: #237aad;
    font-size: 1rem;
}

.season-selector {
    padding: 0.5rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Temporarily restored native appearance to fix dropdown positioning */
    /* appearance: none; */
    /* Removed custom arrows to use native dropdown arrow */
    /* background-image: linear-gradient(45deg, transparent 50%, #666 50%),
                      linear-gradient(135deg, #666 50%, transparent 50%);
    background-position: calc(100% - 15px) calc(1em + 2px),
                         calc(100% - 10px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat; */
    padding-right: 0.75rem; /* Reduced from 30px since no custom arrow */
    
    /* Fix native dropdown positioning - prevent transform interference */
    transform: none !important;
    will-change: auto;
    position: relative;
}

.season-selector:hover {
    border-color: #237aad;
    box-shadow: 0 0 0 3px rgba(35, 122, 173, 0.1), 0 2px 6px rgba(0, 0, 0, 0.1);
    /* Removed transform to fix native dropdown positioning */
}

.season-selector:focus {
    outline: none;
    border-color: #237aad;
    box-shadow: 0 0 0 3px rgba(35, 122, 173, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
    /* Removed transform to fix native dropdown positioning */
}

/* --- Custom Default Mode Season Dropdown --- */
.default-season-dropdown {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.default-season-dropdown-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.default-season-dropdown-btn:hover {
    border-color: #237aad;
    box-shadow: 0 0 0 3px rgba(35, 122, 173, 0.1), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.default-season-dropdown-btn:focus {
    outline: none;
    border-color: #237aad;
    box-shadow: 0 0 0 3px rgba(35, 122, 173, 0.2), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.default-dropdown-arrow {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.2s;
}

.default-season-dropdown.open .default-dropdown-arrow {
    transform: rotate(180deg);
}

.default-season-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100%;
    min-width: 200px;
    max-width: 300px;
    z-index: 50; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    padding: 0;
    animation: dropdownFadeIn 0.2s ease-out;
}

.default-season-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.default-season-dropdown-item:last-child {
    border-bottom: none;
}

.default-season-dropdown-item:hover {
    background-color: #f8f9fa;
    color: #237aad;
}

.default-season-dropdown-item.active {
    background-color: #e3f2fd;
    color: #237aad;
    font-weight: 600;
}

.default-season-dropdown-item.active i {
    color: #237aad;
    font-size: 0.8rem;
}

.default-season-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.default-season-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Hidden select element for compatibility */
.season-selector-hidden {
    display: none !important;
}

/* Legacy season selector styles (kept for compatibility) */
.season-selector option {
    padding: 0.5rem;
    background-color: white;
    color: #333;
}

/* --- VOD Season Selector --- */
.vod-season-selector-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1rem;
}

/* Note: .vod-season-selector styles are handled above in the filter dropdown section */

/* Default mode season selector positioning - Fixed at top of playlist card */
.playlist-card .default-season-selector-container {
    position: relative; /* Changed from sticky to relative */
    top: 0;
    z-index: 10;
    margin: 0 0 0 0; /* Removed bottom margin */
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    background-color: #f0f0f0;
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent this from shrinking when flex container */
}

.playlist-card .default-season-selector-container:hover {
    background-color: rgba(248, 249, 250, 0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- VOD Controls --- */
.vod-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: rgba(35, 122, 173, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.vod-control-btn {
    padding: 0.4rem 0.8rem;
    border: 2px solid #237aad;
    border-radius: 6px;
    background-color: white;
    color: #237aad;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vod-control-btn:hover {
    background-color: #237aad;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(35, 122, 173, 0.3);
}

.vod-control-btn:active {
    transform: translateY(0);
}

.vod-control-btn i {
    font-size: 0.9rem;
}

/* --- VOD Layout --- */
.vod-layout {
    margin: 2rem auto;
    max-width: 1120px; /* Set to desired desktop width */
    width: 100%; /* Ensure it takes full available width */
    padding: 0 20px; /* 20px side padding to match example file */
}

/* Ensure VOD layout uses full container width on desktop */
@media (min-width: 1025px) {
    .elementor-widget-zype-player .vod-layout {
        max-width: 1120px;
        width: 100%;
    }
    
    .elementor-widget-zype-player .vod-player-section {
        max-width: 1120px;
        width: 100%;
    }
    
    .elementor-widget-zype-player .vod-playlist-grid {
        max-width: 1120px;
        width: 100%;
    }
}

/* Duplicate rules removed - using the more specific ones in Series Header section below */

/* Specific targeting for series-info section */
.vod-info-section.series-info {
    min-width: 300px !important; /* Prevent it from becoming too narrow */
    max-width: 65% !important; /* Prevent it from becoming too wide on desktop */
    flex: 1 !important; /* Allow it to grow but respect constraints */
}

/* Override any Elementor flex overrides for better desktop/tablet display */
@media (min-width: 769px) {
    .vod-info-section.series-info {
        min-width: 400px !important; /* More space on desktop */
        max-width: 60% !important; /* Better balance on larger screens */
    }
}

/* Responsive Breakpoints - Matching example-vod-layout.html */
@media (max-width: 992px) {
    .vod-player-section {
        flex-direction: column !important;
        text-align: center; /* Match example file */
        gap: 1.5rem !important;
        padding: 0 !important; /* Remove padding for full width */
        width: 100% !important; /* Force full width */
        max-width: none !important; /* Remove max-width constraint */
    }
    
    .vod-player-section .media-player.vod-player,
    .vod-player-section .vod-info-section {
        width: 100% !important; /* Override any widget settings on mobile */
        min-width: unset !important; /* Remove desktop min-width constraints */
        max-width: none !important;
        flex: none !important; /* Remove flex sizing for mobile */
    }
    
    /* Ensure proper aspect ratio on tablets */
    .vod-player-section .media-player.vod-player .zype_player_container,
    .vod-player-section .media-player.vod-player #zype-player-container,
    .vod-player-section .media-player.vod-player .video-placeholder {
        width: 100% !important;
        aspect-ratio: 16/9; /* Maintain aspect ratio on tablets */
        height: auto !important;
    }
}

@media (max-width: 576px) {
    .vod-layout {
        margin: 0 !important; /* Remove all margin on mobile */
        padding: 0 !important; /* Remove all padding on mobile */
        width: 100% !important; /* Force full width */
        max-width: none !important; /* Remove max-width constraint */
    }
    
    .vod-player-section {
        gap: 1rem !important;
        text-align: left !important; /* Left align content on mobile as shown in image */
        padding-left: 0 !important; /* Remove side padding for full width */
        padding-right: 0 !important; /* Remove side padding for full width */
        margin-bottom: 1.5rem !important; /* Reduce bottom margin for mobile */
        flex-direction: column !important; /* Ensure stacking */
        max-width: none !important; /* Remove max-width constraint on mobile */
        width: 100% !important; /* Force full width */
        box-sizing: border-box !important; /* Include padding in width */
    }
    
    /* Target the player more specifically */
    .vod-player-section .media-player.vod-player.video-player-wrapper {
        width: 100% !important; /* Use full width within container */
        min-width: unset !important;
        max-width: none !important;
        margin: 0 0 1rem 0 !important; /* Remove side margins, keep bottom spacing */
        flex: none !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure all player containers maintain aspect ratio */
    .vod-player-section .media-player.vod-player .zype_player_container,
    .vod-player-section .media-player.vod-player #zype-player-container,
    .vod-player-section .media-player.vod-player .video-placeholder {
        width: 100% !important;
        aspect-ratio: 16/9 !important; /* Force aspect ratio on mobile */
        height: auto !important;
        min-height: unset !important;
        max-height: 100% !important; /* Prevent exceeding container on mobile */
        box-sizing: border-box !important; /* Include borders/padding in dimensions */
        overflow: hidden !important; /* Prevent content from spilling out */
    }
    
    /* Target the info section more specifically */
    .vod-player-section .vod-info-section.series-info {
        /* Don't override padding - let Elementor controls handle it */
        text-align: left !important; /* Left align text as shown in image */
        width: 100% !important; /* Use full width within container */
        min-width: unset !important;
        max-width: none !important;
        margin: 0 !important; /* Remove extra margins */
        flex: none !important;
        box-sizing: border-box !important; /* Ensure padding is included in width */
    }
    
    /* Ensure episodes grid is single column on mobile only (not tablets) */
    .episodes-grid {
        grid-template-columns: 1fr !important; /* Force single column regardless of data attributes */
        gap: 1rem !important; /* Reduce gap for mobile */
    }
    
    /* Ensure full width but respect padding controls */
    .elementor-widget-zype-player .vod-player-section {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure child elements respect container and don't overflow */
    .elementor-widget-zype-player .vod-player-section .media-player.vod-player.video-player-wrapper,
    .elementor-widget-zype-player .vod-player-section .vod-info-section.series-info {
        /* Use full width within container - let container padding handle spacing */
        width: 100% !important;
        margin: 0 !important; /* Remove any extra margins */
        min-width: 0 !important;
        max-width: none !important;
        box-sizing: border-box !important;
        /* Let padding controls work naturally */
    }
}

/* --- Series Header: Video and Description --- */
.vod-player-section {
    display: flex !important;
    gap: var(--vod-gap, 36px);
    margin-bottom: 2.5rem;
    align-items: flex-start;
    justify-content: flex-start;
    background: none;
    padding: 0 20px; /* 20px side padding as specified */
    border-radius: 0;
    backdrop-filter: none;
    width: 100% !important;
    max-width: 1120px; /* Total container width as specified */
    flex-wrap: nowrap !important;
    box-sizing: border-box; /* Include padding in width calculations */
}

/* Handle cases where min-widths conflict with percentage settings */
@media (max-width: 768px) {
    .vod-player {
        min-width: 280px !important; /* Smaller min-width on smaller screens */
    }
    .vod-info-section {
        min-width: 200px !important; /* Smaller min-width on smaller screens */
    }
}

.vod-player {
    flex: 0 0 var(--vod-player-width, 684px); /* Fixed width based on your specifications */
    width: var(--vod-player-width, 684px); /* 684px as specified */
    min-width: 320px; /* Minimum for very small screens */
    max-width: none;
}

.vod-player .zype_player_container,
.vod-player #zype-player-container {
    width: 100% !important;
    height: auto; /* Auto height with aspect ratio */
    aspect-ratio: 16/9;
    background: linear-gradient(145deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Ensure video-placeholder class also gets height styling */
.vod-player .video-placeholder {
    width: 100% !important;
    height: auto; /* Auto height with aspect ratio */
    aspect-ratio: 16/9;
    max-height: 100%; /* Prevent placeholder from exceeding player container */
    background: linear-gradient(145deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box; /* Ensure padding/borders are included in dimensions */
}

/* Default layout player containers - consistent height styling */
.media-player .zype_player_container,
.media-player #zype-player-container {
    width: 100% !important;
    height: auto; /* Auto height with aspect ratio */
    aspect-ratio: 16/9;
    background: linear-gradient(145deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.media-player .video-placeholder {
    width: 100% !important;
    height: auto; /* Auto height with aspect ratio */
    aspect-ratio: 16/9;
    max-height: 100%; /* Prevent placeholder from exceeding player container */
    background: linear-gradient(145deg, var(--gradient-start), var(--gradient-end));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box; /* Ensure padding/borders are included in dimensions */
}

.vod-info-section {
    flex: 1; /* Fill remaining space after player takes 684px and 36px gap */
    width: var(--vod-desc-width, 400px); /* 400px as specified, but flexible */
    min-width: 200px; /* Minimum for very small screens */
    max-width: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: none; /* Remove any background that might add visual padding */
    box-shadow: none; /* Remove shadow that might make it appear smaller */
}

.vod-info-section .vod-series-title {
    font-size: 2.75rem;
    color: var(--title-blue);
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    line-height: 1.2;
    font-family: 'Inter', sans-serif;
}

.vod-episode-subtitle {
    margin-bottom: 1.25rem;
}

.vod-episode-subtitle span {
    font-size: 1.6rem;
    margin: 0 0 1.25rem 0;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.vod-description {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 1rem;
}

.vod-description p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* --- Episodes Section --- */
.vod-playlist-grid {
    width: 100%;
    max-width: 1120px; /* Match container width */
    margin: 0 auto;
    position: relative;
}

/* Legacy grid header styles - kept for compatibility */
.vod-grid-header {
    position: relative;
    padding: 2rem 0 1.5rem 0;
    margin-bottom: 0;
    background: none;
    border-radius: 0;
    border: none;
}

.vod-grid-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
}

.vod-grid-header h3::before {
    display: none;
}



/* --- Season Selector (Filter Dropdown) --- */
.filter-dropdown {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.season-dropdown-btn {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 600;
    position: relative;
    z-index: 1;
    width: auto;
    min-width: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.season-dropdown-btn:hover {
    background-color: #2a76bb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.season-dropdown-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.season-dropdown-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(54, 137, 209, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.arrow-down {
    border: solid white;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.filter-dropdown.open .arrow-down {
    transform: rotate(225deg);
}

/* Custom dropdown menu */
.season-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100%;
    min-width: 200px;
    max-width: 300px;
    z-index: 50; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px !important;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    padding: 0;
    backdrop-filter: blur(10px);
    animation: dropdownFadeIn 0.2s ease-out;
    /* Ensure no transforms interfere with positioning */
    transform: none !important;
    bottom: auto !important;
}

/* Ensure dropdown always appears below button on mobile */
@media (max-width: 768px) {
    .filter-dropdown {
        position: relative;
        z-index: 1;
    }
    
    .filter-dropdown .season-dropdown-menu {
        position: absolute !important;
        top: calc(100% + 4px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        margin-top: 0 !important;
        z-index: 50 !important; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
        transform: none !important;
        /* Ensure dropdown is always below the button */
        bottom: auto !important;
    }
}

/* Ensure dropdown menu background is customizable */
.season-dropdown-menu.visible {
    display: block;
}

.season-dropdown-menu.hidden {
    display: none;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        /* Removed translateY transforms that were causing positioning issues */
    }
    to {
        opacity: 1;
        /* Removed translateY transforms that were causing positioning issues */
    }
}

.season-dropdown-item {
    background-color: white;
    color: #333;
    padding: 0.75rem 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    font-weight: 400;
}

.season-dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.season-dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.season-dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
    padding-left: 1.125rem;
}

.season-dropdown-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-blue);
    border-radius: 0 2px 2px 0;
}

.season-dropdown-item.active {
    background-color: var(--primary-blue);
    color: white;
    font-weight: 600;
    position: relative;
}

.season-dropdown-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: white;
    border-radius: 0 2px 2px 0;
}

.season-dropdown-item.active:hover {
    background-color: #2a76bb;
    transform: none;
    padding-left: 1rem;
}

.season-dropdown-item.active:hover::before {
    background-color: white;
    width: 4px;
}

/* --- Episodes Grid --- */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
}

/* Dynamic grid columns based on data attribute - with responsive limits */
.vod-playlist-grid[data-columns="2"] .episodes-grid {
    grid-template-columns: repeat(2, 1fr);
}

.vod-playlist-grid[data-columns="3"] .episodes-grid {
    grid-template-columns: repeat(3, 1fr);
}

.vod-playlist-grid[data-columns="4"] .episodes-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Limit 5 and 6 columns to prevent overflow on standard screens */
.vod-playlist-grid[data-columns="5"] .episodes-grid {
    grid-template-columns: repeat(4, 1fr); /* Force max 4 columns */
}

.vod-playlist-grid[data-columns="6"] .episodes-grid {
    grid-template-columns: repeat(4, 1fr); /* Force max 4 columns */
}

/* Only allow 5+ columns on very wide screens */
@media (min-width: 1400px) {
    .vod-playlist-grid[data-columns="5"] .episodes-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.5rem; /* Reduce gap for more columns */
    }
    
    .vod-playlist-grid[data-columns="6"] .episodes-grid {
        grid-template-columns: repeat(5, 1fr); /* Max 5 even on wide screens */
        gap: 1.25rem;
    }
}

/* --- Episode Cards --- */
.episode-card {
    cursor: pointer;
    transition: transform 0.2s;
}

.episode-card:hover {
    transform: translateY(-5px);
}

.thumbnail-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
    width: 100%;
}

.thumbnail-wrapper img {
    width: 100%;
    display: block;
    border-radius: 8px;
}

/* Play Icon - Base Styles */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 5;
    overflow: hidden;
}

.vod-grid-item:hover .play-icon,
.episode-card:hover .play-icon {
    background-color: rgba(255, 255, 255, 1);
}

/* CSS Triangle Icon (Default) */
.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid var(--text-dark);
    margin-left: 4px;
    transition: transform 0.3s ease;
}

/* Hide default triangle for other icon types */
.play-icon.icon-svg::after,
.play-icon.icon-font::after,
.play-icon.icon-image::after,
.play-icon.icon-text::after {
    display: none;
}

/* SVG Icon Styles */
.play-icon.icon-svg {
    padding: 12px;
}

.play-icon.icon-svg svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: transform 0.3s ease;
}

/* Font Icon Styles */
.play-icon.icon-font {
    font-size: 20px;
    line-height: 1;
}

.play-icon.icon-font i {
    transition: transform 0.3s ease;
}

/* Custom Image Icon Styles */
.play-icon.icon-image {
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    padding: 8px;
}

/* Text Icon Styles */
.play-icon.icon-text {
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover Animations */
.play-icon.animation-scale:hover svg,
.play-icon.animation-scale:hover i,
.play-icon.animation-scale:hover::after {
    transform: scale(1.2);
}

.play-icon.animation-rotate:hover svg,
.play-icon.animation-rotate:hover i {
    transform: rotate(15deg);
}

.play-icon.animation-pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.play-icon.animation-bounce:hover {
    animation: bounce-animation 0.6s ease;
}

@keyframes bounce-animation {
    0%, 20%, 60%, 100% { transform: translate(-50%, -50%) scale(1); }
    40% { transform: translate(-50%, -50%) scale(1.2); }
    80% { transform: translate(-50%, -50%) scale(1.1); }
}

/* Responsive Play Icon Sizing */
@media (max-width: 768px) {
    .play-icon {
        width: 40px;
        height: 40px;
    }
    
    .play-icon.icon-font {
        font-size: 16px;
    }
    
    .play-icon.icon-text {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .play-icon {
        width: 35px;
        height: 35px;
    }
    
    .play-icon.icon-font {
        font-size: 14px;
    }
    
    .play-icon.icon-text {
        font-size: 9px;
    }
}

.vod-grid-item .playlist-info {
    padding: 0;
    text-align: left;
    flex: none;
    display: block;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative;
    height: auto;
    min-height: auto;
    background: none;
    border-radius: 0;
}

.episode-details {
    width: 100%;
    position: relative; /* Ensure it can contain absolutely positioned icons */
    padding-right: 28px; /* Make room for the info icon */
}

.episode-details .title {
    font-weight: bold;
    margin: 0 0 0.3rem 0;
    color: var(--text-dark);
}

/* Date styling removed as dates are no longer displayed */

/* Responsive adjustments for season dropdown */
@media (max-width: 768px) {
    .season-dropdown-btn {
        min-width: 180px;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .season-dropdown-menu {
        min-width: 180px;
        max-width: 250px;
    }
    
    .season-dropdown-item {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* --- Load More Button --- */
.load-more {
    text-align: center;
    margin-top: 3rem;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.load-more a,
.load-more-btn {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 24px; /* Ensure minimum height */
    line-height: 1.2; /* Ensure proper line height */
}

/* Ensure button is always visible even with custom styling */
.load-more a {
    position: relative;
    z-index: 1;
}

.load-more a:hover,
.load-more-btn:hover {
    color: var(--primary-blue);
    transition: all 0.3s ease;
}

.load-more .arrow-down {
    border: solid var(--text-dark);
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: border-color 0.3s ease;
    min-width: 8px;
    min-height: 8px;
}

.load-more a:hover .arrow-down {
    border-color: var(--primary-blue);
}

/* Prevent typography issues that might hide the button */
.load-more a * {
    visibility: inherit !important;
    opacity: inherit !important;
}

/* Override any potential problematic typography styles */
.load-more a {
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
}

/* Ensure button works with different background combinations */
.load-more a[style*="background"] {
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
}

/* Ensure proper spacing when padding is applied */
.load-more a[style*="padding"] {
    min-width: auto;
}

/* --- Responsive Design - Episodes Grid and Typography --- */
/* Tablet adjustments (769px - 992px) - Desktop-like grid with smaller items */
@media (min-width: 769px) and (max-width: 992px) {
    .vod-info-section .vod-series-title {
        font-size: 2.25rem; /* Slightly reduce from 2.75rem for tablet */
    }
    
    /* Tablet playlist grid - desktop-like with 3 columns instead of mobile 1-column */
    .episodes-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* 3-column grid for tablet - more desktop-like */
        gap: 1.5rem; /* Reduce gap slightly for better fit */
    }
    
    /* Override data-column settings for tablet to keep desktop-like appearance */
    .vod-playlist-grid[data-columns="2"] .episodes-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .vod-playlist-grid[data-columns="3"] .episodes-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .vod-playlist-grid[data-columns="4"] .episodes-grid,
    .vod-playlist-grid[data-columns="5"] .episodes-grid,
    .vod-playlist-grid[data-columns="6"] .episodes-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Max 3 columns on tablet */
    }
    
    /* Ensure episodes maintain desktop-like card appearance on tablet */
    .vod-grid-item {
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .episode-card {
        height: auto;
        display: flex;
        flex-direction: column; /* Keep vertical layout like desktop */
    }
    
    .episode-card .thumbnail {
        aspect-ratio: 16/9;
        height: auto;
        width: 100%;
    }
    
    /* Prevent tablet from using mobile horizontal layout */
    .episode-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}

/* Ensure video placeholder never exceeds its container bounds */
.media-player,
.vod-player {
    overflow: hidden; /* Prevent any child elements from extending beyond container */
    position: relative;
}

.media-player .video-placeholder,
.vod-player .video-placeholder {
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
    max-height: 100%;
}

/* Mobile-specific placeholder constraints to prevent overflow */
@media (max-width: 768px) {
    .video-placeholder,
    .media-player .video-placeholder,
    .vod-player .video-placeholder {
        max-height: 100% !important; /* Never exceed parent container */
        height: auto !important; /* Use aspect ratio for height */
        overflow: hidden !important; /* Clip any overflow content */
        box-sizing: border-box !important; /* Include padding/borders in size */
        position: relative !important; /* Ensure proper positioning */
        display: block !important; /* Ensure proper display */
    }
    
    /* Ensure placeholder containers are properly constrained */
    .media-player,
    .vod-player,
    .video-player-wrapper {
        overflow: hidden !important; /* Prevent any child overflow */
        position: relative !important; /* Create positioning context */
        max-width: 100% !important; /* Never exceed viewport width */
    }
}

@media (max-width: 576px) {
    /* Mobile typography matching the image */
    .vod-info-section .vod-series-title {
        font-size: 2.25rem; /* Match example file */
        margin-bottom: 0.75rem !important;
        text-align: left;
        line-height: 1.2 !important;
        word-wrap: break-word; /* Prevent text overflow */
    }
    
    .vod-episode-subtitle span {
        font-size: 1.4rem; /* Match example file */
        margin-bottom: 1rem !important;
        display: block;
        text-align: left;
        line-height: 1.4 !important;
        word-wrap: break-word; /* Prevent text overflow */
    }
    
    .vod-description {
        font-size: 1rem;
        line-height: 1.6 !important;
        text-align: left;
        margin-bottom: 1.5rem !important;
        padding: 0 !important; /* Remove any padding that might cause bunching */
        word-wrap: break-word; /* Prevent text overflow */
    }
    
    /* Episodes section styling for mobile */
    .vod-grid-header h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        text-align: left;
    }
    
    /* Ensure header divider (hr) is visible on mobile - inherits from Elementor settings */
    .vod-grid-header hr {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force single column on all grid configurations */
    .episodes-grid,
    .vod-playlist-grid .episodes-grid,
    .vod-playlist-grid[data-columns="2"] .episodes-grid,
    .vod-playlist-grid[data-columns="3"] .episodes-grid,
    .vod-playlist-grid[data-columns="4"] .episodes-grid,
    .vod-playlist-grid[data-columns="5"] .episodes-grid,
    .vod-playlist-grid[data-columns="6"] .episodes-grid {
        grid-template-columns: 1fr !important; /* Force single column for all configurations */
        gap: 16px !important; /* 16px gap between playlist items */
    }
    
    /* Mobile-specific episode card layout - Apply when grid is forced to single column */
    .episodes-grid .episode-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 16px; /* Exact 16px gap as specified */
        padding: 0;
        width: 100%; /* Use full width instead of fixed 390px */
        max-width: 390px; /* Maximum width as specified */
        height: 93px; /* Total height as specified */
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s, box-shadow 0.2s;
        box-sizing: border-box;
    }
    
    .episodes-grid .episode-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    }
    
    /* Thumbnail wrapper for mobile single column */
    .episodes-grid .episode-card .thumbnail-wrapper {
        flex: 0 0 165px;
        min-width: 165px; /* Ensure minimum width */
        margin-bottom: 0 !important; /* Override base style that creates vertical spacing */
        position: relative;
    }
    
    .episodes-grid .episode-card .thumbnail-wrapper img {
        width: 100%;
        height: 93px;
        object-fit: cover;
        border-radius: 8px;
    }
    
    /* Play icon for mobile single column */
    .episodes-grid .episode-card .play-icon {
        width: 50px;
        height: 50px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .episodes-grid .episode-card .play-icon::after {
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 16px solid var(--text-dark);
        margin-left: 4px;
    }
    
    /* Episode details for mobile single column */
    .episodes-grid .episode-card .episode-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 93px; /* Match thumbnail height */
        padding: 8px 12px; /* Add some internal padding for text spacing */
        overflow: hidden; /* Ensure content doesn't overflow */
    }
    
    .episodes-grid .episode-card .episode-details .playlist-title {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-dark);
        margin: 0;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 3; /* Allow up to 3 lines of text */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-wrap: break-word;
    }
    
    /* Hide date in mobile single column */
    .episodes-grid .episode-card .episode-details .date {
        display: none;
    }
    
    /* Season selector mobile adjustments */
@media (max-width: 768px) {
    .season-selector-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .season-selector {
        width: 100%;
        min-width: auto;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    /* Default mode custom dropdown mobile adjustments */
    .default-season-dropdown {
        width: 100%;
        min-width: auto;
    }
    
    .default-season-dropdown-btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .default-season-dropdown-menu {
        width: 100%;
        min-width: auto;
        max-width: none;
        left: 0;
        right: 0;
    }
    
    .season-dropdown-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .season-dropdown-menu {
        width: 100%;
        min-width: auto;
        max-width: none;
        left: 0;
        right: 0;
    }
    
    /* Ensure season selector is fully visible at top of the playlist on mobile */
    .playlist-card .default-season-selector-container {
        margin: 0; /* Remove all margins on mobile */
        padding: 12px 16px; /* Match playlist items container padding */
        border-radius: 8px 8px 0 0;
        position: relative; /* Ensure it stays relative on mobile */
        z-index: 20; /* stay above list items */
    }

    /* Mobile playlist items container adjustments */
    .playlist-items-container {
        padding: 16px 20px; /* Better spacing for tablet/mobile */
    }
    
    /* Improve playlist items for tablet view */
    .playlist-item {
        padding: 14px 12px; /* Better padding for tablet */
        min-height: 80px;
    }
    
    .playlist-thumb {
        width: 100px;
        height: 56px;
        margin-right: 14px;
    }
    
    .playlist-title {
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    /* Avoid sticky/position issues on iOS caused by zoom */
    .playlist-card { zoom: 1; }
}

@media (max-width: 480px) {
    .season-dropdown-item {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .season-selector-label {
        font-size: 1rem;
    }
}
    .filter-dropdown {
        margin: 1.5rem 0;
        text-align: left;
    }
    
    .season-dropdown-btn {
        min-width: 140px;
        font-size: 0.95rem;
        padding: 0.6rem 1rem;
        text-align: left;
        justify-content: space-between;
    }
    
    .season-dropdown-menu {
        min-width: 140px;
        left: 0;
    }
    
    /* Additional mobile overrides for all video player containers */
    .vod-player,
    .media-player,
    .zype_player_container,
    #zype-player-container,
    [id^="zype-player-container"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 200px !important;
    }
    
    /* Force all VOD containers to be visible */
    .vod-layout .vod-player,
    .vod-layout .media-player {
        display: block !important;
        width: 100% !important;
        min-width: unset !important;
        max-width: none !important;
    }
    
    /* === MOBILE MEDIA TOGGLE REDESIGN === */
    /* HIDE original toggle buttons ONLY on mobile - they interfere with layout */
    @media (max-width: 576px) {
        .zype-player-container .media-toggle-buttons,
        .media-player .media-toggle-buttons,
        .vod-player .media-toggle-buttons,
        .vod-layout .media-toggle-buttons,
        [class*="media"] .media-toggle-buttons,
        [id*="media"] .media-toggle-buttons {
            display: none !important; /* Hide original buttons on mobile */
            visibility: hidden !important; /* Extra hiding */
            opacity: 0 !important; /* Triple hiding */
        }
    }
    
    /* Create mobile-specific toggle container positioned ABOVE player */
    .mobile-toggle-container {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        margin-bottom: 2px !important;
        z-index: 20 !important;
        display: flex !important;
        gap: 8px !important;
        pointer-events: auto !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
        /* Ensure it's a separate block element that doesn't interfere with player */
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        order: -1 !important; /* Force it to appear before other elements */
    }
    
    /* Mobile-specific toggle button styling for new container */
    .mobile-toggle-container .mobile-toggle-btn {
        display: inline-flex !important;
        min-width: 90px !important;
        max-width: 120px !important;
        padding: 10px 12px !important;
        font-size: 0.75rem !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        color: #333 !important;
        border: 2px solid #237aad !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        transition: all 0.2s ease !important;
        white-space: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        border: none !important;
    }
    
    .mobile-toggle-container .mobile-toggle-btn.active {
        background-color: #237aad !important;
        color: white !important;
        box-shadow: 0 3px 12px rgba(35, 122, 173, 0.3) !important;
    }
    
    .mobile-toggle-container .mobile-toggle-btn:hover:not(.active) {
        background-color: rgba(255, 255, 255, 1) !important;
        border-color: #1a5d7a !important;
        color: #1a5d7a !important;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Force hide any mobile force-show classes - we use separate mobile container now */
    .media-toggle-buttons.mobile-force-show {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .media-toggle-buttons.mobile-force-show .media-toggle-btn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* EMERGENCY OVERRIDE: Force toggle display even when hidden by JavaScript */
    @media (max-width: 576px) {
        .media-toggle-buttons[style*="display: none"],
        .media-toggle-buttons[style*="display:none"] {
            display: flex !important;
        }
        
        .media-toggle-btn[style*="display: none"],
        .media-toggle-btn[style*="display:none"] {
            display: inline-flex !important;
        }
        
        /* Additional override for any visibility hidden states */
        .media-toggle-buttons[style*="visibility: hidden"],
        .media-toggle-buttons[style*="visibility:hidden"] {
            visibility: visible !important;
        }
        
        /* Override opacity states */
        .media-toggle-buttons[style*="opacity: 0"],
        .media-toggle-buttons[style*="opacity:0"] {
            opacity: 1 !important;
        }
        
        /* Position regular toggle buttons above player on mobile */
        .media-toggle-buttons {
            position: relative !important;
            top: auto !important;
            right: auto !important;
            left: auto !important;
            bottom: auto !important;
            margin-bottom: 10px !important;
            justify-content: center !important;
            width: 100% !important;
            padding: 4px 8px !important;
            box-sizing: border-box !important;
            background: transparent !important;
            backdrop-filter: none !important;
            box-shadow: none !important;
        }
    }
    
    /* Active state for mobile - higher specificity */
    .media-toggle-buttons .media-toggle-btn.active {
        background-color: #237aad !important;
        color: white !important;
        border-color: #237aad !important;
        transform: none !important; /* Remove hover lift effect on mobile */
        box-shadow: 0 3px 12px rgba(35, 122, 173, 0.3) !important;
    }
    
    /* Hover state for mobile - higher specificity */
    .media-toggle-buttons .media-toggle-btn:hover:not(.active) {
        background-color: rgba(255, 255, 255, 1) !important;
        border-color: #1a5d7a !important;
        color: #1a5d7a !important;
        transform: none !important; /* Remove hover lift effect on mobile */
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
    }
    
    /* Reset containers to original layout - no more layout modifications */
    .media-player,
    .vod-player {
        position: relative !important; /* Keep positioning context only */
    }
    
    /* Add positioning context to widget containers for mobile toggles */
    .elementor-widget-zype-player {
        position: relative !important; /* Create positioning context for mobile toggles */
    }
    
    /* Reset any flexbox changes that could affect layout */
    .vod-layout,
    .zype-player-container {
        display: block !important; /* Reset to block display to prevent layout issues */
    }
    
    /* Ensure player containers maintain their original layout */
    .media-player .video-placeholder,
    .media-player [id^="zype-player-container"],
    .vod-player .video-placeholder,
    .vod-player [id^="zype-player-container"] {
        width: 100% !important;
        position: relative !important;
        /* Height will be controlled by Elementor settings */
        /* Remove order property that was affecting layout */
    }

    /* Default mode: ensure player height matches wrapper on mobile */
    .elementor-widget-container .media-player {
        aspect-ratio: 16/9 !important; /* keep correct ratio */
        height: auto !important;       /* let height be defined by ratio */
    }
    .media-player .zype_player_container,
    .media-player #zype-player-container,
    .media-player .video-placeholder,
    .media-player [id^="zype-player-container"] {
        width: 100% !important;
        height: 100% !important;     /* fill the aspect-ratio wrapper */
        min-height: 0 !important;    /* cancel generic 200px min-height */
        max-height: 100% !important; /* prevent placeholder from exceeding container */
        box-sizing: border-box !important; /* include borders/padding in size calculations */
        overflow: hidden !important; /* prevent content overflow */
    }
    .media-player [id^="zype-player-container"] iframe,
    .media-player [id^="zype-player-container"] video,
    .media-player [id^="zype-player-container"] > div {
        width: 100% !important;
        height: 100% !important;
    }
}

/* --- VOD Grid Loading --- */
.vod-grid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

/* --- VOD Grid Container --- */
/* Already updated in the previous edit */

/* Load More Button - Updated */
.load-more-button {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Additional responsive styles handled above */

/* Full-width adjustments for media section */
.elementor-widget-zype-player.elementor-widget-full_width #mediaSection,
.elementor-widget-zype-player.e-con-full #mediaSection,
.elementor-section-stretched .elementor-widget-zype-player #mediaSection {
    padding: 1.5rem; /* Consistent padding for full-width */
}

/* --- Media Container (Flex Layout) --- */
/* Using a more specific selector to win against theme/plugin conflicts */
#mediaSection > div.media-container {
    display: flex;
    flex-wrap: wrap; /* Default to wrapping for mobile-first responsive */
    gap: var(--media-container-gap, 20px); /* Use variable with a fallback */
    width: 100%;
    align-items: flex-start;
    /* Reset other properties that might be inherited */
    padding: 0;
    margin: 0 auto; /* Center if within a wider parent, but padding is 0 */
    border: none;
    box-sizing: border-box;
}

/* --- Media Player Element --- */
/* **RESTORED ORIGINAL LAYOUT** */
.elementor-widget-container .media-player {
    /* Player will grow and shrink, its initial suggested size is 60% of the container. */
    flex: 1 1 60% !important; 
    min-width: 0 !important; /* Still critical for allowing shrinkage */

    /* Reset rogue styles just in case */
    display: flex !important; /* Ensure it's a flex item if it contains other elements */
    width: auto !important; /* Let flexbox determine width based on basis */
    max-width: none !important; /* Remove any conflicting max-width from theme */
    
    /* Visual styles */
    background-color: #ddd;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
    box-sizing: border-box !important; /* Ensure padding/border included in size */
    transition: background-color .4s;
}

/* --- Playlist Card --- */
/* **NEW LAYOUT APPROACH V2** */
.playlist-card {
    /* Playlist will NOT grow or shrink from its basis. Its size is 38% of the container, capped by max-width. */
    flex: 0 0 38% !important; 
    min-width: 0 !important; /* Important for consistency, though flex-shrink: 0 makes it less active for shrinking */
    /* Set a max-width to prevent it from getting too large on ultrawide screens */
    max-width: 450px !important; /* If 38% is > 450px, it will be 450px. */
    /* Visual styles */
    background-color: #f0f0f0;
    border-radius: 12px;
    padding: 5px; /* SCROLLBAR FIX: Remove padding to allow proper flex layout */
    height: 48vh; /* Use fixed height instead of max-height to prevent shrinking */
    min-height: 400px; /* Ensure minimum height for very small viewports */
    max-height: 600px; /* Cap maximum height for very large viewports */
    overflow: hidden; /* SCROLLBAR FIX: Keep content contained - scrolling handled by inner container */ 
    box-sizing: border-box !important; /* Ensure padding/border included in size */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    zoom: 0.9; 
    transition: background-color .3s, box-shadow .3s;
    display: flex; /* Make this a flex container */
    flex-direction: column; /* Stack season selector above scrollable area */

    /* Default scrollbar styles - these will be moved to scrollable container */
    --scrollbar-width: 8px;
    --scrollbar-track-color: #ddd;
    --scrollbar-thumb-color: #237aad;
    --scrollbar-thumb-hover-color: #318ec2;
    --scrollbar-border-radius: 4px;
}

/* --- Playlist Items Scrollable Container --- */
.playlist-items-container {
    flex: 1; /* Take up remaining space in the flex container */
    overflow-y: auto; /* Enable scrolling for playlist items */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    padding: 1.25rem 1rem; /* Move padding here from playlist-card */
    border-radius: 0 0 12px 12px; /* Round bottom corners only */
    min-height: 0; /* SCROLLBAR FIX: Allow flex item to shrink below content size */
    max-height: 100%; /* SCROLLBAR FIX: Ensure container doesn't exceed parent */
    
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
}

/* Webkit scrollbar styles for playlist items container */
.playlist-items-container::-webkit-scrollbar {
    width: var(--scrollbar-width, 8px);
}

.playlist-items-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color, #ddd);
    border-radius: var(--scrollbar-border-radius, 4px);
}

.playlist-items-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-color, #237aad);
    border-radius: var(--scrollbar-border-radius, 4px);
    border: 2px solid var(--scrollbar-track-color, #ddd);
    min-height: 40px;
}

.playlist-items-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-color, #318ec2);
}

/* Legacy scrollbar styles - kept for backward compatibility but moved to items container */
.playlist-card::-webkit-scrollbar {
    width: var(--scrollbar-width, 8px);
}

.playlist-card::-webkit-scrollbar-track {
    background: var(--scrollbar-track-color, #ddd);
    border-radius: var(--scrollbar-border-radius, 4px);
}

.playlist-card::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb-color, #237aad);
    border-radius: var(--scrollbar-border-radius, 4px);
    border: 2px solid var(--scrollbar-track-color, #ddd);
    min-height: 40px;
}

.playlist-card::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover-color, #318ec2);
}

/* Container specifically for the injected Zype Player content */
[id^="zype-player-container"] {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
}

/* Ensure media player containers have positioning context for toggle buttons */
.media-player,
.vod-player,
.video-player-wrapper {
    position: relative;
}

/* --- Audio Mode Specific Styles --- */
.audio-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    display: none;
}

.audio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2;
    display: none;
}

.audio-mode [id^="zype-player-container"],
.audio-mode [id^="zype-player-container"] div[id^=zype_],
.audio-mode [id^="zype-player-container"] iframe,
.audio-mode [id^="zype-player-container"] video,
.audio-mode [id^="zype-player-container"] > div {
    background: transparent !important;
}

.audio-mode [id^="zype-player-container"] > div {
    position: relative;
    z-index: 3;
}

/* --- Audio/Video Toggle Buttons --- */
.media-toggle-buttons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 10; /* Z-INDEX FIX: Lower value to prevent overlap with navigation bars */
    background: rgba(0, 0, 0, 0.7);
    padding: 4px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    max-width: 160px;
    width: auto;
    height: auto !important; /* Force auto height, don't inherit from parent */
    min-height: auto !important; /* Override any min-height inheritance */
    max-height: 36px !important; /* Cap the maximum height */
    pointer-events: auto;
    /* Ensure it doesn't interfere with video content */
    opacity: 0.9;
    transition: opacity 0.3s ease;
    /* Prevent any flex-grow or height inheritance issues */
    flex-shrink: 0;
    flex-grow: 0;
    /* Prevent container overflow */
    overflow: hidden;
}

.media-toggle-buttons:hover {
    opacity: 1;
}

/* Ensure toggle buttons don't cover too much area */
.media-player .media-toggle-buttons,
.vod-player .media-toggle-buttons {
    /* Additional specificity to ensure proper positioning */
    max-width: 200px;
    flex-wrap: nowrap;
}

/* Mobile: Show mobile container, hide regular toggle buttons */
@media (max-width: 576px) {
    .mobile-toggle-container {
        display: flex !important; /* Show mobile container on mobile */
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Desktop/tablet positioning - overlay in top-right corner */
@media (min-width: 577px) {
    .media-toggle-buttons {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        margin-bottom: 0 !important;
        width: auto !important;
        justify-content: flex-end !important;
        background: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* When JavaScript enables toggle display on desktop, ensure it shows */
    .media-toggle-buttons[style*="display: flex"],
    .media-toggle-buttons[style*="display:flex"] {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-toggle-container {
        display: none !important; /* Hide mobile container on desktop */
    }
}

.media-toggle-btn {
    padding: 2px 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all .2s ease;
    font-weight: 600;
    letter-spacing: .2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    font-size: .65rem;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    min-width: 60px;
    /* max-width: 85px; */
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Ensure buttons maintain proper size and don't overflow */
    height: auto !important;
    min-height: 24px !important;
    /* max-height: 28px !important; */
    flex-shrink: 1;
    flex-grow: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-toggle-btn i,
.media-toggle-btn svg {
    font-size: 1em;
}

.media-toggle-btn.active {
    background-color: #237aad;
    color: #fff;
    border-color: #237aad;
    transform: none;
    box-shadow: 0 2px 6px rgba(35, 122, 173, 0.4);
}

.media-toggle-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 1);
    border-color: #237aad;
    color: #237aad;
    transform: none;
    box-shadow: 0 2px 6px rgba(35, 122, 173, 0.2);
}

/* --- Playlist Card Scrollbar (Webkit Browsers) --- */
/* This section is now handled by the new .playlist-card rule */

/* --- Playlist Header and Controls --- */
.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: .5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.playlist-header h4 {
    font-size: 18px;
    margin: 0;
}

.playlist-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

/* --- Toggle Containers & Switch --- */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    background-color: #d4d4d4;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: background-color .3s;
}

.toggle-container span {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    transition: color .3s;
}

.mini-switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
}

.mini-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mini-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 16px;
    border: 1px solid #999;
}

.mini-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .mini-slider {
    background-color: #237aad;
}

input:checked + .mini-slider:before {
    transform: translateX(14px) translateY(-50%);
}

input:focus + .mini-slider {
    box-shadow: 0 0 1px #237aad;
}

/* --- Playlist Item Styles --- */
.playlist-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: all .2s ease;
    position: relative;
    min-height: 84px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: transparent;
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background-color: #e5e5e5;
}

.playlist-item.active {
    background-color: #dad9d9;
    padding-bottom: 16px; /* reduce extra space; label sits inside now */
}

/* Styling for the thumbnail image */
.elementor-widget-container #mediaSection .playlist-thumb {
    width: 120px;
    height: 68px;
    object-fit: cover;
    margin-right: 1rem;
    border-radius: 6px !important; /* Override Elementor's img style */
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12) !important; /* Override Elementor's img style */
    flex-shrink: 0;
    background-color: #f5f5f5;
}

/* Container for the title and duration text */
.elementor-widget-container #mediaSection .playlist-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 68px;
    position: relative;
    gap: 4px;
    padding-bottom: 5px;
    padding-right: 28px; /* Make room for the info icon */
}

/* Natural layout row for title + badge */
.elementor-widget-container #mediaSection .playlist-info .title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Styling for the item title */
.elementor-widget-container #mediaSection .playlist-title {
    font-weight: 600;
    font-size: 15px;
    margin: 0;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    margin-bottom: 2px;
    transition: color .3s;
}

.current-label {
    position: static; /* natural flow inside .playlist-info */
    display: inline-block;
    margin-top: 4px;
    margin-left: auto; /* align to the right within the info column */
    background-color: #237aad;
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
    white-space: nowrap;
}

/* --- Playlist Empty/Loading States --- */
.playlist-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #777;
    font-style: italic;
    transition: color .3s;
}

.playlist-empty p {
    margin: 10px 0 0;
    font-size: .9rem;
}

.spinner-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(35, 122, 173, .1);
    border-radius: 50%;
    border-top-color: #237aad;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.playlist-empty.error {
    color: #d9534f;
    font-style: normal;
}

.playlist-empty.error p {
    font-weight: 500;
}

.playlist-empty .retry-btn {
    margin-top: 15px;
    background-color: #237aad;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .85rem;
    transition: background-color .2s;
}
 
.playlist-empty .retry-btn:hover {
    background-color: #318ec2;
}

/* --- Additional Widget Styles --- */
.teaching-description {
    margin-top: 1rem !important;
    padding: 1.25rem 1rem !important;
    background-color: #f0f0f0 !important; /* Same as playlist background */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    box-sizing: border-box !important;
    transition: background-color .3s, box-shadow .3s !important;
    max-width: 735px;/* Default max-width, can be overridden by Elementor control */
    margin-left: auto !important;
    margin-right: auto !important;
    
    /* Remove old styles that might conflict */
    margin-bottom: 0 !important;
    border: none !important;
    border-left: none !important;
}

.teaching-description p {
    margin: 0 ;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* .teaching-duration {
    margin-top: .5rem
    padding: .5rem 1rem;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: .9rem;
}

.teaching-duration p {
    margin: 0;
    color: #666;
} */

/* --- Download Button Container --- */
.download-button-container {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* --- Player Title --- */
.player-title-container {
    margin-bottom: 1rem;
    text-align: left;
}

.elementor-widget-container .player-title,
.elementor-widget-container h1.player-title,
.elementor-widget-container h2.player-title,
.elementor-widget-container h3.player-title,
.elementor-widget-container h4.player-title,
.elementor-widget-container h5.player-title,
.elementor-widget-container h6.player-title,
.elementor-widget-container p.player-title,
.elementor-widget-container div.player-title,
.elementor-widget-container span.player-title,
#mediaSection .player-title {
    font-size: 27px !important;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
    transition: color .3s ease;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #227AAD 0%, #1e6a98 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all .3s ease;
    box-shadow: 0 4px 12px rgba(34, 122, 173, 0.35);
    border: none;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.download-btn:hover {
    background: linear-gradient(135deg, #1e6a98 0%, #227AAD 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 122, 173, 0.45);
    text-decoration: none;
    color: #ffffff !important;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 122, 173, 0.35);
    color: #ffffff !important;
}

.download-btn:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(34, 122, 173, 0.35), 0 0 0 3px rgba(34, 122, 173, 0.2);
    color: #ffffff !important;
}

.download-text {
    white-space: nowrap;
    font-weight: 600;
    color: #ffffff !important;
}

.download-btn i {
    font-size: 1.1rem;
    opacity: 0.95;
    transition: transform 0.3s ease;
    color: #ffffff !important;
}

.download-btn:hover i {
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* --- Elementor Width Control Support --- */
.elementor-widget-zype-player .media-container {
    /* max-width is handled by .media-container directly if not overridden by Elementor full-width */
    width: 100%; /* Ensure it spans the Elementor widget area */
}

.elementor-widget-zype-player.elementor-widget-full_width .media-container,
.elementor-widget-zype-player.e-con-full .media-container,
.elementor-section-stretched .elementor-widget-zype-player .media-container {
    max-width: none !important; /* Override any specific max-width for full-stretch scenarios */
    padding: 0 1.5rem !important; /* Add some padding when the container itself is full-width */
}

.elementor-widget-zype-player.elementor-widget-full_width #mediaSection,
.elementor-widget-zype-player.e-con-full #mediaSection,
.elementor-section-stretched .elementor-widget-zype-player #mediaSection {
    padding: 1.5rem 0;
}

/* --- Responsive Adjustments --- */
@media (min-width: 1025px) {
    /* For "Responsive" setting: player and playlist side-by-side on desktop */
    /* This applies when .mc-layout-force-nowrap is NOT present */
    #mediaSection > div.media-container:not(.mc-layout-force-nowrap) {
        flex-wrap: nowrap !important;
    }
}

/* Style for explicit Elementor control option "Always Side-by-Side" */
/* This overrides the responsive defaults if chosen */
#mediaSection > div.media-container.mc-layout-force-nowrap {
    flex-wrap: nowrap !important; /* User explicitly chose to never wrap */
}

/* (Removed .mc-layout-force-wrap rule as the option was removed) */

@media (max-width: 1024px) {
    /* On mobile, the base style for .media-container (flex-wrap: wrap) handles responsive stacking. */
    /* The :not(.mc-layout-force-nowrap) in the desktop media query ensures that if nowrap is forced, it stays nowrap. */

    /* These rules make the player column and playlist stack vertically on mobile IF the container is wrapping */
    #mediaSection > div.media-container > .media-player,
    #mediaSection > div.media-container > .playlist-card {
         flex: 1 1 100% !important;
         min-width: 0 !important; /* Allow shrinking */
         max-width: none !important;
    }

    #mediaSection > div.media-container > .playlist-card {
         margin-top: 1rem !important;
         height: 50vh !important; /* Use fixed height instead of max-height */
         min-height: 350px !important; /* Ensure minimum height on mobile */
         max-height: 500px !important; /* Cap maximum height on mobile */
    }
    
    /* Padding now handled by widget container - removed duplicate rule */
}

/* Legacy 480px mobile styles - now handled in main 576px mobile section above */
@media (max-width: 480px) {
    /* Media toggle buttons now handled in 576px mobile section above */
    .playlist-card { 
        padding: 0; /* Remove padding since items container handles it */
        height: 50vh !important; /* Use fixed height instead of max-height */
        min-height: 320px !important; /* Ensure minimum height on small mobile */
        max-height: 450px !important; /* Cap maximum height on small mobile */
        margin: 0; /* Remove any margins */
    }
    
    /* Optimize playlist items container for better space usage */
    .playlist-items-container {
        padding: 12px 16px; /* Better balance: 16px horizontal, 12px vertical */
    }
    
    /* Improve playlist item layout for better readability */
    .playlist-item { 
        padding: 12px 8px; /* Increase vertical padding, reduce horizontal */
        min-height: 70px; /* Reduce min height for more compact layout */
        margin-bottom: 8px; /* Add space between items */
    }
    
    /* Optimize thumbnail size for better text space */
    .playlist-thumb { 
        width: 90px; /* Slightly larger for better visibility */
        height: 50px; /* Maintain aspect ratio */
        margin-right: 12px; /* Better spacing */
        flex-shrink: 0; /* Prevent thumbnail from shrinking */
    }
    
    /* Ensure playlist info takes up remaining space properly - UPDATED for current-label fix */
    .playlist-info {
        flex: 1;
        min-width: 0; /* Allow text to shrink and wrap */
        padding-right: 70px !important; /* More space for absolutely positioned current-label AND info icon */
        padding-top: 2px; /* Small top padding to prevent overlap with current-label */
        position: relative; /* Ensure positioning context for absolutely positioned current-label */
    }
    
    /* MOBILE NOW PLAYING FIX: Improved title display with better space management */
    .playlist-title {
        font-size: 14px !important; /* Slightly larger for readability */
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
        /* Allow title to wrap to multiple lines instead of truncating */
        display: -webkit-box;
        -webkit-line-clamp: 3; /* INCREASED to 3 lines for better readability with current-label positioned absolutely */
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-wrap: break-word;
        padding-right: 0; /* Remove extra padding since parent handles spacing */
    }
    
    .playlist-header h4 { font-size: 1rem; }
    .toggle-container { padding: 4px 8px; font-size: .75rem; }
    /* MOBILE NOW PLAYING FIX: Redesigned layout for better space management */
    .current-label { 
        font-size: 0.8rem; /* Increased from 0.6rem for better visibility */
        padding: 2px 6px; /* Slightly more padding for better touch target */
        position: absolute; /* Position absolutely within playlist-info */
        top: 50px; /* Position at top of info area */
        right: 8px; /* Keep right alignment */
        margin: 0; /* Remove margins since using absolute positioning */
        z-index: 5; /* Ensure it's above other content */
    }
    .playlist-item.active { padding-bottom: 16px; } /* Reduce extra padding on active items */
}

/* --- Continue Watching/Listening Pop-up --- */
.zype-continue-popup {
    display: none; /* Hidden by default */
    position: absolute; /* Position relative to the media player container */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 60; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */ /* Ensure it's above other elements */
    width: 420px;
    max-width: 90%;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    border: 1px solid rgba(35, 122, 173, 0.2);
    backdrop-filter: blur(10px);
}

.zype-continue-popup.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.zype-continue-popup:not(.show) {
    transform: translate(-50%, -50%) scale(0.9);
}

.zype-popup-content {
    margin-bottom: 20px;
}

.zype-popup-content p {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 600;
    color: #2c3e50;
}

.zype-popup-content .popup-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 400;
    margin-top: 5px;
}

.zype-popup-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.zype-popup-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.zype-popup-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.zype-popup-btn:hover::before {
    left: 100%;
}

.zype-popup-yes {
    background: linear-gradient(135deg, #237aad 0%, #1e6a98 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(35, 122, 173, 0.3);
}

.zype-popup-yes:hover {
    background: linear-gradient(135deg, #1e6a98 0%, #237aad 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 122, 173, 0.4);
}

.zype-popup-yes:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(35, 122, 173, 0.3);
}

.zype-popup-no {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.zype-popup-no:hover {
    background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.zype-popup-no:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Ensure the popup is positioned relative to the media player */
.media-player {
    position: relative; /* This ensures the popup positions relative to the player */
}

/* Add a subtle overlay behind the popup */
.zype-continue-popup::after {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zype-continue-popup.show::after {
    opacity: 1;
}

/* ================================================== */
/* BITMOVIN PLAYER INTEGRATION STYLES */
/* ================================================== */

/* Ensure our player container integrates with Zype's new structure */
.zype_player_container {
    background: #000000 !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    padding-top: 0 !important;
    overflow: hidden !important;
}

.zype_player_container > div {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Bitmovin player container integration */
.zype_player_container .bitmovinplayer-container {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Hide Bitmovin branding/watermark if needed */
.bitmovinplayer-container .bmpui-ui-watermark {
    opacity: 0 !important;
    display: none !important;
}

/* Ensure video element fills container properly */
.bitmovinplayer-container video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Zype playlist container styling to integrate with Bitmovin */
.zype_playlist_container {
    display: none !important; /* Hide Zype's default playlist */
}

/* Ensure our custom playlist card shows properly with new structure */
#mediaSection .playlist-card {
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Handle any Zype containers that appear at document level */
body > div[id^="zype_"] {
    /* Allow Zype containers at document level for new structure */
}

/* Media player adjustments for Bitmovin */
.media-player #zype-player-container {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

/* Audio mode overlay adjustments for Bitmovin */
/* Audio-only overlay disabled */
.audio-loading-overlay {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Responsive adjustments for Bitmovin player on mobile */
@media (max-width: 768px) {
    .zype_player_container {
        padding-bottom: 56.25% !important; /* Maintain 16:9 on mobile */
    }
    
    .bitmovinplayer-container {
        /* Ensure touch controls work properly on mobile */
        touch-action: manipulation !important;
    }
}

/* Ensure our widgets work with Bitmovin's complex UI structure */
.bitmovinplayer-container .bmpui-ui-controlbar,
.bitmovinplayer-container .bmpui-ui-uicontainer {
    /* Allow Bitmovin controls to function normally */
    pointer-events: auto !important;
}

/* Performance optimization for Bitmovin */
.bitmovinplayer-container * {
    /* Optimize rendering for smooth video playback */
    will-change: auto;
}

/* Debug helper - can be removed in production */
.debug-bitmovin-structure [id^="zype_"],
.debug-bitmovin-structure [class*="bitmovin"] {
    border: 1px solid red !important;
    position: relative !important;
}

.debug-bitmovin-structure [id^="zype_"]::before,
.debug-bitmovin-structure [class*="bitmovin"]::before {
    content: attr(id) " " attr(class);
    position: absolute;
    top: 0;
    left: 0;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    padding: 2px;
    z-index: 50; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
    pointer-events: none;
}

/* ================================
   PHASE 3: ADVANCED FEATURES STYLES
   ================================ */

/* Audio-only mode enhancements */
/* Audio-only mode visuals disabled */
.zype-audio-only-mode .bitmovinplayer-container::before,
.audio-mode-indicator {
    display: none !important;
    content: none !important;
}

/* Playlist audio content indicators */
.playlist-item.audio-content::before {
    content: "🎵 ";
    margin-right: 5px;
}

/* Enhanced playlist styling for audio content */
.zype-audio-only-mode .playlist-item {
    background: linear-gradient(90deg, #f8f9fa, #e9ecef);
    border-left: 3px solid #007bff;
}

.zype-audio-only-mode .playlist-item.active {
    background: linear-gradient(90deg, #d4edda, #c3e6cb);
    border-left-color: #28a745;
}

/* Safe mode error styling */
.zype-error-safe-mode {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
}

.zype-error-safe-mode > div {
    padding: 20px !important;
    text-align: center !important;
    background: #f0f0f0 !important;
    border-radius: 5px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.zype-error-safe-mode button {
    padding: 10px 20px !important;
    margin-top: 10px !important;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.zype-error-safe-mode button:hover {
    background: #0056b3;
}

/* Performance optimization indicators */
.zype-player-container[data-optimized="true"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.zype-player-container[data-optimized="false"] {
    opacity: 0.9;
}

/* Loading states for better UX */
.zype-player-container.loading {
    position: relative;
}

.zype-player-container.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 60; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced download button states */
.download-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.download-btn:not(.disabled) {
    position: relative;
    overflow: hidden;
}

.download-btn:not(.disabled)::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.download-btn:not(.disabled):hover::before {
    left: 100%;
}

/* Responsive enhancements for Phase 3 features */
@media (max-width: 768px) {
    .audio-mode-indicator {
        font-size: 10px !important;
        padding: 3px 6px !important;
        top: 5px !important;
        right: 5px !important;
    }
    
    .zype-error-safe-mode > div {
        margin: 10px;
        padding: 15px !important;
    }
    
    .zype-audio-only-mode .bitmovinplayer-container::before {
        font-size: 32px;
    }
}

/* Accessibility improvements */
.audio-mode-indicator[aria-label] {
    cursor: help;
}

.zype-player-container[aria-busy="true"] {
    cursor: wait;
}

/* Performance optimization classes */
.optimized-polling {
    border-left: 2px solid #28a745;
}

.high-frequency-polling {
    border-left: 2px solid #ffc107;
}

/* History navigation styling */
.playlist-item[data-recently-played="true"] {
    position: relative;
}

.playlist-item[data-recently-played="true"]::after {
    content: "↻";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 12px;
}

/* ================================
   PHASE 4: WIDGET INTEGRATION STYLES
   ================================ */

/* Multi-widget focus management */
.widget-focused {
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.5) !important;
    border: 2px solid #007bff !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
    z-index: 50; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
}

.widget-focused .playlist-card {
    border-color: #007bff !important;
}

/* Responsive breakpoint classes */
.zype-player-container.zype-mobile {
    /* Mobile-specific styles */
    max-width: 100%;
    margin: 0;
    padding: 0 10px;
}

.zype-player-container.zype-mobile .playlist-card {
    margin-top: 15px;
    border-radius: 8px;
}

.zype-player-container.zype-mobile .playlist-item {
    padding: 12px 15px;
    font-size: 14px;
}

.zype-player-container.zype-mobile .playlist-item .playlist-title {
    font-size: 14px;
    line-height: 1.4;
}

.zype-player-container.zype-mobile .player-controls {
    padding: 10px;
    gap: 15px;
}

.zype-player-container.zype-mobile .control-button {
    padding: 8px 12px;
    font-size: 12px;
}

.zype-player-container.zype-tablet {
    /* Tablet-specific styles */
    max-width: 100%;
    padding: 0 15px;
}

.zype-player-container.zype-tablet .playlist-card {
    margin-top: 20px;
}

.zype-player-container.zype-tablet .playlist-item {
    padding: 14px 16px;
    font-size: 15px;
}

.zype-player-container.zype-laptop {
    /* Laptop-specific styles */
    max-width: 1200px;
    margin: 0 auto;
}

.zype-player-container.zype-desktop {
    /* Desktop-specific styles */
    max-width: 1400px;
    margin: 0 auto;
}

/* Orientation-specific styles */
.zype-player-container.zype-portrait {
    /* Portrait orientation adjustments */
}

.zype-player-container.zype-portrait .playlist-card {
    max-height: 50vh;
    overflow-y: auto;
}

.zype-player-container.zype-landscape {
    /* Landscape orientation adjustments */
}

/* Mobile-specific playlist optimizations */
.playlist-card.compact-mobile {
    max-height: 40vh;
    overflow-y: auto;
}

.playlist-card.compact-mobile .playlist-item {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.playlist-card.compact-mobile .playlist-item:last-child {
    border-bottom: none;
}

.playlist-card.compact-mobile .playlist-title {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
}

/* Playlist title info icon and popup */
.playlist-title-info-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.playlist-title-info-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.playlist-title-info-icon svg {
    color: #666;
    transition: color 0.2s ease;
}

.playlist-title-info-icon:hover svg {
    color: #333;
}

.playlist-title-popup {
    position: fixed; /* Changed to fixed to avoid clipping */
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.3;
    max-width: 200px;
    white-space: normal;
    word-wrap: break-word;
    z-index: 100; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px) scale(0.95);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.playlist-title-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Hide arrow for now to simplify positioning */
.playlist-title-popup::before {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .playlist-title-popup {
        right: 28px;
        max-width: 180px;
        font-size: 12px;
    }
    
    .playlist-title-info-icon {
        width: 18px;
        height: 18px;
    }
    
    .playlist-title-info-icon svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .playlist-title-popup {
        right: 28px;
        max-width: 150px;
        left: auto;
        transform-origin: top right;
    }
}

/* Tablet layout optimizations */
.playlist-card.tablet-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.playlist-card.tablet-layout .playlist-item {
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.playlist-card.tablet-layout .playlist-item:hover {
    background: #e9ecef;
}

/* Mobile control sizing */
.control-button.mobile-size {
    padding: 6px 10px !important;
    font-size: 11px !important;
    min-height: 32px;
}

.control-button.mobile-size .toggle-text {
    display: none; /* Hide text on mobile */
}

/* Cross-widget conflict resolution indicators */
.zype-player-container[data-conflict="true"] {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.zype-player-container[data-conflict="true"]::before {
    content: "⏸ Paused - Another player is active";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 60; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
    white-space: nowrap;
}

/* Priority indicators */
.zype-player-container[data-priority="high"] {
    border-left: 4px solid #28a745;
}

.zype-player-container[data-priority="medium"] {
    border-left: 4px solid #ffc107;
}

.zype-player-container[data-priority="low"] {
    border-left: 4px solid #6c757d;
}

/* Resource sharing indicators */
.zype-player-container[data-shared-resources="true"] .playlist-card::after {
    content: "🔗";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    opacity: 0.5;
    z-index: 100;
}

/* Cross-tab communication status */
.zype-player-container[data-cross-tab="connected"]::before {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    z-index: 50; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
}

/* Enhanced responsive video container */
@media (max-width: 480px) {
    /* Ensure consistent padding hierarchy for smallest screens */
    .elementor-widget-zype-player {
        padding: 0 20px !important; /* Single source of truth for mobile padding */
    }
    
    /* Remove duplicate padding since widget container handles it */
    .zype-player-container {
        padding: 0;
    }
    
    /* Ensure media container uses full width with proper spacing */
    .media-container {
        gap: 12px !important; /* Tighter gap for small screens */
        margin: 0 !important;
        padding: 0 !important; /* Remove padding since widget container handles it */
    }
    
    .zype_player_container,
    .bitmovinplayer-container {
        border-radius: 8px;
        overflow: hidden;
    }
    
    .player-title-container {
        padding: 10px 8px;
        text-align: center;
    }
    
    .player-title {
        font-size: 16px;
        line-height: 1.4;
    }
    
    /* MOBILE DOWNLOAD BUTTON FIX: New positioning and styling */
    .download-btn {
        padding: 8px 16px;
        font-size: 13px !important; /* Set to 13px as requested */
        margin-top: 10px;
        margin-bottom: 0 !important; /* Remove bottom margin as requested */
    }
    
    /* Season selector padding consistency for small mobile */
    .playlist-card .default-season-selector-container {
        padding: 10px 12px; /* Slightly smaller for very small screens */
    }
    
    /* Compact mobile playlist */
    .playlist-card {
        margin: 10px 0;
        border-radius: 8px;
        height: 35vh !important; /* Use fixed height instead of max-height */
        min-height: 280px !important; /* Ensure minimum height on very small screens */
        max-height: 400px !important; /* Cap maximum height on very small screens */
    }
    
    .playlist-item {
        padding: 10px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .playlist-item:last-child {
        border-bottom: none;
    }
    
    /* Mobile player controls */
    .player-controls {
        flex-direction: column;
        gap: 10px;
        padding: 15px 10px;
    }
    
    .control-row {
        display: flex;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .toggle-container {
        flex: 0 0 auto;
        margin: 0;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .zype-player-container.zype-portrait {
        padding: 0; /* Widget container handles padding */
    }
    
    .zype_player_container,
    .bitmovinplayer-container {
        max-height: 45vh;
    }
    
    .playlist-card.compact-mobile {
        max-height: 35vh;
    }
}

@media (max-width: 1024px) {
    .zype-player-container {
        max-width: 100%;
        margin: 0 auto;
        padding: 0; /* Widget container handles padding */
    }
    
    .player-controls {
        padding: 20px 15px;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .audio-mode-indicator,
    .widget-focused {
        transform: translateZ(0); /* Force hardware acceleration */
    }
    
    .playlist-item {
        border-bottom: 0.5px solid #eee;
    }
}

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    .widget-focused,
    .playlist-item,
    .control-button {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}


/* Print styles - hide interactive elements */
@media print {
    .zype-player-container {
        display: none !important;
    }
}


/* Zype VOD Layout Styles */

.media-container.vod-layout {
    flex-direction: column;
}

.media-container.vod-layout .media-player {
    width: 100% !important;
    flex: none !important;
}

.media-container.vod-layout .teaching-info-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 20px;
}

.media-container.vod-layout .player-title-container {
    flex-grow: 1;
}

.media-container.vod-layout .teaching-description {
    flex-basis: 50%;
    margin-left: 20px;
}

.media-container.vod-layout .playlist-card {
    width: 100% !important;
    flex: none !important;
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Mobile overrides for VOD layout */
@media (max-width: 576px) {
    /* MOBILE DOWNLOAD BUTTON DEBUG: Temporarily show original to test if download button is enabled */
    .download-button-container {
        display: none !important; /* TEMPORARY: Show original to test */
        padding: 10px !important;
        text-align: center !important;
    }
    
    /* Style for mobile download button created inside media container */
    .media-container .mobile-download-button {
        display: flex !important;
        margin: 15px 0 10px 0 !important; /* Space above and below */
        padding: 0 !important;
        justify-content: center; /* Center the button */
        width: 100%; /* Full width for proper centering */
    }
    
    .media-container .mobile-download-button .download-btn {
        font-size: 13px !important;
        margin: 0 !important; /* No additional margins as requested */
        padding: 10px 20px; /* Slightly larger touch target for mobile */
    }
    
    /* Ensure media container uses flex-direction: column for proper stacking */
    .media-container:not(.vod-layout) {
        flex-direction: column !important; /* Stack elements vertically on mobile */
        position: relative;
    }
    
    /* Remove padding for full width on mobile */
    .media-container.vod-layout {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .media-container.vod-layout .media-player {
        width: 100% !important;
        min-width: unset !important;
        flex: none !important;
        display: block !important; /* Ensure it displays */
        visibility: visible !important; /* Ensure it's visible */
        opacity: 1 !important; /* Ensure it's not transparent */
        position: relative !important; /* Ensure proper positioning */
        z-index: 1 !important; /* Ensure it's above other elements */
    }
    
    /* Ensure all video containers within the media player are visible */
    .media-container.vod-layout .media-player .zype_player_container,
    .media-container.vod-layout .media-player #zype-player-container,
    .media-container.vod-layout .media-player [id^="zype-player-container"],
    .media-container.vod-layout .media-player .video-placeholder {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        aspect-ratio: 16/9; /* Maintain aspect ratio on mobile */
        height: auto !important;
        min-height: unset !important; /* Let aspect ratio control height */
        max-height: 100% !important; /* Prevent exceeding container bounds */
        box-sizing: border-box !important; /* Include padding/borders in size calculations */
        overflow: hidden !important; /* Prevent content overflow */
    }
    
    .media-container.vod-layout .playlist-card {
        display: block !important; /* Switch from grid to block for mobile */
        grid-template-columns: none !important;
        margin-top: 15px;
    }
    
    .media-container.vod-layout .playlist-card .episodes-grid {
        grid-template-columns: 1fr !important; /* Single column for mobile */
        gap: 1rem;
    }
    
    /* Ensure episode cards respect container padding and don't extend to screen edges */
    .media-container.vod-layout .episodes-grid .episode-card {
        max-width: calc(100% - 40px) !important; /* Account for 20px padding on each side */
        width: 100% !important; /* Allow cards to be responsive */
        box-sizing: border-box !important;
    }
}

/* DEFAULT MODE RESET - Ensure default layout works properly when NOT in VOD mode */
.media-container:not(.vod-layout) {
    display: flex !important;
    flex-direction: row !important;
    /* Allow wrapping by default so mobile can stack; desktop nowrap is handled above */
    flex-wrap: wrap !important;
    gap: var(--media-container-gap, 20px) !important;
}

.media-container:not(.vod-layout) .media-player {
    flex: 1 1 60% !important;
    width: auto !important;
    max-width: none !important;
    margin-top: 0 !important;
}

.media-container:not(.vod-layout) .playlist-card {
    flex: 0 0 38% !important;
    width: auto !important;
    max-width: 450px !important;
    margin-top: 0 !important;
    display: block !important;
    grid-template-columns: none !important;
}

.media-container:not(.vod-layout) .teaching-info-container {
    display: block !important;
    margin-top: 0 !important;
}

/* Teaching description in default mode - positioned outside media container */
/* Note: Width and max-width can be overridden by Elementor controls */
#mediaSection .teaching-description {
    margin-top: 1.5rem !important;
    padding: 1.25rem 1rem !important;
    background-color: #f0f0f0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    /* Default width settings - can be overridden by Elementor controls with higher specificity */
    width: 100%;
    max-width: 60%;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.season-selector-container {
    margin-top: 20px;
}

.season-selector {
    width: 200px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
} 


/* =============================================================================
   ZYPE PLAYER WIDGET - ADMIN CSS (ELEMENTOR EDITOR)
   Improved label layout and alignment as per IMPROVED-SETTINGS-ORGANIZATION-PLAN.md
   ============================================================================= */

/* Fix label alignment and control positioning */
.elementor-control {
    display: flex !important;
    align-items: flex-start !important;
    min-height: 32px;
}

.elementor-control-title {
    flex: 0 0 140px !important;
    max-width: 140px !important;
    word-wrap: break-word !important;
    line-height: 1.3 !important;
    padding-right: 10px !important;
    padding-top: 6px !important; /* Align with input */
}

.elementor-control-input-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative;
}

/* Help icon styling */
.zype-help-icon {
    display: inline-block;
    margin-left: 5px;
    cursor: help;
    color: #6c7781;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.zype-help-icon:hover {
    opacity: 1;
    color: #0073aa;
}

/* Help tooltip */
.zype-help-tooltip {
    position: absolute;
    background: #23282d;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 250px;
    z-index: 200; /* Z-INDEX FIX: Lower value to prevent overlap with navigation */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.zype-help-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.zype-help-tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 15px;
    border: 5px solid transparent;
    border-bottom-color: #23282d;
}

/* Enhanced styling for informational blocks */
.zype-info-block {
    background: #1e293b;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.4;
}

.zype-info-block.setup-guide {
    border-left: 3px solid #28a745;
}

.zype-info-block.component-guide {
    border-left: 3px solid #0073aa;
}

.zype-info-block.feature-guide {
    border-left: 3px solid #ffc107;
}

.zype-info-block strong {
    font-weight: 600;
}

/* Improved section headers */
.elementor-control-section_essential_configuration .elementor-panel-heading-title::before,
.elementor-control-section_content_source_configuration .elementor-panel-heading-title::before,
.elementor-control-section_media_thumbnails .elementor-panel-heading-title::before,
.elementor-control-section_interface_visibility .elementor-panel-heading-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background: #0073aa;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .elementor-control-title {
        flex: 0 0 120px !important;
        max-width: 120px !important;
    }
}

@media (max-width: 768px) {
    .elementor-control {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .elementor-control-title {
        flex: none !important;
        max-width: none !important;
        padding-bottom: 5px !important;
    }
}

/* Special styling for complex controls */
.elementor-control[data-setting*="player_mode"] .elementor-control-title,
.elementor-control[data-setting*="season_type"] .elementor-control-title,
.elementor-control[data-setting*="enable_seasons"] .elementor-control-title {
    font-weight: 600;
}

/* Better spacing for sections */
.elementor-control-type-section .elementor-panel-heading {
    margin-top: 15px;
}

.elementor-control-type-section:first-child .elementor-panel-heading {
    margin-top: 0;
}

/* Enhanced visibility for important settings */
.elementor-control[data-setting="player_mode"],
.elementor-control[data-setting="playlist_mode"],
.elementor-control[data-setting="enable_seasons"] {
    background: rgba(0, 115, 170, 0.05);
    border-left: 2px solid #0073aa;
    padding-left: 8px;
    margin-left: -8px;
}

/* Help container improvements */
.zype-help-container {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.zype-help-container .zype-help-icon {
    font-style: normal;
    text-decoration: underline;
    cursor: pointer;
}

/* Tooltip positioning improvements */
.elementor-control-input-wrapper {
    position: relative;
}

/* Better contrast for dark theme */
.elementor-editor-dark .zype-help-tooltip {
    background: #2a2a2a;
    color: #f1f1f1;
}

.elementor-editor-dark .zype-help-tooltip::before {
    border-bottom-color: #2a2a2a;
}

/* Section organization visual cues */
.elementor-control-section_layout_dimensions .elementor-panel-heading-title,
.elementor-control-section_playlist_styling .elementor-panel-heading-title,
.elementor-control-section_season_selector_styling .elementor-panel-heading-title {
    position: relative;
    padding-left: 20px;
}

.elementor-control-section_layout_dimensions .elementor-panel-heading-title::before {
    content: '📐';
    position: absolute;
    left: 0;
}

.elementor-control-section_playlist_styling .elementor-panel-heading-title::before {
    content: '📋';
    position: absolute;
    left: 0;
}

.elementor-control-section_season_selector_styling .elementor-panel-heading-title::before {
    content: '🏷️';
    position: absolute;
    left: 0;
}
