/* ========================================
   VIDEO CONTROLS - Premium Minimal Design
   Glassmorphism with Smooth Animations
   ======================================== */

/* Controls Overlay - Dark Glass Effect */
.video-controls-overlay {
    position: absolute;
    top: 0;
    /* Changed from bottom:0 to take full height */
    left: 0;
    width: 100%;
    height: 100%;
    /* Take up full area for centering loader */
    padding: 0;

    /* Premium Dark Gradient Background - Enhanced Bottom Shadow */
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.35) 8%,
            rgba(0, 0, 0, 0.15) 15%,
            transparent 20%);

    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Keep controls at bottom */
    box-sizing: border-box;
    z-index: 150;
    pointer-events: none;
    /* border-bottom-radius removed to match video-card's overflow:hidden clipping */
    /* overflow: hidden; Removed to prevent handle clipping */
}

/* Show on hover or when paused */
.video-card:hover .video-controls-overlay,
.video-card.paused .video-controls-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Control Bar Container */
.video-control-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: transparent;
    padding-bottom: 5px;
}

/* ========================================
   PROGRESS BAR - Premium Gold Design
   ======================================== */

.video-progress-container {
    width: calc(100% - 32px);
    /* Slightly wider for better reach */
    margin: 0 auto 4% auto;
    /* Further reduced from 8px to 4px */
    height: 4px !important;
    /* REFINED THICKNESS: 4PX */
    background: transparent !important;
    cursor: pointer;
    position: relative;
    transition: height 0.1s ease;
    padding: 0 !important;
    /* REMOVED PADDING - NO BUFFER */
    box-sizing: border-box;
    z-index: 10;
    border: none !important;
    box-shadow: none !important;
    border-radius: 100px !important;
    /* FULLY ROUNDED */
}

/* Unplayed Track - Clean 4px line */
.video-progress-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px !important;
    /* MATCH PARENT */
    background: rgba(255, 255, 255, 0.2) !important;
    z-index: 1;
    border: none !important;
    box-shadow: none !important;
    border-radius: 100px !important;
    /* FULLY ROUNDED */
}

.video-progress-container:hover {
    height: 6px !important;
    /* Subtle expansion */
}

.video-progress-container:hover::before {
    height: 6px !important;
}

/* Filled Progress - Solid Brand Purple (4px) */
.video-progress-filled {
    height: 4px !important;
    /* MATCH PARENT */
    background: #8B5CF6 !important;
    width: 0%;
    position: absolute;
    top: 0;
    transition: width 0.1s linear;
    z-index: 2;
    border: none !important;
    box-shadow: none !important;
    /* REMOVED SHADOW - NO THICKNESS */
    border-radius: 100px !important;
    /* FULLY ROUNDED */
}

.video-progress-container:hover .video-progress-filled {
    height: 6px !important;
}

/* DISABLE TRANSITION DURING SCRUBBING */
.video-progress-container.scrubbing .video-progress-filled,
.video-progress-container.scrubbing .video-progress-handle {
    transition: none !important;
}

/* Draggable Handle - Hidden */
.video-progress-handle {
    display: none;
    /* Completely hidden - user prefers clean look */
}

/* ========================================
   CONTROL BUTTONS - Minimal Premium
   ======================================== */

.video-controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 10px 16px 14px 16px;
    box-sizing: border-box;
    background: transparent;
    /* Removed dual shadow */
    /* border-bottom-left-radius: 20px; Removed as no bg */
    /* border-bottom-right-radius: 20px; Removed as no bg */
}

/* Left side controls group - Play button + Time */
.video-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Right side controls group - Mute button (Hidden per design) */
/* Right side controls group - Mute button (Restored) */
.video-controls-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    /* Pushes to the far right */
}

/* Restart Button - Matches Style */
.video-restart-btn {
    background: rgba(255, 255, 255, 0.12);
    /* Standard glass */
    border-color: rgba(255, 255, 255, 0.15);
}

