/* ESCplus Live Events Frontend Styles */

/* Global override for any white backgrounds in Shaka UI */



/* Scoped to the player: never restyle the theme's buttons */
.escplus-multi-window-wrapper .shaka-controls-container button:hover,
.escplus-multi-window-wrapper .shaka-controls-container button:focus,
.escplus-multi-window-wrapper .shaka-controls-container button:active {
    background: transparent;
    background-color: transparent;
}

:where(.escplus-multi-window-wrapper) .shaka-seek-bar-container {
    background: rgba(255, 255, 255, 0.1) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-range-element {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Custom TV Button Styling */
:where(.escplus-multi-window-wrapper) .shaka-tv-button {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    padding: 8px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 1) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-button:active {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(0.95) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-button svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* TV Menu Styling */
:where(.escplus-multi-window-wrapper) .shaka-tv-menu {
    background: rgba(28, 28, 28, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    min-width: 120px !important;
    overflow: hidden !important;
    backdrop-filter: blur(8px) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-menu-header {
    padding: 12px 16px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    border: none !important;
    background: transparent !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-menu-header:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 1) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-menu-header svg {
    stroke: currentColor !important;
    flex-shrink: 0 !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-menu-item {
    padding: 12px 16px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    font-family: inherit !important;
    border: none !important;
    background: transparent !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-menu-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 1) !important;
}

:where(.escplus-multi-window-wrapper) .shaka-tv-menu-item:active {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Stream header base styles - detailed styles in multi-window.css */

/* Volume slider styles */
:where(.escplus-multi-window-wrapper) #master-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

:where(.escplus-multi-window-wrapper) #master-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stream volume controls scrollbar */
:where(.escplus-multi-window-wrapper) #stream-volume-controls::-webkit-scrollbar {
    height: 4px;
}

:where(.escplus-multi-window-wrapper) #stream-volume-controls::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

:where(.escplus-multi-window-wrapper) #stream-volume-controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

:where(.escplus-multi-window-wrapper) #stream-volume-controls::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===================================================================
   Player Container Isolation - Prevent Overlapping Issues
   =================================================================== */

/* Isolate each stream container */
:where(.escplus-multi-window-wrapper) .escplus-live-stream,
:where(.escplus-multi-window-wrapper) .escplus-channel-stream {
    position: relative;
    z-index: 1;
    isolation: isolate;
    margin-bottom: 24px;
}

/* Ensure video players stack correctly */
:where(.escplus-multi-window-wrapper) .escplus-live-stream .stream-player,
:where(.escplus-multi-window-wrapper) .escplus-channel-stream .stream-player {
    position: relative;
    z-index: 1;
}

/* Ensure Shaka UI controls stay on top within their container */
:where(.escplus-multi-window-wrapper) .escplus-live-stream .shaka-controls-container,
:where(.escplus-multi-window-wrapper) .escplus-channel-stream .shaka-controls-container {
    z-index: 10 !important;
}

/* Volume bar should be above everything */
:where(.escplus-multi-window-wrapper) #escplus-volume-bar {
    z-index: 9999 !important;
    position: fixed !important;
}

/* Prevent grid items from overlapping during drag */
:where(.escplus-multi-window-wrapper) .sortable-item {
    position: relative;
    z-index: 2;
}

:where(.escplus-multi-window-wrapper) .sortable-item.dragging {
    z-index: 1000;
    opacity: 0.8;
}

/* Stream header stays above player */
:where(.escplus-multi-window-wrapper) .stream-header {
    position: relative;
    z-index: 5;
}

/* Ensure embed iframes are properly contained */
:where(.escplus-multi-window-wrapper) .escplus-live-stream iframe,
:where(.escplus-multi-window-wrapper) .escplus-channel-stream iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Fix potential layout issues with video elements */
:where(.escplus-multi-window-wrapper) .escplus-live-stream video,
:where(.escplus-multi-window-wrapper) .escplus-channel-stream video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

/* Prevent content overflow in containers */
:where(.escplus-multi-window-wrapper) .escplus-live-stream,
:where(.escplus-multi-window-wrapper) .escplus-channel-stream {
    overflow: hidden;
}

/* Fix for potential stacking context issues */
:where(.escplus-multi-window-wrapper) #escplus-live-interface {
    position: relative;
    z-index: 0;
}

:where(.escplus-multi-window-wrapper) #escplus-live-grid {
    position: relative;
    z-index: 1;
}





/* ================================================================



   Timeline Popup Styles


   ================================================================ */





:where(.escplus-multi-window-wrapper) .timeline-popup-overlay {


    position: fixed;


    top: 0;


    left: 0;


    width: 100%;


    height: 100%;


    background: rgba(0, 0, 0, 0.8);


    backdrop-filter: blur(4px);


    z-index: 10000;


    display: flex;


    align-items: center;


    justify-content: center;


    padding: 20px;


    box-sizing: border-box;


}





:where(.escplus-multi-window-wrapper) .timeline-popup-content {


    background: #1a1a1a;


    border-radius: 12px;


    border: 1px solid rgba(255, 255, 255, 0.1);


    max-width: 1200px;


    max-height: calc(80vh + var(--escplus-timeline-footer-ad-height, 120px));


    width: 100%;


    display: flex;


    flex-direction: column;


    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);


}





:where(.escplus-multi-window-wrapper) .timeline-popup-header {


    padding: 20px 24px;


    border-bottom: 1px solid rgba(255, 255, 255, 0.1);


    display: flex;


    align-items: center;


    justify-content: space-between;


}





:where(.escplus-multi-window-wrapper) .timeline-popup-header h2 {


    margin: 0;


    color: #fff;


    font-size: 24px;


    font-weight: 600;


    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;


}





:where(.escplus-multi-window-wrapper) .timeline-popup-close {


    background: transparent;


    border: none;


    color: rgba(255, 255, 255, 0.7);


    cursor: pointer;


    padding: 8px;


    border-radius: 6px;


    transition: all 0.2s;


}





:where(.escplus-multi-window-wrapper) .timeline-popup-close:hover {


    color: #fff;


    background: rgba(255, 255, 255, 0.1);


}





:where(.escplus-multi-window-wrapper) .timeline-popup-body {


    padding: 24px;


    display: flex;


    flex-direction: column;


    gap: 24px;


    overflow: hidden;


    flex: 1;


}





:where(.escplus-multi-window-wrapper) .timeline-grid {


    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;


    color: #fff;


    flex: 1;


    overflow: auto;


    min-height: 0;


}


:where(.escplus-multi-window-wrapper) .timeline-footer-ads {


    display: none;


    justify-content: center;


    width: 100%;


    flex-shrink: 0;


    align-items: stretch;


    flex: 0 0 var(--escplus-timeline-footer-ad-height, 120px);


}


:where(.escplus-multi-window-wrapper) .timeline-footer-ads.has-ads {


    display: flex;


}


:where(.escplus-multi-window-wrapper) .timeline-footer-ads .escplus-ad-slot {


    width: 100%;


    max-width: 900px;


    height: var(--escplus-timeline-footer-ad-height, 120px);


    min-height: var(--escplus-timeline-footer-ad-height, 120px);


    max-height: var(--escplus-timeline-footer-ad-height, 120px);


    display: flex;


    align-items: center;


    justify-content: center;


    overflow: hidden;


    box-sizing: border-box;


    position: relative;


}


:where(.escplus-multi-window-wrapper) .timeline-footer-ads .escplus-ad-slot > * {


    max-height: 100%;


    width: 100%;


}


:where(.escplus-multi-window-wrapper) .timeline-footer-ads .escplus-ad-slot iframe,


:where(.escplus-multi-window-wrapper) .timeline-footer-ads .escplus-ad-slot img {


    max-height: 100%;


    width: 100%;


    object-fit: contain;


    border: 0;


}

.escplus-ad-slot .ad-container {
    height: 100%;
    overflow: hidden;
}





/* Timeline Grid Layout */


:where(.escplus-multi-window-wrapper) .timeline-container {


    display: flex;


    flex-direction: column;


    min-height: 400px;


}





:where(.escplus-multi-window-wrapper) .timeline-main {


    display: flex;


    flex: 1;


    min-height: 300px;


}





:where(.escplus-multi-window-wrapper) .timeline-events {


    width: fit-content;


    min-width: 150px;


    max-width: none;


    flex-shrink: 0;


    border-right: 1px solid rgba(255, 255, 255, 0.1);


    padding-right: 16px;


}





:where(.escplus-multi-window-wrapper) .timeline-events-header {


    height: 52px;


    border-bottom: 1px solid rgba(255, 255, 255, 0.1);


    background: rgba(255, 255, 255, 0.02);


    display: flex;


    align-items: center;


    padding: 4px 12px;


    overflow: hidden;


}





:where(.escplus-multi-window-wrapper) .timeline-event-label {


    height: 52px;


    display: flex;


    flex-direction: column;


    justify-content: center;


    padding: 4px 12px;


    border-bottom: 1px solid rgba(255, 255, 255, 0.05);


    background: rgba(255, 255, 255, 0.02);


    overflow: hidden;


}





:where(.escplus-multi-window-wrapper) .timeline-event-title-line {


    display: flex;


    align-items: center;


    font-weight: 500;


    font-size: 13px;


    text-transform: uppercase;


    color: rgba(255, 255, 255, 0.9);


    overflow: hidden;


    text-overflow: ellipsis;


    white-space: nowrap;


}





:where(.escplus-multi-window-wrapper) .timeline-event-flag {


    width: 16px;


    height: 12px;


    margin-right: 6px;


    border-radius: 1px;


    flex-shrink: 0;


}





:where(.escplus-multi-window-wrapper) .timeline-event-country {


    color: rgba(255, 255, 255, 0.7);


    margin-right: 4px;


    flex-shrink: 0;


}





:where(.escplus-multi-window-wrapper) .timeline-event-title {


    overflow: hidden;


    text-overflow: ellipsis;


    white-space: nowrap;


    flex: 1;


}





:where(.escplus-multi-window-wrapper) .timeline-event-subtitle {


    color: rgba(255, 255, 255, 0.6);


    font-size: 11px;


    font-weight: 400;


    margin-left: 6px;


    flex-shrink: 0;


}





:where(.escplus-multi-window-wrapper) .timeline-event-meta-line {


    display: flex;


    align-items: center;


    font-size: 11px;


    color: rgba(255, 255, 255, 0.6);


    margin-top: 2px;


}





:where(.escplus-multi-window-wrapper) .timeline-event-times {


    font-weight: 400;


}





:where(.escplus-multi-window-wrapper) .timeline-event-no-stream {


    margin-left: 6px;


    color: #ffb4a9;


    font-size: 11px;


    font-weight: 600;


    line-height: 1.4;


    align-self: center;


}





:where(.escplus-multi-window-wrapper) .timeline-timegrid {


    flex: 1;


    position: relative;


    overflow-x: hidden;


    overflow-y: hidden;


    width: 95%;


}





:where(.escplus-multi-window-wrapper) .timeline-time-axis {


    height: 52px;


    border-bottom: 1px solid rgba(255, 255, 255, 0.1);


    position: relative;


    display: flex;


    align-items: center;


}





:where(.escplus-multi-window-wrapper) .timeline-hour-label {


    position: absolute;


    top: 50%;


    transform: translateX(-50%) translateY(-50%);


    font-size: 12px;


    color: rgba(255, 255, 255, 0.5);


}





:where(.escplus-multi-window-wrapper) .timeline-rows {


    position: relative;


}





:where(.escplus-multi-window-wrapper) .timeline-row {


    height: 52px;


    position: relative;


    border-bottom: 1px solid rgba(255, 255, 255, 0.05);


}





:where(.escplus-multi-window-wrapper) .timeline-event-bar {


    position: absolute;


    height: 32px;


    top: 10px;


    background: #4CAF50; /* Fallback color */


    border-radius: 6px;


    display: flex;


    align-items: center;


    padding: 0 8px;


    font-size: 12px;


    color: white;


    font-weight: 500;


    overflow: hidden;


    text-overflow: ellipsis;


    white-space: nowrap;


    border: 1px solid rgba(255, 255, 255, 0.2);


}





:where(.escplus-multi-window-wrapper) .timeline-event-bar:hover {


    transform: translateY(-2px);


    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);


}





