/**
 * ALERT SYSTEM CSS
 * Estilos para alertas y diálogos modales
 * Incluir en tu HTML: <link rel="stylesheet" href="/static/css/alert-system.css">
 */

/* ==========================================
   VARIABLES CSS (Personaliza aquí tus colores)
   ========================================== */
:root {
    --alert-success: #10b981;
    --alert-error: #ef4444;
    --alert-warning: #f59e0b;
    --alert-info: #3b82f6;
    
    --alert-bg-success: #d1fae5;
    --alert-bg-error: #fee2e2;
    --alert-bg-warning: #fef3c7;
    --alert-bg-info: #dbeafe;
    
    --modal-overlay-bg: rgba(0, 0, 0, 0.5);
    --modal-bg: #ffffff;
    --modal-border-radius: 12px;
}

/* ==========================================
   CONTENEDOR DE ALERTAS
   ========================================== */
.alert-container {
    position: fixed;
    top: 100px;
    left: 41.5%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* ==========================================
   ALERTAS
   ========================================== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 
                0 2px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
    pointer-events: auto;
    min-width: 300px;
}

.alert.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Tipos de alertas */
.alert-success {
    background: var(--modal-bg);
    border-color: var(--alert-success);
    color: #065f46;
}

.alert-error {
    background: var(--modal-bg);
    border-color: var(--alert-error);
    color: #991b1b;
}

.alert-warning {
    background: var(--modal-bg);
    border-color: var(--alert-warning);
    color: #92400e;
}

.alert-info {
    background: var(--modal-bg);
    border-color: var(--alert-info);
    color: #1e40af;
}

/* Elementos de la alerta */
.alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-message {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    color: inherit;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close:hover {
    opacity: 1;
}

/* Animaciones de alertas */
@keyframes slideIn {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* ==========================================
   MODALES (DIÁLOGOS)
   ========================================== */
.alert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--modal-overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.alert-modal-dialog {
    background: var(--modal-bg);
    border-radius: var(--modal-border-radius);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: scaleIn 0.2s ease-out;
}

.alert-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.alert-modal-icon.question {
    background: #dbeafe;
    color: #1e40af;
}

.alert-modal-icon.input {
    background: #e0e7ff;
    color: #4338ca;
}

.alert-modal-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: #111827;
}

.alert-modal-text {
    font-size: 15px;
    text-align: center;
    color: #0E181E;
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    font-family: inherit;
    transition: all 0.2s;
}

.alert-modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.alert-modal-buttons {
    display: flex;
    gap: 10px;
}

.alert-modal-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.alert-modal-btn:active {
    transform: scale(0.98);
}

.alert-modal-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.alert-modal-btn-cancel:hover {
    background: #e5e7eb;
}

.alert-modal-btn-confirm {
    background: #10b981;
    color: white;
}

.alert-modal-btn-confirm:hover {
    background: #059669;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Animaciones de modales */
@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 640px) {
    .alert-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .alert {
        min-width: unset;
    }
    
    .alert-modal-dialog {
        width: 95%;
        padding: 20px;
    }
    
    .alert-modal-buttons {
        flex-direction: column-reverse;
    }
    
    .alert-modal-btn {
        width: 100%;
    }
}