/**
 * Styles pour le popup vidéo
 * Gestion des différents ratios d'aspect
 */

.video-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-popup.active {
    opacity: 1;
    visibility: visible;
}

.video-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.video-popup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
}

.video-popup-close {
    position: absolute;
    top: 50px;
    right: 50px;
    background: none;
    border: none;
    border: 0;
    color: white;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
    transition: opacity 0.3s ease;
}


.video-popup-close:hover {
    opacity: 0.7;
}

.video-popup-content {
    width: 100%;
    height: 100%;
}

.video-popup-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
    text-align: center;
}

#video-popup-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Ratios d'aspect spécifiques */
.video-popup.ratio-16-9 #video-popup-iframe {
    aspect-ratio: 16/9;
}

.video-popup.ratio-4-3 #video-popup-iframe {
    aspect-ratio: 4/3;
}

.video-popup.ratio-21-9 #video-popup-iframe {
    aspect-ratio: 21/9;
}

/* Vidéos verticales (portrait) */
.video-popup.ratio-portrait #video-popup-iframe {
    aspect-ratio: 9/16;
    max-width: 50vh;
    margin: 0 auto;
}

/* Vidéos carrées */
.video-popup.ratio-square #video-popup-iframe {
    aspect-ratio: 1/1;
    max-width: 80vh;
    margin: 0 auto;
}

/* Ratios personnalisés */
.video-popup.ratio-custom #video-popup-iframe {
    /* Le ratio est appliqué directement via JavaScript */
}

/* Responsive */
@media (max-width: 768px) {
    .video-popup-container {
        width: 95%;
        max-height: 80vh;
        max-height: 96vh;
    }
    
    .video-popup-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .video-popup-container {
        width: 98%;
        max-height: 90vh;
    }
}

/* Animation d'entrée */
.video-popup.active .video-popup-content {
    animation: videoPopupIn 0.3s ease-out;
}

@keyframes videoPopupIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Styles pour les éléments déclencheurs de vidéo */
[data-video-url] {
    cursor: pointer;
    transition: transform 0.2s ease;
}

[data-video-url]:hover {
    transform: scale(1.02);
}

/* Amélioration de l'accessibilité */
.video-popup-close:focus {
    outline: 0 solid #fff;
    outline-offset: 0;
}

/* Prévention du scroll sur le body quand le popup est ouvert */
body.popup-open {
    overflow: hidden;
} 