/**
 * Animations CSS
 * This file contains animation keyframes and classes for all scroll-triggered animations
 */

/* Base animation setup */
[data-animation] {
    opacity: 0;
    will-change: transform, opacity;
    visibility: hidden;
}

[data-animation].animate {
    animation-fill-mode: forwards;
    visibility: visible;
}

/* Animation durations */
.animate {
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Reveal section animation */
.reveal-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.8s ease;
}

.reveal-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in.animate {
    animation-name: fadeIn;
}

/* Fade-up animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up.animate {
    animation-name: fadeUp;
}

/* Fade-down animation */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-down.animate {
    animation-name: fadeDown;
}

/* Fade-left animation */
@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-left.animate {
    animation-name: fadeLeft;
}

/* Fade-right animation */
@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-right.animate {
    animation-name: fadeRight;
}

/* Zoom-in animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in.animate {
    animation-name: zoomIn;
}

/* Zoom-out animation */
@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.2);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-out.animate {
    animation-name: zoomOut;
}

/* Flip animation */
@keyframes flip {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0deg);
    }
}

.flip.animate {
    animation-name: flip;
    backface-visibility: hidden;
}

/* Float animation (for continuous effects) */
@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
    animation-fill-mode: both;
}

/* Pulse animation (for attention grabbing) */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
    animation-fill-mode: both;
}

/* Stagger container adjustments */
[data-stagger] [data-stagger-item] {
    opacity: 0;
}

/* For smaller screens, make animations subtler */
@media (max-width: 768px) {
    [data-animation].animate {
        animation-duration: 0.6s;
    }
    
    @keyframes fadeUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes fadeLeft {
        from {
            opacity: 0;
            transform: translateX(-30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    @keyframes fadeRight {
        from {
            opacity: 0;
            transform: translateX(30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
}

/* For users who prefer reduced motion */
@media (prefers-reduced-motion) {
    [data-animation] {
        transition: opacity 0.5s ease;
        transform: none !important;
    }
    
    [data-animation].animate {
        animation: none !important;
        opacity: 1;
    }
    
    .reveal-section {
        transform: none !important;
        transition: opacity 0.5s ease;
    }
    
    .animate-float, .animate-pulse {
        animation: none !important;
    }
}
