/* ============================================
   HAPPINESS WELLNESS HUB — Animations & Transitions
   ============================================ */

/* ===== INTERSECTION OBSERVER ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for grid items */
.services-grid .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.services-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.12s; }
.services-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.19s; }
.services-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.26s; }
.services-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.33s; }
.services-grid .animate-on-scroll:nth-child(6) { transition-delay: 0.4s; }

.why-grid .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.why-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.12s; }
.why-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.19s; }
.why-grid .animate-on-scroll:nth-child(4) { transition-delay: 0.26s; }
.why-grid .animate-on-scroll:nth-child(5) { transition-delay: 0.33s; }
.why-grid .animate-on-scroll:nth-child(6) { transition-delay: 0.4s; }

.testimonials-grid .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.testimonials-grid .animate-on-scroll:nth-child(2) { transition-delay: 0.15s; }
.testimonials-grid .animate-on-scroll:nth-child(3) { transition-delay: 0.25s; }

.trust-strip-inner .animate-on-scroll:nth-child(1) { transition-delay: 0.05s; }
.trust-strip-inner .animate-on-scroll:nth-child(3) { transition-delay: 0.15s; }
.trust-strip-inner .animate-on-scroll:nth-child(5) { transition-delay: 0.25s; }

/* ===== HERO ENTRANCE ANIMATIONS ===== */
.hero .hero-text {
    animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

.hero .hero-visual {
    animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s both;
}

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

/* Force hero elements to be visible regardless of scroll observer */
.hero .animate-on-scroll {
    opacity: 0;
    transform: none;
}

/* ===== FLOATING CARD ANIMATIONS ===== */
.hero-floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card-1 { animation-delay: 0s; }
.floating-card-2 { animation-delay: 2s; }
.floating-card-3 { animation-delay: 4s; }

@keyframes floatReverse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(10px) rotate(1deg); }
}

/* ===== SUBTLE HOVER ANIMATIONS ===== */
.service-card {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.5s ease,
                border-color 0.3s ease;
}

.why-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-color 0.3s ease,
                border-color 0.3s ease;
}

.testimonial-card {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

/* ===== GRADIENT SHIMMER EFFECT ===== */
.gradient-text {
    background-size: 200% auto;
    animation: gradientShimmer 4s ease-in-out infinite;
}

@keyframes gradientShimmer {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* ===== BUTTON MICRO-ANIMATIONS ===== */
.btn {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.3s ease;
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

/* ===== SCROLL PROGRESS INDICATOR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 10000;
    transition: width 0.1s linear;
}

/* ===== SECTION LINE ANIMATION ===== */
.section-line {
    transform-origin: center;
    transform: scaleX(0);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
}

.section-header.visible .section-line {
    transform: scaleX(1);
}

/* ===== FAQ ANIMATIONS ===== */
.faq-item {
    transition: background-color 0.3s ease;
}

.faq-question {
    transition: color 0.3s ease;
}

.faq-chevron {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                color 0.3s ease;
}

.faq-answer {
    transition: max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== NAVBAR ANIMATION ===== */
.navbar {
    transition: padding 0.3s ease,
                background-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* ===== STAT COUNTER ANIMATION ===== */
.stat-number {
    transition: transform 0.4s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
}

/* ===== IMAGE REVEAL ANIMATION ===== */
.about-image.visible img,
.founder-image-wrapper.visible img {
    animation: imageReveal 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

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

/* ===== FORM FOCUS ANIMATIONS ===== */
.form-group input,
.form-group select,
.form-group textarea {
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease,
                background-color 0.3s ease;
}

/* ===== SOCIAL LINK HOVER ANIMATION ===== */
.social-link {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== LOADING ANIMATION ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: fadeIn 0.5s ease both;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}