:where(.escplus-multi-window-wrapper) .timeline-event-bar.special {


    background: #2196F3;


}





:where(.escplus-multi-window-wrapper) .timeline-event-bar.final {


    background: #FF9800;


}





:where(.escplus-multi-window-wrapper) .timeline-event-bar.no-stream {


    opacity: 0.6;


    background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.25) 0 6px, transparent 6px 12px);


}





:where(.escplus-multi-window-wrapper) .timeline-gridlines {


    position: absolute;


    top: 0;


    left: 0;


    right: 0;


    bottom: 0;


    pointer-events: none;


}





:where(.escplus-multi-window-wrapper) .timeline-gridline {


    position: absolute;


    top: 52px;


    bottom: 0;


    width: 1px;


    background: rgba(255, 255, 255, 0.1);


}





:where(.escplus-multi-window-wrapper) .timeline-gridline.hour {


    background: rgba(255, 255, 255, 0.2);


}





:where(.escplus-multi-window-wrapper) .timeline-no-events {


    text-align: center;


    padding: 60px 20px;


    color: rgba(255, 255, 255, 0.5);


    font-size: 16px;


}





/* Responsive Design */


@media (max-width: 800px) {


    :where(.escplus-multi-window-wrapper) .timeline-events-header .timeline-event-title-line {


        white-space: normal;


        flex-wrap: wrap;


        height: auto;


        min-height: 1.2em;


    }


}





