/*
    GitHub URL: https://github.com/gucastiliao/video-popup-js
    CSS ACTUALIZADO - X solo visual
*/

.videopopupjs{
    background-color: rgba(0, 0, 0, 0.95);
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow: auto !important;
    cursor: pointer !important; /* Cursor de click en todo el fondo */
}

.videopopupjs--hide{
    -webkit-animation-duration: 0.3s;
    animation-duration: 0.3s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    -webkit-animation-name: videoPopupJsHide;
    animation-name: videoPopupJsHide;
}

/* X SOLO VISUAL - No necesita ser clickeable */
.videopopupjs__close{
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100000 !important;
    margin: 0 !important;
    pointer-events: none !important; /* IMPORTANTE: no recibe clicks */
    cursor: default !important; /* Cursor normal */
}

.videopopupjs__close:before{
    content: '×' !important;
    font-family: Arial, sans-serif !important;
    font-size: 36px !important;
    font-weight: bold !important;
    color: white !important;
    width: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 50% !important;
    border: 2px solid white !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
    pointer-events: none !important; /* No recibe clicks */
}

/* Versión con fondo negro sólido */
.videopopupjs__close--solid-black:before {
    background: #000000 !important;
}

/* CONTENEDOR DEL VIDEO - Evita que se cierre al hacer click aquí */
.videopopupjs__content{
    margin: 0 auto !important;
    height: auto !important;
    max-height: 90vh !important;
    width: 100% !important;
    max-width: 400px !important;
    position: relative !important;
    background: #000 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
    display: flex !important;
    flex-direction: column !important;
    cursor: default !important; /* Cursor normal dentro del contenido */
    pointer-events: auto !important; /* Permite clicks dentro */
}

/* El contenido DEL modal NO debe cerrar al hacer click */
.videopopupjs__content,
.videopopupjs__content * {
    pointer-events: auto !important;
    cursor: default !important;
}

.video-container {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 177.78% !important;
    overflow: hidden !important;
    background: #000 !important;
    pointer-events: auto !important;
}

.video-container iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    pointer-events: auto !important;
}

.videopopupjs__block--notfound{
    position: relative !important;
    margin: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
    background-color: #333 !important;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: white !important;
    padding: 40px 20px !important;
    border-radius: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    pointer-events: auto !important;
}

.videopopupjs__block--notfound:before {
    content: "❌";
    font-size: 40px;
    margin-bottom: 15px;
    display: block;
}

.videopopupjs--animation{
    opacity: 0;
    -webkit-animation-duration: 0.3s;
    animation-duration: 0.3s;
    -webkit-animation-fill-mode: both;
    animation-fill-mode: both;
    -webkit-animation-name: videoPopupJs;
    animation-name: videoPopupJs;
}

/* RESPONSIVE */
@media(max-width: 768px){
    .videopopupjs__content{
        max-width: 95% !important;
        margin: 10px !important;
    }
    
    .videopopupjs {
        padding: 10px !important;
    }
    
    .videopopupjs__close {
        top: 15px !important;
        left: 15px !important;
        width: 45px !important;
        height: 45px !important;
    }
    
    .videopopupjs__close:before {
        width: 45px !important;
        height: 45px !important;
        font-size: 32px !important;
    }
}

@media(max-width: 480px){
    .videopopupjs__content{
        max-width: 98% !important;
        border-radius: 8px !important;
    }
    
    .videopopupjs__close {
        top: 10px !important;
        left: 10px !important;
        width: 40px !important;
        height: 40px !important;
    }
    
    .videopopupjs__close:before {
        width: 40px !important;
        height: 40px !important;
        font-size: 28px !important;
        border: 1.5px solid white !important;
    }
}

/* ANIMACIONES */
@-webkit-keyframes videoPopupJs{
    0%{
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100%{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes videoPopupJs{
    0%{
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    100%{
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@-webkit-keyframes videoPopupJsHide{
    0%{
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100%{
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

@keyframes videoPopupJsHide{
    0%{
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100%{
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}