/* ===== ANIMATION UTILITIES ===== */

/* Fade In Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s ease-out;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s ease-out;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale Animations */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation Delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.hover-scale {
    transition: transform 0.3s ease-out;
}

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

/* Loading Animations */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse Animation */
.pulse-animation {
    animation: pulse-scale 2s infinite;
}

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

/* Floating Animation */
.float {
    animation: float 3s ease-in-out infinite;
}

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

/* Typing Animation */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid #3b82f6;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #3b82f6; }
}

/* Slide Animations */
.slide-in-bottom {
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.8s ease-out;
}

.slide-in-bottom.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-top {
    opacity: 0;
    transform: translateY(-100px);
    transition: all 0.8s ease-out;
}

.slide-in-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Rotate Animations */
.rotate-in {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
    transition: all 0.8s ease-out;
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Progress Bar Animation */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #f97316);
    border-radius: 2px;
    transform: translateX(-100%);
    transition: transform 1.5s ease-out;
}

.progress-fill.animate {
    transform: translateX(0);
}

/* Bounce Animation */
.bounce-in {
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bounce-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Flip Animation */
.flip-in {
    opacity: 0;
    transform: rotateY(-90deg);
    transition: all 0.8s ease-out;
}

.flip-in.visible {
    opacity: 1;
    transform: rotateY(0deg);
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transition: box-shadow 0.3s ease-out;
}

.glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

/* Gradient Animation */
.gradient-animation {
    background: linear-gradient(-45deg, #3b82f6, #f97316, #10b981, #8b5cf6);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

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

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
    position: relative;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #3b82f6;
    transform: translateX(-100%);
    transition: transform 0.8s ease-out;
}

.text-reveal.animate::after {
    transform: translateX(100%);
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Particle Effect */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(59, 130, 246, 0.6);
    border-radius: 50%;
    animation: particle-float 8s linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
