/* W3C Compliant Video Player Styles */

.video-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
    outline: none;
}

.video-container video:focus {
    outline: 2px solid #f1b434;
    outline-offset: 2px;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.video-container:hover .video-controls,
.video-container:focus-within .video-controls {
    opacity: 1;
}

.video-controls button {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 16px;
}

.video-controls button:hover,
.video-controls button:focus {
    background: #fff;
    transform: scale(1.1);
    outline: 2px solid #f1b434;
    outline-offset: 2px;
}

.video-controls button:active {
    transform: scale(0.95);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    outline: none;
}

.progress-bar:hover,
.progress-bar:focus {
    background: rgba(255, 255, 255, 0.5);
}

.progress-fill {
    height: 100%;
    background: #f1b434;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.time-display {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-control {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-control::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-control:hover,
.volume-control:focus {
    background: rgba(255, 255, 255, 0.5);
}

/* Screen reader only content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus indicators for keyboard navigation */
.video-controls button:focus-visible,
.progress-bar:focus-visible,
.volume-control:focus-visible {
    outline: 2px solid #f1b434;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .video-controls button {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .progress-fill {
        background: #fff;
    }
    
    .time-display {
        color: #fff;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .video-controls,
    .progress-fill,
    .video-controls button {
        transition: none;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .video-controls {
        padding: 15px 10px 10px;
        gap: 8px;
    }
    
    .video-controls button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .time-display {
        font-size: 12px;
        min-width: 70px;
    }
    
    .volume-control {
        width: 50px;
    }
}

/* Fullscreen styles */
.video-container:fullscreen .video-controls {
    padding: 30px 20px 20px;
}

.video-container:fullscreen .video-controls button {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

/* Loading state */
.video-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

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

/* Error state */
.video-container.error::after {
    content: 'Video playback error';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(255, 0, 0, 0.8);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 5;
}

/* Accessibility improvements */
.video-container[aria-busy="true"] {
    pointer-events: none;
}

.video-container[aria-busy="true"] .video-controls {
    opacity: 0.5;
}

/* Keyboard navigation improvements */
.video-controls button:focus,
.progress-bar:focus,
.volume-control:focus {
    box-shadow: 0 0 0 2px #f1b434, 0 0 0 4px rgba(0, 124, 186, 0.3);
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .video-controls {
        opacity: 1;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    }
    
    .video-controls button {
        min-width: 44px;
        min-height: 44px;
    }
    
    .progress-bar {
        min-height: 8px;
    }
    
    .volume-control {
        min-height: 8px;
    }
}
