/* aether-alert-v2.css */

/* --- Variables de Diseño y Colores --- */
:root {
    /* Define el tema oscuro como base por defecto */
    --ae-theme: dark;
    --ae-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --ae-backdrop-color: rgba(10, 15, 25, 0.5);
    --ae-modal-bg: rgba(23, 32, 49, 0.6);
    --ae-modal-border: rgba(100, 116, 139, 0.2);
    --ae-title-color: #eaf0ff;
    --ae-text-color: #b0c4de;
    --ae-success-color: #50fa7b; /* Verde más vibrante */
    --ae-error-color: #ff5555;   /* Rojo más vibrante */
    --ae-warning-color: #f1fa8c; /* Amarillo más vibrante */
    --ae-info-color: #8be9fd;    /* Cian más vibrante */
    --ae-confirm-btn-bg: linear-gradient(135deg, #8be9fd 0%, #50fa7b 100%);
    --ae-cancel-btn-bg: linear-gradient(135deg, #ff79c6 0%, #ff5555 100%);
    --ae-btn-text-color: #282a36;
    --ae-glow-confirm: rgba(139, 233, 253, 0.4);
    --ae-glow-cancel: rgba(255, 121, 198, 0.4);
}

/* --- Tema Claro Automático/Manual --- */
@media (prefers-color-scheme: light) {
    :root {
        /* Cambia las variables por defecto si el sistema está en modo claro */
        --ae-theme: light;
        --ae-backdrop-color: rgba(240, 242, 245, 0.5);
        --ae-modal-bg: rgba(255, 255, 255, 0.6);
        --ae-modal-border: rgba(0, 0, 0, 0.1);
        --ae-title-color: #1e293b;
        --ae-text-color: #475569;
        --ae-success-color: #16a34a;
        --ae-error-color: #dc2626;
        --ae-warning-color: #d97706;
        --ae-info-color: #2563eb;
        --ae-confirm-btn-bg: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
        --ae-cancel-btn-bg: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
        --ae-btn-text-color: #ffffff;
        --ae-glow-confirm: rgba(56, 189, 248, 0.5);
        --ae-glow-cancel: rgba(251, 113, 133, 0.5);
    }
}

/* Forzar tema claro (sobrescribe todo lo anterior) */
html[data-aether-theme="light"] {
    --ae-theme: light;
    --ae-backdrop-color: rgba(240, 242, 245, 0.5);
    --ae-modal-bg: rgba(255, 255, 255, 0.6);
    --ae-modal-border: rgba(0, 0, 0, 0.1);
    --ae-title-color: #1e293b;
    --ae-text-color: #475569;
    --ae-success-color: #16a34a;
    --ae-error-color: #dc2626;
    --ae-warning-color: #d97706;
    --ae-info-color: #2563eb;
    --ae-confirm-btn-bg: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
    --ae-cancel-btn-bg: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);
    --ae-btn-text-color: #ffffff;
    --ae-glow-confirm: rgba(56, 189, 248, 0.5);
    --ae-glow-cancel: rgba(251, 113, 133, 0.5);
}

/* Forzar tema oscuro (útil si el sistema es claro pero se quiere el alert oscuro) */
html[data-aether-theme="dark"] {
    --ae-theme: dark;
    --ae-backdrop-color: rgba(10, 15, 25, 0.5);
    --ae-modal-bg: rgba(23, 32, 49, 0.6);
    --ae-modal-border: rgba(100, 116, 139, 0.2);
    --ae-title-color: #eaf0ff;
    --ae-text-color: #b0c4de;
    --ae-success-color: #50fa7b;
    --ae-error-color: #ff5555;
    --ae-warning-color: #f1fa8c;
    --ae-info-color: #8be9fd;
    --ae-confirm-btn-bg: linear-gradient(135deg, #8be9fd 0%, #50fa7b 100%);
    --ae-cancel-btn-bg: linear-gradient(135deg, #ff79c6 0%, #ff5555 100%);
    --ae-btn-text-color: #282a36;
    --ae-glow-confirm: rgba(139, 233, 253, 0.4);
    --ae-glow-cancel: rgba(255, 121, 198, 0.4);
}


body.aether-alert-open { overflow: hidden; }

/* --- Overlay con Animación Aurora --- */
.aether-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--ae-backdrop-color);
    backdrop-filter: blur(16px) saturate(120%);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    /* Animación Aurora */
    background-image: radial-gradient(circle at 10% 10%, var(--ae-info-color) 0%, transparent 30%),
                      radial-gradient(circle at 90% 80%, var(--ae-success-color) 0%, transparent 40%);
    animation: aurora-glow 20s infinite alternate;
}

.aether-alert-overlay.visible { opacity: 1; }

/* --- El Modal (con animación de entrada elástica) --- */
.aether-alert-modal {
    width: 100%;
    max-width: 520px;
    background: var(--ae-modal-bg);
    border: 1px solid var(--ae-modal-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Curva elástica */
}

.aether-alert-overlay.visible .aether-alert-modal {
    transform: scale(1);
    opacity: 1;
}

/* ... (resto del CSS de estructura, es el mismo) ... */
.ae-content-wrapper { display: flex; padding: 2.5rem; align-items: flex-start; gap: 1.5rem; }
.ae-icon-panel { flex-shrink: 0; }
.ae-text-panel { flex-grow: 1; text-align: left; }

/* --- Icono (con animación de entrada "swoop") --- */
.ae-icon i {
    font-size: 2.8rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    animation: icon-swoop-in 0.7s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Colores de iconos (ya definidos en variables) */
.ae-icon-success i { color: var(--ae-success-color); }
.ae-icon-error i { color: var(--ae-error-color); animation-name: jiggle-error; animation-duration: 0.5s; animation-delay: 0.2s; }
.ae-icon-warning i { color: var(--ae-warning-color); }
.ae-icon-info i, .ae-icon-question i { color: var(--ae-info-color); }

/* --- Contenido de Texto (animaciones escalonadas) --- */
.ae-title { color: var(--ae-title-color); font-size: 1.6rem; font-weight: 600; margin: 0 0 0.75rem 0; line-height: 1.2; animation: fade-in-up 0.6s 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) backwards; }
.ae-text { color: var(--ae-text-color); font-size: 1rem; line-height: 1.6; margin: 0; animation: fade-in-up 0.6s 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) backwards; }
.ae-button-container { margin-top: 2rem; display: flex; justify-content: flex-start; gap: 0.75rem; animation: fade-in-up 0.6s 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) backwards; }