@media (max-width: 768px) {


    :where(.escplus-multi-window-wrapper) .timeline-popup-content {


        max-width: 95vw;


        max-height: 95vh;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-popup-header {


        padding: 16px 20px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-popup-header h2 {


        font-size: 20px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-popup-body {


        padding: 20px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-events {


        width: fit-content;


        min-width: 120px;


        max-width: none;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-event-label {


        padding: 2px 8px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-event-title-line {


        font-size: 11px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-event-flag {


        width: 14px;


        height: 10px;


        margin-right: 4px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-event-subtitle {


        font-size: 10px;


        margin-left: 4px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-event-meta-line {


        font-size: 10px;


    }


    


    :where(.escplus-multi-window-wrapper) .timeline-event-bar {


        font-size: 11px;


        padding: 0 6px;


        height: 28px;


        top: 12px;


    }
}

/* No Visible Streams Placeholder */
:where(.escplus-multi-window-wrapper) .no-visible-streams-placeholder {
    width: 100%;
    height: calc(100dvh - 300px); /* Same height as grid */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 8px;
}

:where(.escplus-multi-window-wrapper) .placeholder-content {
    text-align: center;
    color: #fff;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

:where(.escplus-multi-window-wrapper) .placeholder-header {
    margin-bottom: 2rem;
}

:where(.escplus-multi-window-wrapper) .placeholder-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

:where(.escplus-multi-window-wrapper) .placeholder-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

:where(.escplus-multi-window-wrapper) .btn-show-timetable {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(76, 175, 80, 0.15);
    border: 1.5px solid rgba(76, 175, 80, 0.3);
    color: rgba(76, 175, 80, 1);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

:where(.escplus-multi-window-wrapper) .btn-show-timetable:hover {
    background: rgba(76, 175, 80, 0.25);
    border-color: rgba(76, 175, 80, 0.5);
    transform: translateY(-1px);
}

:where(.escplus-multi-window-wrapper) .btn-show-timetable svg {
    width: 16px;
    height: 16px;
}

:where(.escplus-multi-window-wrapper) .placeholder-timetable {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    overflow: hidden;
}

:where(.escplus-multi-window-wrapper) .placeholder-timetable h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

:where(.escplus-multi-window-wrapper) .timeline-grid {
    flex: 1;
    overflow-y: auto;
    color: #fff;
}

/* Simple Timetable for Placeholder */
:where(.escplus-multi-window-wrapper) .simple-timetable {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

:where(.escplus-multi-window-wrapper) .simple-timetable .stream-header {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-height: 60px;
    overflow: hidden;
    border-left: 3px solid #007cba;
}

:where(.escplus-multi-window-wrapper) .simple-timetable .stream-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

:where(.escplus-multi-window-wrapper) .simple-timetable .stream-meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #ccc;
}

:where(.escplus-multi-window-wrapper) .simple-timetable .event-subtitle {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

/* Removed simple-event styles as now using stream-header classes */

/* Mobile responsive styles for no visible streams placeholder */
@media (max-width: 768px) {
    :where(.escplus-multi-window-wrapper) .no-visible-streams-placeholder {
        height: calc(100dvh - 120px); /* Adjust for mobile */
        border-radius: 0;
    }
    
    :where(.escplus-multi-window-wrapper) .placeholder-content {
        padding: 1rem;
    }
    
    :where(.escplus-multi-window-wrapper) .btn-show-hidden,
    :where(.escplus-multi-window-wrapper) .btn-show-timetable {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    :where(.escplus-multi-window-wrapper) .placeholder-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    :where(.escplus-multi-window-wrapper) .placeholder-timetable {
        padding: 1rem;
    }
    
    :where(.escplus-multi-window-wrapper) .placeholder-timetable h4 {
        font-size: 1.1rem;
    }
    
    :where(.escplus-multi-window-wrapper) .simple-event {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    :where(.escplus-multi-window-wrapper) .simple-event-time {
        min-width: auto;
        font-size: 0.9rem;
    }
}

/* Retry Screen Styles */
@keyframes escplus-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes escplus-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes escplus-float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(120deg); }
    66% { transform: translateY(5px) rotate(240deg); }
}

/* Covers the player area of its tile while a stream is (re)connecting */
:where(.escplus-multi-window-wrapper) .escplus-retry-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow: hidden;
}

:where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-content-overlay {
    transition: all 0.3s ease;
}

:where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: escplus-spin 1s linear infinite;
    margin: 0 auto 16px auto;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

:where(.escplus-multi-window-wrapper) .escplus-retry-screen .status-dot {
    animation: escplus-pulse 2s ease-in-out infinite;
}

:where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-attempts {
    font-size: 12px;
    opacity: 0.7;
    color: #a0a0a0;
    margin-bottom: 8px;
}

:where(.escplus-multi-window-wrapper) .escplus-retry-screen .time-remaining {
    font-size: 16px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 8px;
}

/* Ensure video stays below retry screen */
:where(.escplus-multi-window-wrapper) [data-escplus-player-container] video[data-escplus-player] {
    position: relative;
    z-index: 1;
}

/* Responsive design for retry screen */
@media (max-width: 768px) {
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-content-overlay {
        padding: 20px;
        max-width: 95%;
        border-radius: 12px;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .event-title {
        font-size: 16px !important;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen h3 {
        font-size: 18px !important;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-spinner {
        width: 48px !important;
        height: 48px !important;
    }
}

@media (max-width: 480px) {
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-content-overlay {
        padding: 16px;
        max-width: 98%;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .event-title {
        font-size: 14px !important;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen h3 {
        font-size: 16px !important;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-spinner {
        width: 40px !important;
        height: 40px !important;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .time-remaining {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-content-overlay {
        padding: 12px;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .event-info {
        margin-bottom: 16px !important;
    }

    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-main-section {
        margin-bottom: 16px !important;
    }
}
/* Compact retry/error screens in small tiles (based on the tile width, not the viewport) */
.escplus-multi-window-wrapper [data-escplus-player-container] {
    container-type: inline-size;
    container-name: escplus-tile;
}

@container escplus-tile (max-width: 480px) {
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-event-info,
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-bg-particles {
        display: none !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-content-overlay {
        padding: 12px !important;
        border-radius: 10px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-status-indicator {
        margin-bottom: 8px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-main-section {
        margin-bottom: 0 !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .retry-spinner {
        width: 32px !important;
        height: 32px !important;
        border-width: 3px !important;
        margin-bottom: 8px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen h3 {
        font-size: 15px !important;
        margin-bottom: 4px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen p {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-retry-screen .time-remaining {
        font-size: 13px !important;
        padding: 4px 10px !important;
        margin-top: 4px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-error-message {
        padding: 12px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-error-message h3 {
        font-size: 15px !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-error-message div[aria-hidden="true"] {
        font-size: 28px !important;
        margin-bottom: 8px !important;
    }
}


/* Narrow theme content columns: give the streams/schedule the full width instead of side ads.
   (Containers are the stage and the placeholder, which have no fixed-position descendants.) */
:where(.escplus-multi-window-wrapper) .escplus-layout-stage {
    container-type: inline-size;
    container-name: escplus-stage;
}

@container escplus-stage (max-width: 860px) {
    :where(.escplus-multi-window-wrapper) .escplus-layout-stage.has-side-ad .layout-side-ad {
        display: none !important;
    }
    :where(.escplus-multi-window-wrapper) .escplus-layout-stage.has-side-ad #escplus-live-grid {
        max-width: 100%;
        flex: 1 1 auto;
    }
}

:where(.escplus-multi-window-wrapper) .no-visible-streams-placeholder {
    container-type: inline-size;
    container-name: escplus-placeholder;
}

@container escplus-placeholder (max-width: 900px) {
    :where(.escplus-multi-window-wrapper) .placeholder-timetable-layout,
    :where(.escplus-multi-window-wrapper) .placeholder-timetable-layout.has-side-ads {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    :where(.escplus-multi-window-wrapper) .placeholder-side-ads {
        display: none !important;
    }
}
