/* ESCplus Live Events Frontend Styles */

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



button:hover, button:focus, button:active {
    background:transparent;
background-color: transparent;

}

.shaka-seek-bar-container {
    background: rgba(255, 255, 255, 0.1) !important;
}

.shaka-range-element {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Custom TV Button Styling */
.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;
}

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

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

.shaka-tv-button svg {
    width: 20px !important;
    height: 20px !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* TV Menu Styling */
.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;
}

.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;
}

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

.shaka-tv-menu-header svg {
    stroke: currentColor !important;
    flex-shrink: 0 !important;
}

.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;
}

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

.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 */
#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);
}

#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 */
#stream-volume-controls::-webkit-scrollbar {
    height: 4px;
}

#stream-volume-controls::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#stream-volume-controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

#stream-volume-controls::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

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

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

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

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

/* Volume bar should be above everything */
#escplus-volume-bar {
    z-index: 9999 !important;
    position: fixed !important;
}

/* Prevent grid items from overlapping during drag */
.sortable-item {
    position: relative;
    z-index: 2;
}

.sortable-item.dragging {
    z-index: 1000;
    opacity: 0.8;
}

/* Stream header stays above player */
.stream-header {
    position: relative;
    z-index: 5;
}

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

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

/* Prevent content overflow in containers */
.escplus-live-stream,
.escplus-channel-stream {
    overflow: hidden;
}

/* Fix for potential stacking context issues */
#escplus-live-interface {
    position: relative;
    z-index: 0;
}

#escplus-live-grid {
    position: relative;
    z-index: 1;
}

/* Hide Twitch player top-bar - applied globally to catch iframe content */
.top-bar,
iframe .top-bar,
div .top-bar,
* .top-bar {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}



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



   Timeline Popup Styles


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





.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;


}





.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);


}





.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;


}





.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;


}





.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;


}





.timeline-popup-close:hover {


    color: #fff;


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


}





.timeline-popup-body {


    padding: 24px;


    display: flex;


    flex-direction: column;


    gap: 24px;


    overflow: hidden;


    flex: 1;


}





.timeline-grid {


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


    color: #fff;


    flex: 1;


    overflow: auto;


    min-height: 0;


}


.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);


}


.timeline-footer-ads.has-ads {


    display: flex;


}


.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;


}


.timeline-footer-ads .escplus-ad-slot > * {


    max-height: 100%;


    width: 100%;


}


.timeline-footer-ads .escplus-ad-slot iframe,


.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 */


.timeline-container {


    display: flex;


    flex-direction: column;


    min-height: 400px;


}





.timeline-main {


    display: flex;


    flex: 1;


    min-height: 300px;


}





.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;


}





.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;


}





.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;


}





.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;


}





.timeline-event-flag {


    width: 16px;


    height: 12px;


    margin-right: 6px;


    border-radius: 1px;


    flex-shrink: 0;


}





.timeline-event-country {


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


    margin-right: 4px;


    flex-shrink: 0;


}





.timeline-event-title {


    overflow: hidden;


    text-overflow: ellipsis;


    white-space: nowrap;


    flex: 1;


}





.timeline-event-subtitle {


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


    font-size: 11px;


    font-weight: 400;


    margin-left: 6px;


    flex-shrink: 0;


}





.timeline-event-meta-line {


    display: flex;


    align-items: center;


    font-size: 11px;


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


    margin-top: 2px;


}





.timeline-event-times {


    font-weight: 400;


}





.timeline-timegrid {


    flex: 1;


    position: relative;


    overflow-x: hidden;


    overflow-y: hidden;


    width: 95%;


}





.timeline-time-axis {


    height: 52px;


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


    position: relative;


    display: flex;


    align-items: center;


}





.timeline-hour-label {


    position: absolute;


    top: 50%;


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


    font-size: 12px;


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


}





.timeline-rows {


    position: relative;


}





.timeline-row {


    height: 52px;


    position: relative;


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


}





.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);


}





.timeline-event-bar:hover {


    transform: translateY(-2px);


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


}





.timeline-event-bar.special {


    background: #2196F3;


}





