/* Video Overlay - Interface plein écran pour la lecture vidéo */

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: none;
}

.video-overlay.visible {
    opacity: 1;
}

/* Container vidéo */
.video-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Overlay des contrôles */
.video-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, 0) 80%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.video-controls-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Header de l'overlay */
.video-overlay-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2rem;
    gap: 1rem;
}

.close-video-btn {
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.close-video-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.05);
}

.close-video-btn svg {
    width: 24px;
    height: 24px;
}

.video-info {
    flex: 1;
    text-align: center;
    color: white;
    margin: 0 1rem;
}

.video-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.video-category {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.video-quality-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.video-quality-indicator.hd {
    background: rgba(16, 185, 129, 0.9);
}

.video-quality-indicator.fhd {
    background: rgba(37, 99, 235, 0.9);
}

.video-quality-indicator.uhd,
.video-quality-indicator.4k {
    background: rgba(245, 158, 11, 0.9);
}

/* Footer de l'overlay */
.video-overlay-footer {
    padding: 1rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Barre de progression */
.video-progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.video-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.video-progress-filled {
    height: 100%;
    background: var(--primary, #2563eb);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.video-time-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    min-width: 100px;
    justify-content: center;
}

/* Contrôles vidéo */
.video-overlay-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.video-control-btn {
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.video-control-btn:hover {
    background: rgba(37, 99, 235, 0.9);
    transform: scale(1.05);
}

.video-control-btn svg {
    width: 20px;
    height: 20px;
}

.play-pause-btn {
    width: 56px;
    height: 56px;
}

.play-pause-btn svg {
    width: 24px;
    height: 24px;
}

/* Contrôle du volume */
.video-volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.video-volume-slider {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    appearance: none;
}

.video-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.video-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.video-volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Indicateur de chargement */
.video-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-loading-indicator.visible {
    opacity: 1;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-loading-indicator p {
    margin: 0;
    font-size: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-overlay-header {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .close-video-btn {
        width: 40px;
        height: 40px;
    }
    
    .close-video-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .video-title {
        font-size: 1.25rem;
    }
    
    .video-category {
        font-size: 0.875rem;
    }
    
    .video-quality-indicator {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .video-overlay-footer {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .video-overlay-controls {
        gap: 1rem;
    }
    
    .video-control-btn {
        width: 40px;
        height: 40px;
    }
    
    .video-control-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .play-pause-btn {
        width: 48px;
        height: 48px;
    }
    
    .play-pause-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .video-volume-slider {
        width: 80px;
    }
    
    .video-time-display {
        font-size: 0.75rem;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .video-overlay-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    
    .close-video-btn {
        align-self: flex-end;
    }
    
    .video-info {
        margin: 0;
    }
    
    .video-overlay-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .video-volume-control {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    .video-volume-slider {
        width: 120px;
    }
}

/* Animations d'entrée/sortie */
@keyframes fadeInOverlay {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutOverlay {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.video-overlay.entering {
    animation: fadeInOverlay 0.3s ease-out;
}

.video-overlay.exiting {
    animation: fadeOutOverlay 0.3s ease-in;
}

/* États de focus pour l'accessibilité */
.video-control-btn:focus,
.close-video-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.video-volume-slider:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Amélioration de la visibilité des contrôles */
.video-controls-overlay:hover {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0) 25%,
        rgba(0, 0, 0, 0) 75%,
        rgba(0, 0, 0, 0.8) 100%
    );
}

/* Styles pour les flux en direct (pas de barre de progression) */
.video-overlay.live-stream .video-progress-container {
    display: none;
}

.video-overlay.live-stream .video-overlay-footer {
    padding-top: 2rem;
}

/* Indicateur de flux en direct */
.live-indicator {
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Amélioration de l'accessibilité */
.video-overlay:focus-within .video-controls-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Transition fluide pour les contrôles */
.video-controls-overlay * {
    transition: all 0.2s ease;
}

/* Effet de survol pour les éléments interactifs */
.video-progress-bar:hover {
    transform: scaleY(1.5);
    transition: transform 0.2s ease;
}

.video-progress-bar:hover .video-progress-filled {
    background: var(--primary-light, #3b82f6);
}

/* Styles pour les appareils tactiles */
@media (hover: none) and (pointer: coarse) {
    .video-controls-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    
    .video-control-btn {
        width: 52px;
        height: 52px;
    }
    
    .play-pause-btn {
        width: 60px;
        height: 60px;
    }
    
    .video-volume-slider {
        height: 8px;
    }
    
    .video-progress-bar {
        height: 8px;
    }
}