/* ==========================================
   CUSTOM VIDEO PLAYER STYLES
   Premium Netflix/YouTube-style player
   ========================================== */

.custom-video-player {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.custom-video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Controls Overlay */
.player-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0) 60%,
            rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}

.custom-video-player:hover .player-controls-overlay,
.player-controls-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Center Play Button */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: all;
}

.center-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: #fff;
}

.center-play-btn i {
    font-size: 32px;
    color: #000;
    margin-left: 4px;
    /* Optical centering for play icon */
}

.center-play-btn.playing {
    opacity: 0;
    pointer-events: none;
}

/* Bottom Controls Bar */
.controls-bar {
    padding: 0 20px 15px;
    pointer-events: all;
}

/* Progress Container */
.progress-container {
    margin-bottom: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.progress-bar-bg {
    position: relative;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: visible;
    transition: height 0.2s ease;
}

.progress-container:hover .progress-bar-bg {
    height: 7px;
}

.progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    width: 0;
}

.progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #e50914, #ff4d4d);
    border-radius: 3px;
    width: 0;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* Controls Row */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Control Buttons */
.control-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Skip Buttons */
#skipBackBtn,
#skipForwardBtn {
    position: relative;
}

.skip-text {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.volume-control:hover .volume-slider-container {
    width: 80px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Time Display */
.time-display {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 90px;
}

.time-separator {
    opacity: 0.6;
}

/* Speed Control */
.speed-control {
    position: relative;
}

.speed-text {
    font-size: 14px;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 0;
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.speed-control:hover .speed-menu,
.speed-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.speed-option {
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.speed-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.speed-option.active {
    background: rgba(229, 9, 20, 0.8);
    font-weight: 600;
}

/* Download Button Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

#downloadVideoBtn:hover {
    animation: pulse 1s infinite;
}

/* Fullscreen State */
.custom-video-player:fullscreen {
    border-radius: 0;
}

.custom-video-player:-webkit-full-screen {
    border-radius: 0;
}

.custom-video-player:-moz-full-screen {
    border-radius: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .controls-bar {
        padding: 0 12px 12px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .center-play-btn {
        width: 60px;
        height: 60px;
    }

    .center-play-btn i {
        font-size: 24px;
    }

    .time-display {
        font-size: 12px;
        min-width: 70px;
    }

    .volume-control:hover .volume-slider-container {
        width: 60px;
    }

    .volume-slider {
        width: 60px;
    }

    /* Hide some controls on very small screens */
    @media (max-width: 480px) {

        #skipBackBtn,
        #skipForwardBtn {
            display: none;
        }
    }
}

/* Loading State */
.custom-video-player.loading .center-play-btn {
    opacity: 0.5;
    pointer-events: none;
}

/* Paused State - show controls */
.custom-video-player.paused .player-controls-overlay {
    opacity: 1;
}

.custom-video-player.paused .center-play-btn {
    opacity: 1;
    pointer-events: all;
}