/**
 * Content Gate Pro - Frontend Styles
 */

/* Variables (se sobrescriben con valores de PHP) */
:root {
    --cgp-button-bg: #2563eb;
    --cgp-button-color: #ffffff;
    --cgp-button-radius: 8px;
    --cgp-overlay-opacity: 0.80;
}

/* Overlay de fondo - Solo visual, permite clics a través */
.cgp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, calc(var(--cgp-overlay-opacity) * 0.3)) 30%,
        rgba(0, 0, 0, var(--cgp-overlay-opacity)) 100%
    );
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none; /* Siempre permite clics a través */
}

.cgp-overlay.visible {
    opacity: 1;
    visibility: visible;
    /* pointer-events: none se mantiene - permite interactuar con contenido detrás */
}

/* Contenedor del gate - permite clics a través excepto en el botón */
.cgp-gate {
    position: fixed;
    top: 80%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 20px 40px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translate(0, -50%) translateY(20px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    pointer-events: none; /* El contenedor no bloquea clics */
}

.cgp-gate.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

/* Botón principal - este SÍ es clicable */
.cgp-button {
    display: inline-block;
    padding: 16px 32px;
    background-color: var(--cgp-button-bg);
    color: var(--cgp-button-color) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none !important;
    text-align: center;
    border: none;
    border-radius: var(--cgp-button-radius);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 280px;
    max-width: 90%;
    pointer-events: auto; /* El botón SÍ captura clics */
}

.cgp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: var(--cgp-button-color) !important;
    text-decoration: none !important;
}

.cgp-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .cgp-gate {
        padding: 20px 15px 30px;
    }
    
    .cgp-button {
        font-size: 14px;
        padding: 14px 24px;
        min-width: auto;
        width: 100%;
        max-width: 320px;
    }
}

/* Animación de entrada del botón */
@keyframes cgp-pulse {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    }
}

.cgp-gate.visible .cgp-button {
    animation: cgp-pulse 2s ease-in-out infinite;
}

/* Prevenir scroll cuando gate visible */
body.cgp-no-scroll {
    overflow: hidden;
}
