
/* AJUSTES ALERTAS */

/* Forzar posición correcta independientemente del contenedor padre */
#flash-messages-container {
    position: fixed !important;
    top: 5.5rem !important;
    right: 3rem !important;
    left: auto !important;
    z-index: 9999 !important;
    pointer-events: none;
}

/* Ajustes responsivos para las alertas flotantes */
@media (max-width: 640px) {
    #flash-messages-container {
        top: 4.5rem !important;
        right: 1rem !important;
        left: 1rem !important;
    }

    #flash-messages-container>div {
        min-width: auto;
        max-width: none;
    }
}

#flash-messages-container>div {
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Efecto hover en el botón de cerrar */
#flash-messages-container button:hover svg {
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

/* Animación suave para aparecer (fade in) */
#flash-messages-container>div {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.alert-success .alert-icon {
    animation: successCheck 0.8s ease-out;
}

@keyframes successCheck {
    0% {
        transform: scale(0.3) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* WARNING - Animación de advertencia pulsante */
.alert-warning .alert-icon {
    animation: warningPulse 1.5s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* ERROR/DANGER - Animación de sacudida para llamar atención */
.alert-error .alert-icon,
.alert-danger .alert-icon {
    animation: errorShake 0.6s ease-in-out, errorGlow 2s ease-in-out infinite;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes errorGlow {
    0%, 100% {
        filter: drop-shadow(0 0 0px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 8px currentColor);
    }
}

/* INFO - Animación suave de rotación y fade */
.alert-info .alert-icon {
    animation: infoFadeRotate 0.8s ease-out;
}

@keyframes infoFadeRotate {
    0% {
        transform: scale(0.5) rotate(-90deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Animación adicional al hacer hover sobre la notificación completa */
.alert-container:hover .alert-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Animación específica para el botón de cerrar */
.alert-close-btn {
    transition: all 0.2s ease;
}

.alert-close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    opacity: 0.8;
}

/* Micro-animación en los paths del SVG para mayor dinamismo */
.alert-success .alert-icon path {
    animation: drawPath 0.8s ease-out;
}

@keyframes drawPath {
    0% {
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

/* Animación de bounce suave para success */
.alert-success {
    animation: alertBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes alertBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animación específica para warning con pulsación del borde */
.alert-warning {
    animation: warningBorderPulse 0.6s ease-out, warningGlow 3s ease-in-out infinite 1s;
}

@keyframes warningBorderPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
        border-color: transparent;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes warningGlow {
    0%, 100% {
        box-shadow: 0 0 0px rgba(var(--warning-rgb, 245, 158, 11), 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(var(--warning-rgb, 245, 158, 11), 0.3);
    }
}

/* Animación para error que llama la atención */
.alert-error,
.alert-danger {
    animation: errorAttention 0.6s ease-out;
}

@keyframes errorAttention {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Animación sutil para info */
.alert-info {
    animation: infoSlideIn 0.5s ease-out;
}

@keyframes infoSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto de partículas para éxito (opcional - versión avanzada) */
.alert-success::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    border-radius: inherit;
    animation: successRipple 0.8s ease-out;
    pointer-events: none;
    z-index: -1;
}

@keyframes successRipple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Responsivo - reducir animaciones en móviles si es necesario */
@media (max-width: 640px) {
    .alert-warning .alert-icon {
        animation-duration: 2s; /* Más lento en móvil */
    }
    
    .alert-error .alert-icon,
    .alert-danger .alert-icon {
        animation: errorShake 0.4s ease-in-out; /* Sin glow en móvil */
    }
}

/* Para usuarios que prefieren movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .alert-icon,
    .alert-container,
    .alert-close-btn {
        animation: none !important;
        transition: none !important;
    }
}