/* Enhanced Animation Styles for JavaScript Interactions */

/* Page Loading Animations */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Animation Classes */
.animate-stagger-1 { animation-delay: 0.1s; }
.animate-stagger-2 { animation-delay: 0.2s; }
.animate-stagger-3 { animation-delay: 0.3s; }
.animate-stagger-4 { animation-delay: 0.4s; }
.animate-stagger-5 { animation-delay: 0.5s; }

/* Enhanced Hover Transitions */
.enhanced-hover {
    transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.enhanced-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* Button Click Animation */
@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn-pressed {
    animation: buttonPress 0.15s ease-in-out;
}

/* Image Reveal Animation */
@keyframes imageReveal {
    from {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

.image-reveal {
    animation: imageReveal 0.6s ease-out;
}

/* Card Flip Effect for Testimonials */
@keyframes cardFlip {
    0% { transform: rotateY(0); }
    50% { transform: rotateY(180deg); }
    100% { transform: rotateY(0); }
}

.card-flip {
    animation: cardFlip 0.8s ease-in-out;
}

/* Pulse Animation for CTAs */
@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(187, 0, 0, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(187, 0, 0, 0);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(187, 0, 0, 0);
        transform: scale(1);
    }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Smooth Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateX(30px);
}

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

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

.page-transition-exit-active {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

/* Enhanced Focus Ring Animation */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(187, 0, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 0 6px rgba(187, 0, 0, 0);
    }
}

.focus-ring-animate {
    animation: focusRing 0.6s ease-out;
}

/* Loading Dots Animation */
@keyframes loadingDots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    80%, 100% { opacity: 0; }
}

.loading-dots span {
    display: inline-block;
    animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Smooth Scroll Indicator */
@keyframes scrollIndicator {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(10px); opacity: 0; }
}

.scroll-indicator {
    animation: scrollIndicator 2s infinite;
}

/* Typewriter Effect */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-primary); }
}

/* Parallax Elements */
.parallax-slow {
    transform: translateY(var(--parallax-offset, 0));
    transition: transform 0.1s ease-out;
}

/* Error Shake Animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.error-shake {
    animation: errorShake 0.5s ease-in-out;
}

/* Success Bounce Animation */
@keyframes successBounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

.success-bounce {
    animation: successBounce 0.8s ease-in-out;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .enhanced-hover:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }
    
    /* Disable some animations on mobile to improve performance */
    .parallax-slow {
        transform: none !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .enhanced-hover:hover {
        transform: none;
        box-shadow: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .focus-ring-animate {
        animation: none;
        outline: 3px solid currentColor;
        outline-offset: 2px;
    }
}

/* Dark Mode Adjustments (future-proofing) */
@media (prefers-color-scheme: dark) {
    :root {
        --shadow-color: rgba(255, 255, 255, 0.1);
    }
    
    .enhanced-hover:hover {
        box-shadow: 0 12px 28px var(--shadow-color);
    }
}
