/* Enhanced Video Player Styles */
.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16/9;
}

.video-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    outline: none;
}

/* Hide default controls completely */
.video-container video::-webkit-media-controls {
    display: none !important;
}

.video-container video::-webkit-media-controls-panel {
    display: none !important;
}

.video-container video::-webkit-media-controls-play-button {
    display: none !important;
}

.video-container video::-webkit-media-controls-timeline {
    display: none !important;
}

.video-container video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.video-container video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.video-container video::-webkit-media-controls-mute-button {
    display: none !important;
}

.video-container video::-webkit-media-controls-toggle-closed-captions-button {
    display: none !important;
}

.video-container video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

/* Enhanced Controls */
.enhanced-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: all;
}

.enhanced-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Progress Container */
.progress-container {
    margin-bottom: 15px;
    position: relative;
}

.progress-bar {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    cursor: pointer;
    overflow: visible;
}

.progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #ff0000;
    border-radius: 3px;
    transition: width 0.1s linear;
    z-index: 1002;
}

.progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
    z-index: 1001;
}

.progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1003;
}

.progress-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.progress-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ff0000;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-slider::-moz-range-thumb {
    opacity: 1;
}

.time-display {
    position: absolute;
    top: -25px;
    right: 0;
    color: white;
    font-size: 12px;
    font-family: Arial, sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Preview Tooltip */
.preview-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.progress-bar:hover .preview-tooltip {
    opacity: 1;
}

/* Main Controls */
.controls-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.controls-left,
.controls-center,
.controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-center {
    gap: 5px;
}

/* Control Buttons */
.control-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-size: 16px;
    position: relative;
    z-index: 1001;
}

/* Play/Pause Button Specific */
.play-pause-btn {
    background: rgba(255,0,0,0.8);
    min-width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
}

.play-pause-btn:hover {
    background: rgba(255,0,0,1);
    transform: scale(1.1);
}

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

.control-btn:active {
    transform: scale(0.95);
}

.control-btn i {
    font-size: 16px;
}

/* Volume Control */
.volume-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Quality Selector */
.quality-selector,
.speed-selector,
.settings-selector {
    position: relative;
}

.quality-menu,
.speed-menu,
.settings-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(28,28,28,0.95);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
}

.quality-menu.visible,
.speed-menu.visible,
.settings-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option,
.speed-option,
.setting-option {
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.quality-option:hover,
.speed-option:hover,
.setting-option:hover {
    background: rgba(255,255,255,0.1);
}

.quality-option.active,
.speed-option.active {
    background: rgba(255,0,0,0.3);
    color: #ff0000;
}

.setting-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
}

.autoplay-toggle {
    margin: 0;
}

.quality-label,
.speed-label {
    font-size: 12px;
    font-weight: 500;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 20;
}

.loading-indicator .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auto-play Message */
.autoplay-message {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 15;
    backdrop-filter: blur(10px);
}

.autoplay-message span {
    font-size: 14px;
}

.autoplay-message .countdown {
    color: #ff0000;
    font-weight: bold;
}

.autoplay-message .cancel-autoplay {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.autoplay-message .cancel-autoplay:hover {
    background: rgba(255,255,255,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .enhanced-controls {
        padding: 15px;
    }
    
    .controls-main {
        gap: 10px;
    }
    
    .volume-slider,
    .volume-bar {
        width: 60px;
    }
    
    .control-btn {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
        padding: 6px;
    }
    
    .control-btn i {
        font-size: 14px;
    }
    
    .time-display {
        font-size: 11px;
    }
    
    .quality-menu,
    .speed-menu {
        min-width: 100px;
        font-size: 12px;
    }
    
    .quality-option,
    .speed-option {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .enhanced-controls {
        padding: 10px;
    }
    
    .controls-center {
        display: none;
    }
    
    .volume-container {
        display: none;
    }
    
    .volume-btn {
        display: flex;
    }
    
    .quality-label,
    .speed-label {
        display: none;
    }
    
    .autoplay-message {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .autoplay-message span {
        font-size: 12px;
    }
}

/* Picture-in-Picture Styles */
:picture-in-picture video {
    /* Video styles for picture-in-picture mode */
}

/* Fullscreen Styles */
:fullscreen .enhanced-controls {
    padding: 30px;
}

:fullscreen .control-btn {
    min-width: 40px;
    height: 40px;
    font-size: 18px;
}

:fullscreen .control-btn i {
    font-size: 18px;
}

/* Focus Styles */
.control-btn:focus,
.progress-slider:focus,
.volume-slider:focus {
    outline: 2px solid #ff0000;
    outline-offset: 2px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .enhanced-controls,
    .progress-filled,
    .volume-filled,
    .control-btn,
    .quality-menu,
    .speed-menu {
        transition: none;
    }
    
    .loading-indicator .spinner {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .enhanced-controls {
        background: rgba(0,0,0,0.95);
    }
    
    .control-btn:hover {
        background: rgba(255,255,255,0.3);
    }
    
    .progress-filled {
        background: #00ff00;
    }
    
    .control-btn:focus {
        outline: 3px solid #ffff00;
    }
}
