/* Progressive Enhancement Animations
 * Text loads immediately, animations enhance the experience
 * Applies only when JavaScript is available
 */

/* CRITICAL: Override the hardcoded opacity:0 in scroll-animations.css */
/* Default state: Everything visible, especially hero content */
.hero .hero-content,
.topic-hero .hero-content,
.hero-content,
.animate-fade-in,
.animate-slide-up,
.animate-slide-down,
.animate-slide-left,
.animate-slide-right,
.animate-scale-in,
.animate-stagger {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* Also ensure nested elements in hero are visible */
.hero-content h1,
.hero-content .services-list,
.hero-content .topic-description,
.hero-content .trust-badges,
.hero-content .hero-buttons {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
}

/* Only hide elements when JS is available and animations are ready */
.js-animations-ready .animate-fade-in:not(.animate-visible),
.js-animations-ready .animate-slide-up:not(.animate-visible),
.js-animations-ready .animate-slide-down:not(.animate-visible),
.js-animations-ready .animate-slide-left:not(.animate-visible),
.js-animations-ready .animate-slide-right:not(.animate-visible),
.js-animations-ready .animate-scale-in:not(.animate-visible),
.js-animations-ready .animate-stagger:not(.animate-visible),
.js-animations-ready .hero-content:not(.animate-visible) {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animation states when JS is ready */
.js-animations-ready .animate-slide-up:not(.animate-visible) {
    transform: translateY(30px);
}

.js-animations-ready .animate-slide-down:not(.animate-visible) {
    transform: translateY(-30px);
}

.js-animations-ready .animate-slide-left:not(.animate-visible) {
    transform: translateX(30px);
}

.js-animations-ready .animate-slide-right:not(.animate-visible) {
    transform: translateX(-30px);
}

.js-animations-ready .animate-scale-in:not(.animate-visible) {
    transform: scale(0.95);
}

.js-animations-ready .animate-stagger:not(.animate-visible) {
    transform: translateY(20px);
}

.js-animations-ready .hero-content:not(.animate-visible) {
    transform: translateY(30px);
}

/* Visible state animations */
.js-animations-ready .animate-visible {
    opacity: 1 !important;
    transform: none !important;
}

/* Stagger delays only when JS is ready */
.js-animations-ready .animate-stagger:nth-child(1) { transition-delay: 0.1s; }
.js-animations-ready .animate-stagger:nth-child(2) { transition-delay: 0.2s; }
.js-animations-ready .animate-stagger:nth-child(3) { transition-delay: 0.3s; }
.js-animations-ready .animate-stagger:nth-child(4) { transition-delay: 0.4s; }
.js-animations-ready .animate-stagger:nth-child(5) { transition-delay: 0.5s; }
.js-animations-ready .animate-stagger:nth-child(6) { transition-delay: 0.6s; }
.js-animations-ready .animate-stagger:nth-child(7) { transition-delay: 0.7s; }
.js-animations-ready .animate-stagger:nth-child(8) { transition-delay: 0.8s; }
.js-animations-ready .animate-stagger:nth-child(9) { transition-delay: 0.9s; }

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
    .js-animations-ready .animate-fade-in,
    .js-animations-ready .animate-slide-up,
    .js-animations-ready .animate-slide-down,
    .js-animations-ready .animate-slide-left,
    .js-animations-ready .animate-slide-right,
    .js-animations-ready .animate-scale-in,
    .js-animations-ready .animate-stagger,
    .js-animations-ready .hero-content {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}