/* SpeedPlay Videos Ultimate - Frontend CSS */
/* Targeting mobile first explicitly avoiding DOM shifting */

.speedplay-ultimate-trigger {
    /* No debe tener display flex ni absolute globalmente porque actúa como wrapper */
    cursor: pointer;
    text-decoration: none !important;
    max-width: 100%;
}
.speedplay-ultimate-trigger img {
    display: block;
    max-width: 100%;
    height: auto;
}

.speedplay-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
    z-index: 2;
}

.speedplay-icon-wrapper svg {
    width: 72px;  /* Icono principal Premium size */
    height: auto;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.speedplay-ultimate-trigger:hover .speedplay-icon-wrapper {
    transform: translate(-50%, -50%) scale(1.15);
}


/* 
 * Lightbox Modal
 */
.speedplay-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

.speedplay-modal.is-opening,
.speedplay-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.speedplay-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.speedplay-modal__container {
    position: relative;
    width: 100%;
    max-width: 90vw;
    /* max-height es controlado dinámicamente por JS según el aspect-ratio del video */
    background: #000;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out, width 0.25s ease-out, max-width 0.25s ease-out;
    margin: 0 auto;
}

.speedplay-modal__close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.speedplay-modal__close:hover {
    opacity: 1;
}

.speedplay-modal__player {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    /* aspect-ratio asignado dinámicamente por JS según el tipo de video */
    aspect-ratio: 16 / 9; /* Default landscape fallback */
}

/* En caso que el navegador no soporte aspect-ratio nativamente */
@supports not (aspect-ratio: 16/9) {
    .speedplay-modal__player {
        padding-top: 56.25%; /* 16:9 */
    }
}

.speedplay-modal__player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Burbuja flotante Powered By */
.speedplay-powered-by-bubble {
    position: absolute;
    bottom: -36px;
    right: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: auto;
}
.speedplay-powered-by-bubble a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}
.speedplay-powered-by-bubble a:hover {
    color: #fbbc05;
}

@media (min-width: 768px) {
    .speedplay-modal__container {
        max-width: 800px; /* Previene que en pantallas ultra ancha se expanda infinitamente */
    }
    .speedplay-modal__close {
        right: -30px;
    }
}
