/**
 * Animation Styles
 * Provides CSS for scroll animations, transitions, and interactive effects
 */

/* Base Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation for Lists */
.sr-card.animate-on-scroll {
    transition-delay: calc(var(--animation-order, 0) * 0.1s);
}

/* Hero Parallax */
.sr-hero {
    position: relative;
    overflow: hidden;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* Enhanced Card Interactions */
.sr-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    will-change: transform;
    transform-style: preserve-3d;
}

/* Button Ripple Effect */
.cta_button,
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cta_button:active,
.btn:active {
    transform: scale(0.98);
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Lazy Load Image Effects */
.lazy-image {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.lazy-image.loaded {
    filter: blur(0);
}

/* Fade In Variations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Smooth Hover Transitions */
a,
button,
.sr-card,
.cta_button,
.btn {
    transition: all 0.3s ease;
}

/* Statistics Counter Animation */
.stat-number {
    font-weight: 700;
    display: inline-block;
    min-width: 3ch;
}

/* Pulse Animation for CTAs */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.cta_button.pulse {
    animation: pulse 2s infinite;
}

/* Smooth Page Transitions */
.animations-loaded * {
    transition-property: transform, opacity, filter;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Section Reveal Animation */
.sr-section {
    opacity: 0;
    animation: sectionReveal 0.8s ease forwards;
    animation-delay: 0.2s;
}

@keyframes sectionReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Gradient Animation for Hero */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hero-gradient-modern {
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Performance Optimizations */
.sr-card,
.animate-on-scroll,
.lazy-image {
    will-change: auto;
}

/* 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;
    }

    .sr-hero {
        transform: none !important;
    }
}