/**
 * Alertas Personalizadas
 * Sistema de alertas moderno sin usar alert() del navegador
 */

/* Overlay para las alertas */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Contenedor de la alerta */
.custom-alert-box {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 450px;
    width: 90%;
    padding: 0;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.custom-alert-overlay.show .custom-alert-box {
    transform: scale(1);
}

/* Header de la alerta */
.custom-alert-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.custom-alert-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-alert-icon .material-symbols-outlined {
    font-size: 28px;
}

/* Tipos de alerta */
.custom-alert-box.alert-info .custom-alert-icon {
    background: #E3F2FD;
    color: #1976D2;
}

.custom-alert-box.alert-success .custom-alert-icon {
    background: #E8F5E9;
    color: #388E3C;
}

.custom-alert-box.alert-warning .custom-alert-icon {
    background: #FFF3E0;
    color: #F57C00;
}

.custom-alert-box.alert-error .custom-alert-icon {
    background: #FFEBEE;
    color: #D32F2F;
}

.custom-alert-box.alert-confirm .custom-alert-icon {
    background: #FFF3E0;
    color: #F57C00;
}

.custom-alert-title {
    flex: 1;
}

.custom-alert-title h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Contenido de la alerta */
.custom-alert-content {
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Botones de la alerta */
.custom-alert-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.custom-alert-btn {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-alert-btn-primary {
    background: var(--accent-color);
    color: white;
}

.custom-alert-btn-primary:hover {
    background: var(--accent-hover);
}

.custom-alert-btn-secondary {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.custom-alert-btn-secondary:hover {
    background: var(--border-color);
}

.custom-alert-btn-danger {
    background: #D32F2F;
    color: white;
}

.custom-alert-btn-danger:hover {
    background: #B71C1C;
}

/* Toast notifications (notificaciones pequeñas) */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    max-width: 500px;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.custom-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.custom-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-toast-icon .material-symbols-outlined {
    font-size: 24px;
}

.custom-toast.toast-success .custom-toast-icon {
    background: #E8F5E9;
    color: #388E3C;
}

.custom-toast.toast-error .custom-toast-icon {
    background: #FFEBEE;
    color: #D32F2F;
}

.custom-toast.toast-warning .custom-toast-icon {
    background: #FFF3E0;
    color: #F57C00;
}

.custom-toast.toast-info .custom-toast-icon {
    background: #E3F2FD;
    color: #1976D2;
}

.custom-toast-content {
    flex: 1;
}

.custom-toast-message {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.custom-toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-toast-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Animaciones */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .custom-alert-box {
        max-width: 95%;
    }
    
    .custom-toast {
        min-width: auto;
        max-width: 90%;
        right: 5%;
    }
}
