/* Reset for premium Netflix overlay */
.video-player-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #000 !important;
    z-index: 999999 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

#video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Aspect Ratio States - Zoom / Fill / Fit */
#video-player video.fit-contain {
    object-fit: contain !important;
}

#video-player video.fit-cover {
    object-fit: cover !important;
}

#video-player video.fit-fill {
    object-fit: fill !important;
}

/* Soft Rotate helper for devices without Orientation API support */
#video-player.soft-rotate {
    transform: rotate(90deg);
    width: 100vh !important;
    height: 100vw !important;
}

/* Tap trigger overlays */
.video-click-target {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
    background: transparent;
}

/* Double Tap Ripple Effects */
.double-tap-ripple {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.double-tap-ripple.left {
    left: 0;
    border-radius: 0 100px 100px 0;
}

.double-tap-ripple.right {
    right: 0;
    border-radius: 100px 0 0 100px;
}

.double-tap-ripple.active {
    opacity: 1;
    animation: pulse-ripple 0.6s ease;
}

.ripple-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

@keyframes pulse-ripple {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Perfectly Centered Rotating Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    border-top-color: #fff;
    animation: player-spin 0.8s linear infinite;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

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

/* Translucent Dropdown Option Panels */
.mini-panel {
    position: absolute;
    bottom: 95px;
    right: 30px;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 8px;
    width: 210px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    z-index: 30;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.mini-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#episodes-panel {
    max-height: 220px;
    overflow-y: auto;
}

.panel-option {
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.panel-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.panel-option.active {
    background: rgba(229, 9, 20, 0.95);
    color: #fff;
    font-weight: 600;
}

/* Top Header Bar with responsive row layout wrapper */
.player-header {
    position: absolute;
    top: 15px; /* moved down slightly from top */
    left: 0;
    right: 0;
    min-height: 100px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 15px 32px;
    display: flex;
    align-items: center;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 20;
}

.player-header.hide {
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
}

.header-content-wrapper {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
}

/* Back button with solid circular translucent background from screenshot */
.header-back-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    font-size: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    margin-right: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.header-back-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05);
}

.header-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.video-title {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.video-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
}

/* Responsive top pill controls - visible on all sizes now */
.header-pills {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.03);
}

/* Centered HUD playback controls */
.centered-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    z-index: 15;
    transition: opacity 0.4s ease;
}

.centered-controls.hide {
    opacity: 0;
    pointer-events: none;
}

.center-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.center-btn i {
    font-size: 20px;
}

.skip-num {
    font-size: 9px;
    font-weight: 700;
    margin-top: 1px;
    font-family: 'Inter', sans-serif;
}

.center-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.centered-controls .play-button {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.centered-controls .play-button:hover {
    background: rgba(229, 9, 20, 0.95);
    border-color: #e50914;
    transform: scale(1.1);
}

.centered-controls .play-button i {
    font-size: 32px;
    margin-left: 4px;
}

/* Bottom Controls Overlay Panel */
.controls {
    position: absolute;
    bottom: 25px; /* moved up from bottom to eliminate mobile scrolling completely */
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 20px 32px 20px 32px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 20;
}

.controls.hide {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.timeline-row {
    width: 100%;
    margin-bottom: 16px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s;
}

.progress-container:hover {
    height: 8px;
}

#buffer-bar {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    width: 0;
    z-index: 1;
}

#seek-bar {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    z-index: 2;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

#seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e50914;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover #seek-bar::-webkit-slider-thumb {
    opacity: 1;
}

.progress-slider {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #e50914;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    cursor: pointer;
    transition: opacity 0.2s;
    opacity: 0;
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.5);
}

.progress-container:hover .progress-slider {
    opacity: 1;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left {
    display: flex;
    align-items: center;
}

.time-display {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* Professional Right aligned controls */
.controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.circle-ctrl-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s, transform 0.2s;
}

.circle-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Playback Toast */
.player-toast {
    position: absolute;
    bottom: 130px;
    left: 32px;
    background: rgba(18, 18, 18, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    z-index: 50;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Fullscreen settings override */
#video-player.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999;
}

/* Responsive Adaptive CSS for Mobiles & Tablets */
@media (max-width: 1024px) {
    .centered-controls {
        gap: 40px;
    }
    
    .centered-controls .play-button {
        width: 76px;
        height: 76px;
    }
}

@media (max-width: 768px) {
    .player-header {
        padding: 16px 20px;
        min-height: 110px;
    }
    
    /* Layout wrapping for mobile viewports - places pills underneath title */
    .header-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-back-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
        margin-right: 12px;
    }
    
    .video-title {
        font-size: 17px;
    }
    
    .video-subtitle {
        font-size: 12px;
    }
    
    .header-pills {
        max-width: 100%;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }
    
    .header-pills::-webkit-scrollbar {
        display: none;
    }
    
    .pill-btn {
        padding: 6px 12px;
        font-size: 11px;
        gap: 6px;
    }
    
    .controls {
        padding: 16px 20px 24px 20px;
    }
    
    .time-display {
        font-size: 13px;
    }
    
    .circle-ctrl-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .centered-controls {
        gap: 30px;
    }
    
    .centered-controls .play-button {
        width: 68px;
        height: 68px;
    }
    
    .centered-controls .play-button i {
        font-size: 26px;
    }
    
    .center-btn {
        width: 48px;
        height: 48px;
    }
    
    .center-btn i {
        font-size: 16px;
    }
    
    .mini-panel {
        bottom: 85px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .video-title {
        font-size: 15px;
    }
    
    .video-subtitle {
        font-size: 11px;
    }
    
    .progress-container {
        height: 5px;
    }
    
    .time-display {
        font-size: 12px;
    }
    
    .circle-ctrl-btn {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* Big screens layout adjustments (Android TV & Large Desktops) */
@media (min-width: 1200px) {
    .header-pills {
        gap: 24px !important; /* Larger gap to prevent overlaps on TV */
    }
    .centered-controls {
        gap: 100px !important; /* Comfortably spaced center buttons */
    }
    .controls-right {
        gap: 26px !important; /* Wide gaps for TV remotes and cursor navigation */
    }
}
