/* ========================================
   SISTEMA DE ALERTAS PERSONALIZADO
   ======================================== */

/* Overlay para alertas */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 29, 27, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-alert-overlay.active {
    display: flex;
    opacity: 1;
}

/* Contenedor principal de la alerta */
.custom-alert {
    background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 90%;
    padding: 0;
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    position: relative;
}

.custom-alert-overlay.active .custom-alert {
    transform: scale(1);
    opacity: 1;
}

/* Barra superior con color corporativo */
.custom-alert-header {
    padding: 25px 30px 20px;
    position: relative;
    text-align: center;
    border-bottom: 3px solid #f0f0f0;
}

.custom-alert-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #D20A11 0%, #1D1D1B 100%);
}

/* Iconos de la alerta */
.custom-alert-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    animation: iconPulse 2s ease-in-out infinite;
}

/* Tipos de alerta */
.custom-alert.success .custom-alert-icon {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.custom-alert.error .custom-alert-icon {
    background: linear-gradient(135deg, #D20A11 0%, #c21e2d 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(210, 10, 17, 0.4);
}

.custom-alert.warning .custom-alert-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

.custom-alert.info .custom-alert-icon {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.4);
}

/* Animación del icono */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Título de la alerta */
.custom-alert-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #1D1D1B;
    font-family: 'Montserrat', sans-serif;
}

.custom-alert.success .custom-alert-title {
    color: #28a745;
}

.custom-alert.error .custom-alert-title {
    color: #D20A11;
}

.custom-alert.warning .custom-alert-title {
    color: #ffc107;
}

.custom-alert.info .custom-alert-title {
    color: #17a2b8;
}

/* Cuerpo de la alerta */
.custom-alert-body {
    padding: 25px 30px;
    background: white;
}

.custom-alert-message {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    text-align: center;
}

/* Pie de la alerta */
.custom-alert-footer {
    padding: 20px 30px 25px;
    display: flex;
    gap: 12px;
    justify-content: center;
    background: #f8f9fa;
}

/* Botones de la alerta */
.custom-alert-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.custom-alert-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.custom-alert-btn:hover::before {
    width: 300px;
    height: 300px;
}

.custom-alert-btn-primary {
    background: linear-gradient(135deg, #D20A11 0%, #c21e2d 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(210, 10, 17, 0.3);
}

.custom-alert-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(210, 10, 17, 0.4);
}

.custom-alert-btn-secondary {
    background: linear-gradient(135deg, #1D1D1B 0%, #3a3a3a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 29, 27, 0.3);
}

.custom-alert-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 29, 27, 0.4);
}

.custom-alert-btn-outline {
    background: white;
    color: #D20A11;
    border: 2px solid #D20A11;
}

.custom-alert-btn-outline:hover {
    background: #D20A11;
    color: white;
    transform: translateY(-2px);
}

/* Animación de entrada */
@keyframes slideInDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animación de salida */
@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Partículas decorativas en las alertas de éxito */
.custom-alert.success .custom-alert-header::after {
    
    position: absolute;
    top: 50%;
    left: 10%;
    font-size: 20px;
    animation: sparkle 2s ease-in-out infinite;
}

.custom-alert.success .custom-alert-header::before {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 576px) {
    .custom-alert {
        max-width: 95%;
    }
    
    .custom-alert-title {
        font-size: 20px;
    }
    
    .custom-alert-message {
        font-size: 14px;
    }
    
    .custom-alert-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .custom-alert-footer {
        flex-direction: column;
    }
    
    .custom-alert-btn {
        width: 100%;
    }
}

/* Toast Notifications (Notificaciones flotantes) */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.custom-toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    position: relative;
    overflow: hidden;
}

.custom-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.custom-toast.success::before {
    background: #28a745;
}

.custom-toast.error::before {
    background: #D20A11;
}

.custom-toast.warning::before {
    background: #ffc107;
}

.custom-toast.info::before {
    background: #17a2b8;
}

.custom-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.custom-toast.success .toast-icon {
    color: #28a745;
}

.custom-toast.error .toast-icon {
    color: #D20A11;
}

.custom-toast.warning .toast-icon {
    color: #ffc107;
}

.custom-toast.info .toast-icon {
    color: #17a2b8;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: #1D1D1B;
}

.toast-message {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toast-close:hover {
    color: #D20A11;
}

/* Progress bar para toast */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #D20A11 0%, #1D1D1B 100%);
    animation: toastProgress 3s linear forwards;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

@media (max-width: 576px) {
    .toast-container {
        right: 10px;
        left: 10px;
        top: 70px;
    }
    
    .custom-toast {
        min-width: auto;
        max-width: 100%;
    }
}