/* --- Botones (con efecto de brillo) --- */
.ae-button { border: none; border-radius: 12px; padding: 0.8rem 1.6rem; font-size: 1rem; font-weight: 600; color: var(--ae-btn-text-color); cursor: pointer; background-size: 200% auto; transition: all 0.3s ease; }

.ae-button:hover {
    transform: translateY(-3px);
    background-position: right center;
}
.ae-button-confirm:hover { box-shadow: 0 4px 25px -5px var(--ae-glow-confirm); }
.ae-button-cancel:hover { box-shadow: 0 4px 25px -5px var(--ae-glow-cancel); }
.ae-button-confirm { background-image: var(--ae-confirm-btn-bg); }
.ae-button-cancel { background-image: var(--ae-cancel-btn-bg); }

/* --- Barra de Timer --- */
.ae-timer-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
}
.ae-timer-bar {
    width: 100%;
    height: 100%;
    background: var(--ae-confirm-btn-bg);
    animation: timer-countdown linear forwards;
}

/* --- Animaciones --- */
@keyframes aurora-glow {
    from { background-position: 0% 0%; }
    to { background-position: 100% 100%; }
}
@keyframes icon-swoop-in {
    from { transform: translateY(20px) rotate(-20deg) scale(0.7); opacity: 0; }
    to { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
}
@keyframes fade-in-up {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes jiggle-error { /* sin cambios */ }
@keyframes timer-countdown {
    from { width: 100%; }
    to { width: 0%; }
}

/* --- Responsive (sin cambios importantes) --- */
@media (max-width: 600px) {
    .ae-content-wrapper { flex-direction: column; align-items: center; text-align: center; padding: 2rem 1.5rem; }
    .ae-text-panel { text-align: center; }
    .ae-button-container { justify-content: center; width: 100%; flex-direction: column-reverse; }
    .ae-button { width: 100%; }
}