/* ========================================
   ANIMACIONES AVANZADAS
   ======================================== */

/* Animación de Partículas Cuánticas */
@keyframes quantumFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* Animación del Indicador Cuántico */
@keyframes quantumPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(243, 156, 18, 0);
    }
}

/* Animación del Gradiente del Título */
@keyframes elegantGradient {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

/* ANIMACIÓN DE SALTO PARA ICONOS DE REDES SOCIALES */
@keyframes socialBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Animación de Pulso Suave */
@keyframes softPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Animación de Rotación Continua */
@keyframes continuousRotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animación de Deslizamiento */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animación de Fade In */
@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Animación de Escala */
@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Animación de Temblor */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Animación de Ondas */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

/* Animación de Latido */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

/* Animación de Efecto Typing */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--accent-gold); }
}

/* Animación de Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animación de Progreso */
@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Animación de Glow */
@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 5px var(--accent-gold),
                     0 0 10px var(--accent-gold),
                     0 0 15px var(--accent-gold);
    }
    50% {
        text-shadow: 0 0 10px var(--accent-gold),
                     0 0 20px var(--accent-gold),
                     0 0 30px var(--accent-gold);
    }
}

/* Animación de Matrix Rain */
@keyframes matrixRain {
    0% {
        transform: translateY(-100vh);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Animación de Parallax */
@keyframes parallax {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(50px); }
}

/* Animación de Elastic */
@keyframes elastic {
    0% {
        transform: scale(0);
    }
    55% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    85% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Animación de Flip */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    40% {
        transform: perspective(400px) translateZ(150px) rotateY(170deg);
    }
    50% {
        transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
    }
    80% {
        transform: perspective(400px) rotateY(360deg) scale(0.95);
    }
    100% {
        transform: perspective(400px) scale(1);
    }
}

/* Animación de Zoom */
@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
}

@keyframes zoomOut {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    100% {
        opacity: 0;
    }
}

/* Animación de Slide */
@keyframes slideLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes slideRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Animación de Flash */
@keyframes flash {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0;
    }
}

/* Animación de Bounce In */
@keyframes bounceIn {
    0%, 20%, 40%, 60%, 80%, 100% {
        transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Clases de utilidad para animaciones */
.animate-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slideInLeft {
    animation: slideInFromLeft 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInFromRight 0.6s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.4s ease-out;
}

.animate-bounceIn {
    animation: bounceIn 0.8s ease-out;
}

.animate-pulse {
    animation: softPulse 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* Transiciones suaves */
.transition-smooth {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-fast {
    transition: all 0.2s ease-in-out;
}

.transition-slow {
    transition: all 0.8s ease-in-out;
}

/* Efectos de hover especiales */
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--accent-gold);
}

/* Micro-animaciones para elementos específicos */
.kpi-card {
    animation: slideInFromBottom 0.6s ease-out;
}

.chart-card {
    animation: fadeIn 0.8s ease-in-out;
}

.insight-item {
    animation: slideInFromLeft 0.5s ease-out;
}

.achievement-card {
    animation: bounceIn 0.8s ease-out;
}

/* Animaciones de carga */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-elegant);
    border-top: 4px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}