.video-restart-btn:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.5);
    transform: rotate(-10deg) scale(1.1);
    /* Subtle counter-clockwise rotation on hover */
}

.video-restart-btn .restart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Mute/Unmute Button - Uses standard control-btn styling */
.video-unmute-btn {
    /* Inherits from .control-btn - no special background needed */
    pointer-events: auto !important;
}

.video-unmute-btn:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.5);
}

/* Ensure mute/unmute icons are centered */
.video-unmute-btn .mute-icon,
.video-unmute-btn .unmute-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.video-unmute-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* Individual Buttons - Glassmorphic */
.control-btn {
    /* Premium Glass Effect */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);

    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 8px;
    /* Slightly reduced radius for smaller size */
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    /* Ensure z-index works */
    z-index: 200;
    /* Float above everything */
    pointer-events: auto !important;
    /* FORCE ENABLE CLICKS */

    /* Smooth Transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    flex-shrink: 0;

    /* Subtle Shadow */
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-btn:hover {
    background: rgba(139, 92, 246, 0.22);
    /* Brand Purple with opacity */
    border-color: rgba(139, 92, 246, 0.4);
    /* Brand Purple border */
    transform: scale(1.08) translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 0 0 2px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: scale(0.98) translateY(0);
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.control-btn svg {
    pointer-events: none;
    fill: white;
    stroke: none;
    width: 14px;
    height: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Play/Pause Button - Slightly Larger */
.video-play-pause-btn {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    /* width/height removed to inherit 40px */
}

.video-play-pause-btn:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(139, 92, 246, 0.5);
}

/* Ensure spans are centered and take full space if needed, or just flex nicely */
.video-play-pause-btn .play-icon,
.video-play-pause-btn .pause-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.video-play-pause-btn svg {
    width: 14px;
    /* Scaled down slightly for better breathing room in 32px button */
    height: 14px;
    display: block;
    /* Removes inline spacing */
}

/* Mute/Unmute Button */
/* CSS Cleanup */

/* Time Display - Monospace Premium */
.video-time {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    white-space: nowrap;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.3px;
    min-width: 70px;
    flex-shrink: 0;
}

/* Spacer for Layout */
.controls-spacer {
    flex-grow: 1;
    min-width: 8px;
}

/* ========================================
   FULLSCREEN BUTTON - Added
   ======================================== */

.fullscreen-control {
    background: rgba(255, 255, 255, 0.12);
}

.fullscreen-control:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ========================================
   BUFFERING LOADER - Premium Spinner
   ======================================== */

.video-buffering-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #8B5CF6;
    /* Brand Purple */
    border-radius: 50%;
    animation: premium-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.video-card.buffering .video-buffering-loader {
    opacity: 1;
}

@keyframes premium-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========================================
   MOBILE OPTIMIZATION
   ======================================== */

@media (max-width: 768px) {
    .video-controls-row {
        padding: 9px 13px 13px 13px;
        gap: 8px;
    }

    .control-btn {
        width: 30px;
        height: 30px;
    }

    .control-btn svg {
        width: 13px;
        height: 13px;
    }

    .video-time {
        font-size: 11px;
        min-width: 65px;
    }
}

@media (max-width: 480px) {
    .video-controls-row {
        padding: 8px 10px 10px 10px;
        gap: 6px;
    }

    .control-btn {
        width: 29px;
        height: 29px;
    }

    .control-btn svg {
        width: 12px;
        height: 12px;
    }

    .video-time {
        font-size: 10px;
        min-width: 55px;
    }

    .video-progress-container {
        margin-bottom: 9px;
    }
}

/* ========================================
   REMOVED BUTTONS STYLING (Hidden)
   These buttons are removed from HTML but 
   keeping styles for backward compatibility
   ======================================== */

.restart-btn,
.caption-btn,
.quality-btn,
.quality-selector {
    display: none !important;
}