/**
 * Simple Content Gate CSS
 * Estilos minimalistas para el plugin de barra de progreso
 */

/* Contenedor principal de la barra de progreso */
.simple-content-gate-container {
    background: linear-gradient(135deg, #bb7423, #f5a40d) !important;
    color: white;
    padding: 40px 30px;
    margin: 0;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 600px;
    position: relative;
    overflow: hidden;
    z-index: 9999;
}

/* Efecto de brillo animado */
.simple-content-gate-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Contenedor del wrapper de progreso */
.scg-progress-wrapper {
    position: relative;
    z-index: 1;
}

/* Mensaje principal */
.scg-message h3 {
    margin: 0 0 30px 0;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Barra de progreso */
.scg-progress-bar {
    width: 100%;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin: 25px 0;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scg-progress-fill {
    height: 100%;
    width: 0%;
    background-color: #4CAF50;
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Efecto de brillo en la barra */
.scg-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: barShine 2s infinite;
}

@keyframes barShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Display del tiempo */
.scg-time-display {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 20px;
    opacity: 0.9;
}

.scg-current-time {
    color: #4CAF50;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.scg-total-time {
    color: #FFD700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Estados cuando el contenido está oculto */
body.scg-content-hidden {
    position: relative;
}

/* Overlay general */
.scg-overlay {
    pointer-events: none !important;
}

/* Animaciones de entrada */
.simple-content-gate-container {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .simple-content-gate-container {
        padding: 30px 20px;
        margin: 20px 15px;
        border-radius: 12px;
    }
    
    .scg-message h3 {
        font-size: 1.3em;
    }
    
    .scg-progress-bar {
        height: 16px;
        margin: 20px 0;
    }
    
    .scg-time-display {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .simple-content-gate-container {
        padding: 25px 15px;
        margin: 15px 10px;
    }
    
    .scg-message h3 {
        font-size: 1.2em;
        margin-bottom: 20px;
    }
    
    .scg-progress-bar {
        height: 14px;
        margin: 15px 0;
    }
    
    .scg-time-display {
        font-size: 1em;
        margin-top: 15px;
    }
}

/* Efectos hover para interactividad */
.simple-content-gate-container:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
}

/* Estados de completado */
.scg-completed .scg-progress-fill {
    background-color: #4CAF50 !important;
    box-shadow: 0 2px 12px rgba(76, 175, 80, 0.5);
}

.scg-completed .scg-message h3 {
    color: #4CAF50 !important;
}

/* Animación de pulso para el contenedor cuando está activo */
.scg-active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.5);
    }
}

/* Efecto de desvanecimiento para salida */
.scg-fade-out {
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Compatibilidad con temas oscuros */
@media (prefers-color-scheme: dark) {
    .simple-content-gate-container {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .scg-progress-bar {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Utilidades */
.scg-text-center { text-align: center; }
.scg-hidden { display: none !important; }
.scg-visible { display: block !important; }

/* Clases de estado */
.scg-loading .scg-progress-bar {
    position: relative;
}

.scg-loading .scg-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Ajustes específicos para WordPress */
.admin-bar .simple-content-gate-container {
    margin: 0; /* Sin márgenes */
    background: linear-gradient(135deg, #bb7423, #f5a40d) !important;
}

/* Asegurar que elementos importantes estén visibles */
#wpadminbar {
    z-index: 99999 !important;
}

/* Resetear estilos que puedan interferir */
.simple-content-gate-container * {
    box-sizing: border-box;
}

.simple-content-gate-container p,
.simple-content-gate-container h1,
.simple-content-gate-container h2,
.simple-content-gate-container h3,
.simple-content-gate-container h4,
.simple-content-gate-container h5,
.simple-content-gate-container h6 {
    margin: 0;
    padding: 0;
    font-weight: inherit;
    line-height: inherit;
}

/* Debug styles (solo visible cuando se necesite) */
.scg-debug-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #4CAF50;
    padding: 10px 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    z-index: 99999;
    display: none;
}

/* Mostrar debug info solo cuando se necesite */
body.scg-debug .scg-debug-info {
    display: block;
}

/* Compatibilidad con Fluent Forms y otros popups */
.ff_form_modal,
.lity,
.lity-wrap,
.lity-container,
[data-lity],
.modal,
.popup {
    z-index: 999999 !important; /* Asegurar que popups estén por encima */
}

.ff_form_modal .lity-container,
.ff_form_modal .lity-content {
    z-index: 999999 !important;
}

/* Cuando el contenido está desbloqueado, reducir z-index */
body:not(.scg-content-hidden) .simple-content-gate-container {
    z-index: 1 !important;
}

body:not(.scg-content-hidden) #hero-section,
body:not(.scg-content-hidden) .hero-section {
    z-index: auto !important;
    position: static !important;
}
