/* -------- RESET & BODY -------- */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden; /* Empêche le débordement du contenu */
}

/* -------- CONTAINER -------- */
.container {
    width: 90%;        /* Largeur du conteneur */
    max-width: 90vh;   /* Limite la largeur à 90% de la hauteur de l'écran */
    max-height: 90vh;  /* Limite la hauteur à 90% de la hauteur de l'écran */
}

/* -------- VIDEO CONTAINER -------- */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Ratio 1:1 pour la vidéo */
    box-shadow: 0 0 5px #ccc;
}

video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(1px 1px);
}

/* -------- LOADER -------- */
.loader {
    border: 5px solid #f3f3f3;  /* Couleur de fond */
    border-top: 5px solid #3498db; /* Couleur du loader */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0%   { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* -------- PLAY BUTTON -------- */
#play-button {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    
  
}

/* -------- REPLAY CONTAINER -------- */
#replay-container {
    display: none;
    position: absolute;
    bottom: 30px;
    /* right: 20px; */
    cursor: pointer;
    z-index: 9999;
    left: 50%;
    transform: translateX(-50%);
}

#replay-button {
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* -------- OVERLAY DE FIN (LAST-FRAME) -------- */
.end-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999; 
    display: flex; 
    justify-content: center; 
    align-items: center;

    /* Par défaut, masqué : */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    background-color: #fff;
}

.end-frame.show {
    opacity: 1;
    visibility: visible;
}

.end-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #fff;
}


/* -------- MEDIA QUERIES -------- */

/* Mode paysage */
@media screen and (orientation: landscape) {
    .container {
        height: 90vh;
        width: 90vh;
    }

    video {
        width: 100%;
        height: auto;
    }
}

/* Appareils en mode portrait : on peut ajuster la taille du bouton Replay, etc. */
@media screen and (max-aspect-ratio: 1/1) {
    #replay-button {
        font-size: 20px;
        padding: 20px 25px;
        transform: scale(1.3);
    }
}

/* Haute résolution (Retina, etc.) */
@media screen and (min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi) {
    #replay-button {
        font-size: 20px;
        padding: 20px 25px;
        transform: scale(1.5);
    }
}
