/**
 * Tu Noticia - Modal Publicitario para Advanced Ads
 * Estilos Frontend
 */

:root {
    --tnam-overlay-bg: rgba(0, 0, 0, 0.75);
}

#tnam-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#tnam-modal-overlay.tnam-is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Fondo oscuro / Backdrop */
.tnam-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--tnam-overlay-bg, rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

/* Envoltura y Contenedor Principal */
.tnam-modal-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.tnam-modal-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.92) translateY(15px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#tnam-modal-overlay.tnam-is-open .tnam-modal-container {
    transform: scale(1) translateY(0);
}

/* Barra superior: Etiqueta y Botón Cerrar */
.tnam-modal-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    min-height: 38px;
    box-sizing: border-box;
}

.tnam-header-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    user-select: none;
}

/* Botón de Cierre */
.tnam-close-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 4px 6px;
    margin: 0;
    cursor: pointer;
    border-radius: 6px;
    color: #64748b;
    transition: color 0.2s ease, background-color 0.2s ease;
    line-height: 1;
    font-family: inherit;
}

.tnam-close-btn:hover {
    color: #0f172a;
    background-color: rgba(0, 0, 0, 0.08);
}

.tnam-close-btn:disabled,
.tnam-close-btn.tnam-is-counting {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: transparent !important;
}

.tnam-close-icon {
    display: block;
    width: 18px;
    height: 18px;
}

/* Insignia de Cuenta Regresiva */
.tnam-countdown-badge {
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 14px;
    text-align: center;
}

/* Cuerpo del Modal y Espacio Publicitario */
.tnam-modal-body {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    box-sizing: border-box;
}

.tnam-ad-slot {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    overflow: hidden;
}

/* Soporte responsive para elementos de anuncios comunes */
.tnam-ad-slot img,
.tnam-ad-slot video,
.tnam-ad-slot svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tnam-ad-slot iframe {
    max-width: 100%;
    border: none;
    display: block;
    margin: 0 auto;
}

.tnam-ad-slot .advads-ad,
.tnam-ad-slot .advads-group,
.tnam-ad-slot .advads-wrapper {
    margin: 0 auto;
    max-width: 100%;
}

.tnam-ad-slot ins.adsbygoogle {
    display: block !important;
    margin: 0 auto !important;
}

/* Adaptabilidad para pantallas móviles pequeñas */
@media (max-width: 480px) {
    #tnam-modal-overlay {
        padding: 10px;
    }
    .tnam-modal-body {
        padding: 8px;
    }
    .tnam-modal-top-bar {
        padding: 6px 10px;
    }
}
