/* Animation keyframes */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slide-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

@keyframes rotate-glow {
    0% {
        transform: rotate(0deg);
        box-shadow: 0 0 20px hsla(140, 45%, 35%, 0.3);
    }
    50% {
        transform: rotate(180deg);
        box-shadow: 0 0 30px hsla(140, 60%, 45%, 0.5);
    }
    100% {
        transform: rotate(360deg);
        box-shadow: 0 0 20px hsla(140, 45%, 35%, 0.3);
    }
}

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

/* Animation classes */
.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
    opacity: 0;
}

.animate-fade-out {
    animation: fade-out 0.6s ease-out forwards;
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    opacity: 0;
}

.animate-slide-in-right {
    animation: slide-in-right 0.5s ease-out forwards;
    opacity: 0;
}

.animate-slide-out-right {
    animation: slide-out-right 0.5s ease-out forwards;
}

.animate-slide-in-left {
    animation: slide-in-left 0.5s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scale-in 0.4s ease-out forwards;
    opacity: 0;
}

.animate-scale-out {
    animation: scale-out 0.4s ease-out forwards;
}

/* Hover animations */
.hover-float:hover {
    animation: float 1s ease-in-out;
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 25px hsla(140, 45%, 35%, 0.4);
}

/* Loading animations */
.loading-spinner {
    animation: rotate-glow 2s linear infinite;
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        transparent,
        hsla(140, 45%, 35%, 0.1),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Stagger animations for lists */
.stagger-fade-in > * {
    animation: fade-in 0.6s ease-out forwards;
    opacity: 0;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }

/* Page transitions */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease-out;
}

.page-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in;
}

/* Form animations */
.form-step-enter {
    opacity: 0;
    transform: translateX(50px);
}

.form-step-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s ease-out;
}

.form-step-exit {
    opacity: 1;
    transform: translateX(0);
}

.form-step-exit-active {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.3s ease-in;
}

/* Button animations */
.btn-animate-press {
    transition: transform 0.1s ease;
}

.btn-animate-press:active {
    transform: scale(0.98);
}

/* Progress animations */
.progress-fill {
    transition: width 0.5s ease-out;
}

/* Decoration animations */
.cta-decoration-1,
.cta-decoration-2,
.cta-decoration-3 {
    animation: float 4s ease-in-out infinite;
}

.cta-decoration-2 {
    animation-delay: 1s;
}

.cta-decoration-3 {
    animation-delay: 2s;
}

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

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .animate-float {
        animation: none;
    }
    
    .hover-scale:hover {
        transform: none;
    }
    
    .hover-glow:hover {
        box-shadow: none;
    }
}

/* Performance optimizations */
.animate-fade-in,
.animate-bounce-in,
.animate-slide-in-right,
.animate-slide-in-left,
.animate-scale-in {
    will-change: transform, opacity;
}

.animate-float,
.animate-pulse {
    will-change: transform;
}

.loading-spinner {
    will-change: transform, box-shadow;
}

/* Remove will-change after animation completes */
.animation-complete {
    will-change: auto;
}