/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* ============================================
   FADE ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   ROTATE ANIMATIONS
   ============================================ */

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

/* ============================================
   PULSE ANIMATIONS
   ============================================ */

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

@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px rgba(255, 107, 107, 0);
    }
    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.15); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    70% { transform: scale(1); }
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* ============================================
   SHIMMER / SKELETON
   ============================================ */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes shimmerVertical {
    0% { background-position: 0 -200%; }
    100% { background-position: 0 200%; }
}

/* ============================================
   GRADIENT ANIMATIONS
   ============================================ */

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradientFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* ============================================
   FLOAT ANIMATIONS
   ============================================ */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ============================================
   GLITCH ANIMATION
   ============================================ */

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* ============================================
   UTILITY ANIMATION CLASSES
   ============================================ */

.animate-fadeIn { animation: fadeIn var(--transition-base) ease-out; }
.animate-fadeInUp { animation: fadeInUp var(--transition-slow) ease-out; }
.animate-fadeInDown { animation: fadeInDown var(--transition-slow) ease-out; }
.animate-fadeInLeft { animation: fadeInLeft var(--transition-slow) ease-out; }
.animate-fadeInRight { animation: fadeInRight var(--transition-slow) ease-out; }

.animate-scaleIn { animation: scaleIn var(--transition-base) ease-out; }
.animate-scaleInBounce { animation: scaleInBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }

.animate-slideUp { animation: slideUp var(--transition-slow) ease-out; }
.animate-slideDown { animation: slideDown var(--transition-slow) ease-out; }

.animate-spin { animation: spin 1s linear infinite; }
.animate-spinReverse { animation: spinReverse 1s linear infinite; }
.animate-wobble { animation: wobble 1s ease-in-out infinite; }

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

.animate-bounce { animation: bounce 1s ease-in-out infinite; }
.animate-bounceIn { animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }

.animate-shimmer { 
    animation: shimmer 1.5s infinite;
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-card-hover) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
}

.animate-gradientShift {
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

.animate-float { animation: float 3s ease-in-out infinite; }
.animate-floatSlow { animation: floatSlow 5s ease-in-out infinite; }

/* ============================================
   STAGGER ANIMATIONS (for lists/grids)
   ============================================ */

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }
.stagger-9 { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.page-exit {
    opacity: 1;
}

.page-exit-active {
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-fast);
}

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

.hover-rotate {
    transition: transform var(--transition-fast);
}

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

.hover-glow {
    transition: box-shadow var(--transition-fast);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-primary);
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */

@keyframes dots {
    0%, 20% {
        color: var(--text-tertiary);
        text-shadow: none;
    }
    50% {
        color: var(--text-primary);
        text-shadow: 0 0 10px var(--primary);
    }
    100% {
        color: var(--text-tertiary);
        text-shadow: none;
    }
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

/* ============================================
   PROGRESS BAR ANIMATION
   ============================================ */

@keyframes progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary-gradient);
    animation: progress 2s ease-in-out infinite;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-*,
    .hover-* {
        animation: none !important;
        transition: none !important;
    }
}
