/**
 * CSS Animations
 * Theme: Sudhanva
 * Purpose: Replace WOW.js and Animate.css with performant CSS animations
 */

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Up */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Down */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Zoom Out */
@keyframes zoomOut {
    from {
        opacity: 0;
        transform: scale(1.2);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce In */
@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);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

/* ========================================
   BASE ANIMATION CLASSES
   ======================================== */

/* Base class for all animated elements */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* When element is animated */
.animate-on-scroll.animated {
    animation-duration: 0.6s;
    animation-fill-mode: both;
    animation-timing-function: ease-out;
}

/* ========================================
   ANIMATION UTILITY CLASSES
   ======================================== */

/* Fade animations */
.fadeIn {
    animation-name: fadeIn;
}

.fadeInUp {
    animation-name: fadeInUp;
}

.fadeInDown {
    animation-name: fadeInDown;
}

.fadeInLeft {
    animation-name: fadeInLeft;
}

.fadeInRight {
    animation-name: fadeInRight;
}

/* Slide animations */
.slideInLeft {
    animation-name: slideInLeft;
}

.slideInRight {
    animation-name: slideInRight;
}

.slideInUp {
    animation-name: slideInUp;
}

.slideInDown {
    animation-name: slideInDown;
}

/* Zoom animations */
.zoomIn {
    animation-name: zoomIn;
}

.zoomOut {
    animation-name: zoomOut;
}

/* Bounce animation */
.bounceIn {
    animation-name: bounceIn;
}

/* Rotate animation */
.rotateIn {
    animation-name: rotateIn;
}

/* ========================================
   ANIMATION DURATION MODIFIERS
   ======================================== */

.animate-fast {
    animation-duration: 0.3s !important;
}

.animate-normal {
    animation-duration: 0.6s !important;
}

.animate-slow {
    animation-duration: 1s !important;
}

.animate-slower {
    animation-duration: 1.5s !important;
}

/* ========================================
   ANIMATION DELAY MODIFIERS
   ======================================== */

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

.animate-delay-5 {
    animation-delay: 0.5s;
}

.animate-delay-6 {
    animation-delay: 0.6s;
}

.animate-delay-7 {
    animation-delay: 0.7s;
}

.animate-delay-8 {
    animation-delay: 0.8s;
}

.animate-delay-9 {
    animation-delay: 0.9s;
}

.animate-delay-10 {
    animation-delay: 1s;
}

/* ========================================
   FALLBACKS
   ======================================== */

/* Fallback for browsers without Intersection Observer */
.no-js .animate-on-scroll {
    opacity: 1;
}

/* Fallback for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        animation: none !important;
        transition: none !important;
    }
}

/* Print styles - no animations */
@media print {
    .animate-on-scroll {
        opacity: 1;
        animation: none !important;
    }
}

/* ========================================
   LEGACY WOW.JS COMPATIBILITY
   These classes map old WOW.js classes to new animations
   ======================================== */

.wow {
    opacity: 0;
}

.wow.animated {
    opacity: 1;
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

/* Map common WOW.js animation names */
.wow.fadeIn {
    animation-name: fadeIn;
}

.wow.fadeInUp {
    animation-name: fadeInUp;
}

.wow.fadeInDown {
    animation-name: fadeInDown;
}

.wow.fadeInLeft {
    animation-name: fadeInLeft;
}

.wow.fadeInRight {
    animation-name: fadeInRight;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Use will-change for better performance on animated elements */
.animate-on-scroll {
    will-change: opacity, transform;
}

.animate-on-scroll.animated {
    will-change: auto;
}

/* Hardware acceleration */
.animate-on-scroll {
    backface-visibility: hidden;
    perspective: 1000px;
}
