/* Scroll-triggered animations for Axis IT Solutions */
/* ==========================================================================
   Base Animation State
   ========================================================================== */
[data-animate] {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform, opacity;
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
}

/* ==========================================================================
   Animation Directions & Types
   ========================================================================== */
/* Fade In */
.fade-in {
    opacity: 0;
}
.fade-in.animated {
    opacity: 1;
}

/* Fade In Up */
.fade-in-up {
    transform: translateY(40px);
}

/* Fade In Down */
.fade-in-down {
    transform: translateY(-40px);
}

/* Fade In Left */
.fade-in-left {
    transform: translateX(-40px);
}

/* Fade In Right */
.fade-in-right {
    transform: translateX(40px);
}

/* Scale In */
.scale-in {
    transform: scale(0.9);
}

/* Scale In Up */
.scale-in-up {
    transform: scale(0.9) translateY(30px);
}

/* Slide In Left (larger distance) */
.slide-in-left {
    transform: translateX(-100px);
}

/* Slide In Right (larger distance) */
.slide-in-right {
    transform: translateX(100px);
}

/* Rotate In */
.rotate-in {
    transform: rotate(-10deg) scale(0.9);
}

/* Bounce In (using keyframes applied on .animated state) */
.bounce-in {
    opacity: 0;
}
.bounce-in.animated {
    animation: bounceIn 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

/* Text Reveal (clip path) */
.text-reveal {
    clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1);
    opacity: 1; /* Reset opacity for clip-path */
}
.text-reveal.animated {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

/* Counter */
.counter-animate {
    opacity: 0;
    transform: translateY(20px);
}

/* ==========================================================================
   Staggered 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; }
.stagger-7 { transition-delay: 0.7s; }
.stagger-8 { transition-delay: 0.8s; }
.stagger-9 { transition-delay: 0.9s; }
.stagger-10 { transition-delay: 1.0s; }

/* Override transition delays for elements with bounce-in or other keyframe animations */
[data-animate].animated.stagger-1 { animation-delay: 0.1s; }
[data-animate].animated.stagger-2 { animation-delay: 0.2s; }
[data-animate].animated.stagger-3 { animation-delay: 0.3s; }

/* ==========================================================================
   Keyframes
   ========================================================================== */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(28, 103, 134, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(28, 103, 134, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(28, 103, 134, 0); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

/* ==========================================================================
   Hover Animations
   ========================================================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(28, 103, 134, 0.5);
}

.hover-rotate {
    transition: transform 0.3s ease;
}
.hover-rotate:hover {
    transform: rotate(3deg) scale(1.02);
}

/* ==========================================================================
   Continuous Animations
   ========================================================================== */
.pulse {
    animation: pulse 2s infinite;
}

.float {
    animation: float 4s ease-in-out infinite;
}

.shimmer {
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

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

@media (max-width: 768px) {
    /* Disable fixed attachment on mobile for better performance */
    .parallax-bg {
        background-attachment: scroll;
    }
}

/* ==========================================================================
   Reduced Motion Accessibility
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .parallax-bg {
        background-attachment: scroll !important;
    }
}