.timeline-event-bar.final {


    background: #FF9800;


}





.timeline-gridlines {


    position: absolute;


    top: 0;


    left: 0;


    right: 0;


    bottom: 0;


    pointer-events: none;


}





.timeline-gridline {


    position: absolute;


    top: 52px;


    bottom: 0;


    width: 1px;


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


}





.timeline-gridline.hour {


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


}





.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) {


    .timeline-events-header .timeline-event-title-line {


        white-space: normal;


        flex-wrap: wrap;


        height: auto;


        min-height: 1.2em;


    }


}





@media (max-width: 768px) {


    .timeline-popup-content {


        max-width: 95vw;


        max-height: 95vh;


    }


    


    .timeline-popup-header {


        padding: 16px 20px;


    }


    


    .timeline-popup-header h2 {


        font-size: 20px;


    }


    


    .timeline-popup-body {


        padding: 20px;


    }


    


    .timeline-events {


        width: fit-content;


        min-width: 120px;


        max-width: none;


    }


    


    .timeline-event-label {


        padding: 2px 8px;


    }


    


    .timeline-event-title-line {


        font-size: 11px;


    }


    


    .timeline-event-flag {


        width: 14px;


        height: 10px;


        margin-right: 4px;


    }


    


    .timeline-event-subtitle {


        font-size: 10px;


        margin-left: 4px;


    }


    


    .timeline-event-meta-line {


        font-size: 10px;


    }


    


    .timeline-event-bar {


        font-size: 11px;


        padding: 0 6px;


        height: 28px;


        top: 12px;


    }
}

/* No Visible Streams Placeholder */
.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;
}

.placeholder-content {
    text-align: center;
    color: #fff;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.placeholder-header {
    margin-bottom: 2rem;
}

.placeholder-header h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.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);
}

.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);
}

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

.btn-show-timetable svg {
    width: 16px;
    height: 16px;
}

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

.placeholder-timetable h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.timeline-grid {
    flex: 1;
    overflow-y: auto;
    color: #fff;
}

/* Simple Timetable for Placeholder */
.simple-timetable {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.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;
}

.simple-timetable .stream-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.simple-timetable .stream-meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: #ccc;
}

.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) {
    .no-visible-streams-placeholder {
        height: calc(100dvh - 120px); /* Adjust for mobile */
        border-radius: 0;
    }
    
    .placeholder-content {
        padding: 1rem;
    }
    
    .btn-show-hidden,
    .btn-show-timetable {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .placeholder-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .placeholder-timetable {
        padding: 1rem;
    }
    
    .placeholder-timetable h4 {
        font-size: 1.1rem;
    }
    
    .simple-event {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .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 pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

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

.escplus-retry-screen {
    position: relative;
    top: -100%;
    z-index: 9999;
    overflow: hidden;
}

.escplus-retry-screen .retry-content-overlay {
    transition: all 0.3s ease;
}

.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);
}

.escplus-retry-screen .status-dot {
    animation: pulse 2s ease-in-out infinite;
}

.escplus-retry-screen .retry-attempts {
    font-size: 12px;
    opacity: 0.7;
    color: #a0a0a0;
    margin-bottom: 8px;
}

.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 */
[data-escplus-player-container] video[data-escplus-player] {
    position: relative;
    z-index: 1;
}

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

    .escplus-retry-screen .event-title {
        font-size: 16px !important;
    }

    .escplus-retry-screen h3 {
        font-size: 18px !important;
    }

    .escplus-retry-screen .retry-spinner {
        width: 48px !important;
        height: 48px !important;
    }
}

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

    .escplus-retry-screen .event-title {
        font-size: 14px !important;
    }

    .escplus-retry-screen h3 {
        font-size: 16px !important;
    }

    .escplus-retry-screen .retry-spinner {
        width: 40px !important;
        height: 40px !important;
    }

    .escplus-retry-screen .time-remaining {
        font-size: 14px !important;
        padding: 6px 12px !important;
    }
}

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

    .escplus-retry-screen .event-info {
        margin-bottom: 16px !important;
    }

    .escplus-retry-screen .retry-main-section {
        margin-bottom: 16px !important;
    }
}