/**
 * Anuncios Grandes - Interstitial Prehome Styles
 */

/* Bloquear scroll mientras el anuncio está abierto */
body.ag-interstitial-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.ag-interstitial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    box-sizing: border-box;
}

.ag-interstitial-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.ag-interstitial-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 9, 13, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ag-interstitial-wrapper {
    position: relative;
    z-index: 2;
    width: 92%;
    max-width: 960px;
    background: #12131a;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ag-interstitial-overlay.is-visible .ag-interstitial-wrapper {
    transform: scale(1);
}

/* Cabecera del anuncio */
.ag-interstitial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #181922;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ag-brand-tag {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ag-badge {
    background: #d32f2f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ag-headline {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}

.ag-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ocultar totalmente cualquier botón "X", cerrar o control adicional */
.ag-close-x,
#ag-close-x,
.ag-sound-btn,
#ag-sound-btn,
.ag-interstitial-footer,
#ag-continue-link {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Botón Saltar Video */
.ag-skip-btn {
    border: none;
    outline: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.3px;
    box-sizing: border-box;
}

.ag-skip-btn.is-counting {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #cbd5e0 !important;
    cursor: not-allowed !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    pointer-events: none !important;
    user-select: none !important;
}

.ag-skip-btn.is-active {
    background: #f6ad55 !important;
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%) !important;
    color: #1a202c !important;
    box-shadow: 0 4px 14px rgba(237, 137, 54, 0.45) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.ag-skip-btn.is-active:hover {
    background: linear-gradient(135deg, #ecc94b 0%, #dd6b20 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(237, 137, 54, 0.6) !important;
}

/* Cuerpo del anuncio */
.ag-interstitial-body {
    position: relative;
    width: 100%;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Contenedor 16:9 para video */
.ag-video-frame-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.ag-video-frame-wrap iframe,
.ag-video-frame-wrap #ag-yt-player-target {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Capa transparente de bloqueo: impide hacer clic en la barra de tiempo o adelantar */
.ag-video-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    background: transparent;
    cursor: default;
}

/* Botón flotante para activar / silenciar sonido */
.ag-sound-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    background: rgba(18, 19, 26, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.25s ease;
}

.ag-sound-btn:hover {
    background: rgba(35, 38, 52, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.ag-sound-icon-box {
    display: flex;
    align-items: center;
    color: #f6ad55;
}

.ag-sound-svg {
    display: block;
}

/* Contenedor de Imagen */
.ag-image-frame-wrap {
    width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ag-banner-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

/* Contenedor HTML */
.ag-html-frame-wrap {
    padding: 25px;
    color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    max-height: 70vh;
    overflow-y: auto;
}

/* Pie del anuncio */
.ag-interstitial-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #14151e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ag-continue-link {
    color: #a0aec0;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ag-continue-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Adaptación responsive en móviles */
@media (max-width: 768px) {
    .ag-interstitial-wrapper {
        width: 96%;
        border-radius: 10px;
    }

    .ag-interstitial-header {
        padding: 10px 14px;
    }

    .ag-headline {
        display: none; /* Ocultar en pantallas estrechas */
    }

    .ag-badge {
        font-size: 10px;
        padding: 3px 7px;
    }

    .ag-skip-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}
