/* ==========================================================================
   1. LAYOUT SITO (WRAPPER & POSTER)
   ========================================================================== */
.mod-videoplayer-wrapper {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.video-poster-wrapper {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.video-poster-wrapper img {
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.video-poster-wrapper:hover img {
    transform: scale(1.08);
}

/* ==========================================================================
   2. PULSANTE PLAY CENTRATO SULL'ANTEPRIMA
   ========================================================================== */
.play-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; 
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    transition: background 0.4s ease;
}

.video-poster-wrapper:hover .play-overlay {
    background: rgba(0,0,0,0.4);
}

.play-button-outer {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.9);
}

.video-poster-wrapper:hover .play-button-outer {
    transform: scale(1.1);
    background: #ffffff;
}

.play-button-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent #111;
    margin-left: 5px; /* Offset ottico per centrare il triangolo */
}

/* ==========================================================================
   3. FIX PROTEZIONE DOWNLOAD BROWSER
   ========================================================================== */
video::-internal-media-controls-download-button {
    display:none !important;
}

video::-webkit-media-controls-enclosure {
    overflow:hidden !important;
}

video::-webkit-media-controls-panel {
    width: calc(100% + 30px) !important;
}

/* ==========================================================================
   4. STILE MAGNIFIC POPUP - RIMOZIONE TOTALE RETTANGOLO NERO
   ========================================================================== */

/* Rendiamo invisibile il contenitore esterno di Magnific Popup */
.mfp-video-custom .mfp-content,
.mfp-video-custom .mfp-inline-holder .mfp-content {
    background: transparent !important; 
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: auto !important;
    max-width: 95% !important; /* Margine di sicurezza sui lati in mobile */
    margin: 0 auto;
    line-height: 0;
}

/* Lo stile nero, l'ombra e i bordi vanno SOLO sul video */
.mfp-video-custom video {
    display: block;
    background: #000;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
    max-width: 100%;
    height: auto;
    max-height: 85vh; /* Evita che il video superi l'altezza dello schermo */
}

/* Fix per la X di chiusura: deve stare sopra al video senza creare bordi neri */
.mfp-video-custom .mfp-close {
    color: #FFF !important;
    right: 0px;
    top: -40px;
    opacity: 0.8;
    width: 44px;
    text-align: center;
}

.mfp-hide {
    display: none !important;
}

/* Stile per l'overlay di rotazione in mobile */
.rotation-tip {
    display: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    border-radius: 12px;
}

.rotation-icon {
    font-size: 50px;
    margin-bottom: 15px;
    animation: rotateLoop 2s infinite ease-in-out;
}

@keyframes rotateLoop {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

.rotation-tip p {
    font-size: 14px;
    margin: 0;
    padding: 0 15px;
    line-height: 1.4;
}