* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
}

.container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gif-pages {
    width: 100%;
    height: 100%;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
}

.page.active {
    display: flex;
}

.gif-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gif-container video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer; /* Cambia il cursore per indicare che è cliccabile */
}

/* Pulsanti di navigazione - Solo simboli senza sfondo */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.5);
    font-size: 4vw; /* Dimensione in percentuale della viewport width */
    cursor: pointer;
    z-index: 1000;
    padding: 0;
    margin: 0;
    transition: color 0.3s ease;
    font-weight: bold;
    line-height: 1;
}

.nav-btn:hover {
    color: rgba(0, 0, 0, 1);
}

.prev-btn {
    left: 1%;
}

.next-btn {
    right: 1%;
}

/* Limita la dimensione massima dei pulsanti */
@media (min-width: 1200px) {
    .nav-btn {
        font-size: 40px; /* Dimensione massima */
    }
}

/* Media query per dispositivi mobili */
@media (max-width: 768px) {
    .nav-btn {
        font-size: 5vw;
    }
}

/* Media query per dispositivi molto piccoli */
@media (max-width: 480px) {
    .nav-btn {
        font-size: 6vw;
    }
    
    .prev-btn {
        left: 2%;
    }
    
    .next-btn {
        right: 2%;
    }
}

/* Ottimizzazione per orientamento landscape */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-btn {
        font-size: 4vh; /* Usa viewport height in landscape */
    }
}