/**
 * Sistema de Modales/Alertas Modernas
 * Reemplaza alert(), confirm() y prompt() del navegador
 */

/* Overlay del modal */
.modal-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 20px;
}

.modal-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor del modal */
.modal-alert-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-alert-overlay.active .modal-alert-box {
    transform: scale(1) translateY(0);
}

/* Cabecera con icono */
.modal-alert-header {
    padding: 30px 24px 16px;
    text-align: center;
}

.modal-alert-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    animation: modalIconPop 0.4s ease;
}

@keyframes modalIconPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Tipos de iconos */
.modal-alert-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal-alert-icon.error {
    background: linear-gradient(135deg, #dc3545, #e63946);
    color: white;
}

.modal-alert-icon.warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
}

.modal-alert-icon.info {
    background: linear-gradient(135deg, #17a2b8, #2196f3);
    color: white;
}

.modal-alert-icon.confirm {
    background: linear-gradient(135deg, #ff6600, #ff8c00);
    color: white;
}

/* Título */
.modal-alert-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px;
    line-height: 1.3;
}

/* Mensaje */
.modal-alert-message {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    padding: 0 24px 20px;
    text-align: center;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Footer con botones */
.modal-alert-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-alert-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    font-family: inherit;
}

.modal-alert-btn:active {
    transform: scale(0.96);
}

.modal-alert-btn.primary {
    background: linear-gradient(135deg, #ff6600, #ff8c00);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.modal-alert-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

.modal-alert-btn.danger {
    background: linear-gradient(135deg, #dc3545, #e63946);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.modal-alert-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.modal-alert-btn.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.modal-alert-btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.modal-alert-btn.secondary {
    background: #f0f0f0;
    color: #495057;
}

.modal-alert-btn.secondary:hover {
    background: #e0e0e0;
}

/* Responsive */
@media (max-width: 480px) {
    .modal-alert-box {
        max-width: 100%;
    }
    
    .modal-alert-header {
        padding: 24px 20px 12px;
    }
    
    .modal-alert-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }
    
    .modal-alert-title {
        font-size: 1.2rem;
    }
    
    .modal-alert-footer {
        flex-direction: column-reverse;
        padding: 12px 20px 20px;
    }
    
    .modal-alert-btn {
        width: 100%;
    }
}
