/* ===================================
   Scroll Animations (IntersectionObserver)
   =================================== */

/* Base animation states */
[data-animate] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: none !important;
}

/* Fade up */
[data-animate="fade-up"] {
    transform: translateY(40px);
}

/* Fade down */
[data-animate="fade-down"] {
    transform: translateY(-40px);
}

/* Fade left */
[data-animate="fade-left"] {
    transform: translateX(-40px);
}

/* Fade right */
[data-animate="fade-right"] {
    transform: translateX(40px);
}

/* Scale up */
[data-animate="scale-up"] {
    transform: scale(0.9);
}

/* Zoom in */
[data-animate="zoom-in"] {
    transform: scale(0.8);
}

/* Stagger children */
[data-animate-stagger] > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-animate-stagger].animated > *:nth-child(1) { transition-delay: 0.1s; }
[data-animate-stagger].animated > *:nth-child(2) { transition-delay: 0.2s; }
[data-animate-stagger].animated > *:nth-child(3) { transition-delay: 0.3s; }
[data-animate-stagger].animated > *:nth-child(4) { transition-delay: 0.4s; }
[data-animate-stagger].animated > *:nth-child(5) { transition-delay: 0.5s; }
[data-animate-stagger].animated > *:nth-child(6) { transition-delay: 0.6s; }
[data-animate-stagger].animated > *:nth-child(7) { transition-delay: 0.7s; }
[data-animate-stagger].animated > *:nth-child(8) { transition-delay: 0.8s; }

[data-animate-stagger].animated > * {
    opacity: 1;
    transform: none;
}

/* Delay modifiers */
[data-animate-delay="100"] { transition-delay: 0.1s !important; }
[data-animate-delay="200"] { transition-delay: 0.2s !important; }
[data-animate-delay="300"] { transition-delay: 0.3s !important; }
[data-animate-delay="400"] { transition-delay: 0.4s !important; }
[data-animate-delay="500"] { transition-delay: 0.5s !important; }

/* ===================================
   Parallax
   =================================== */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

@supports not (background-attachment: fixed) {
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* ===================================
   Keyframe animations
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

/* Hero text animation on load */
.hero-content h1 {
    animation: fadeInUp 0.8s ease forwards;
}

.hero-content p {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

/* Counter animation */
.stat-number-animate {
    display: inline-block;
}

/* Smooth scrollbar */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Respect reduced motion */
@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;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }

    [data-animate-stagger] > * {
        opacity: 1;
        transform: none;
    }
}
