/* Fade In Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Mobile Menu Animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Scroll-triggered Animation Classes */
.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.animate-fade-in-down {
    opacity: 0;
    animation: fadeInDown 0.6s ease-out forwards;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.animate-scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease-out forwards;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.animate-slide-in-bottom {
    opacity: 0;
    animation: slideInFromBottom 0.8s ease-out forwards;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Staggered Animation Delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-600 { animation-delay: 0.6s; }

/* Focus Ring Animation */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 hsl(var(--ring) / 0.5);
    }
    100% {
        box-shadow: 0 0 0 4px hsl(var(--ring) / 0.2);
    }
}

.focus-ring:focus-visible {
    animation: focusRing 0.3s ease-out forwards;
}

/* Accessibility - Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}