/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

:root {
    --vs-primary: #6366f1;
    --vs-overlay-bg: rgba(0, 0, 0, 0.9);
    --vs-glass-bg: rgba(20, 20, 30, 0.85);
    --vs-glass-border: rgba(255, 255, 255, 0.12);
}

/* ===== OVERLAY ===== */
.vs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--vs-overlay-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.vs-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MODAL — ottimizzato per video verticale 9:16 ===== */
.vs-modal {
    background: var(--vs-glass-bg);
    border: 1px solid var(--vs-glass-border);
    border-radius: 20px;
    padding: 16px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.92) translateY(24px);
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Altezza massima in funzione della viewport, con larghezza proporzionale 9:16 */
    height: calc(100vh - 80px);
    max-height: 860px;
    aspect-ratio: 9 / 16;
    width: auto;

    /* Fallback per browser senza aspect-ratio */
    max-width: 90vw;
}

.vs-overlay.active .vs-modal {
    transform: scale(1) translateY(0);
}

/* ===== CLOSE BUTTON ===== */
.vs-close-btn {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    background: var(--vs-primary);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
    transition: transform 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
}

.vs-close-btn:hover {
    transform: rotate(90deg) scale(1.15);
    background: #4f46e5;
}

/* ===== VIDEO CONTAINER — riempie tutto il modal ===== */
.vs-video-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.vs-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;  /* Riempie il contenitore mantenendo le proporzioni */
    display: block;
    border-radius: 12px;
}

.vs-video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ===== RESPONSIVE: su schermi piccoli usa tutta la larghezza ===== */
@media (max-width: 480px) {
    .vs-modal {
        height: auto;
        max-height: 90vh;
        width: calc(100vw - 24px);
        aspect-ratio: 9 / 16;
        max-width: none;
    }
}
