/* ==================== ECOSTYLE – ANIMATIONS STYLESHEET ==================== */
/* Smooth, Hardware-Accelerated, Accessibility-Compliant */

/* ==================== SCROLL REVEAL ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* ==================== WORD REVEAL ANIMATION ==================== */
@keyframes wordReveal {
    0% {
        opacity: 0;
        filter: blur(8px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}

.word-reveal {
    animation: wordReveal 0.8s ease-out forwards;
    will-change: opacity, filter;
}

.word-reveal:nth-child(1) { animation-delay: 0.1s; }
.word-reveal:nth-child(2) { animation-delay: 0.2s; }
.word-reveal:nth-child(3) { animation-delay: 0.3s; }
.word-reveal:nth-child(4) { animation-delay: 0.4s; }
.word-reveal:nth-child(5) { animation-delay: 0.5s; }
.word-reveal:nth-child(6) { animation-delay: 0.6s; }
.word-reveal:nth-child(7) { animation-delay: 0.7s; }
.word-reveal:nth-child(8) { animation-delay: 0.8s; }
.word-reveal:nth-child(9) { animation-delay: 0.9s; }
.word-reveal:nth-child(10) { animation-delay: 1s; }

/* ==================== HERO SUBTITLE & CTA ANIMATIONS ==================== */
.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.8s forwards;
}

.hero-ctas {
    animation: fadeInUp 1s ease-out 1.2s forwards;
}

/* ==================== SCROLL REVEAL FOR SECTIONS ==================== */
.scroll-reveal {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.scroll-reveal.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Staggered delays for multiple elements */
.scroll-reveal:nth-child(1) { animation-delay: 0s; }
.scroll-reveal:nth-child(2) { animation-delay: 0.15s; }
.scroll-reveal:nth-child(3) { animation-delay: 0.3s; }
.scroll-reveal:nth-child(4) { animation-delay: 0.45s; }
.scroll-reveal:nth-child(5) { animation-delay: 0.6s; }
.scroll-reveal:nth-child(6) { animation-delay: 0.75s; }

/* ==================== VALUE CARDS ANIMATION ==================== */
.value-card {
    opacity: 0;
    transform: translateY(40px);
}

.value-card.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

.value-card:nth-child(1) { animation-delay: 0s; }
.value-card:nth-child(2) { animation-delay: 0.15s; }
.value-card:nth-child(3) { animation-delay: 0.3s; }

/* ==================== STAT COUNTER ANIMATION ==================== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-counter {
    animation: countUp 0.6s ease-out forwards;
}

.stat-counter.counting {
    animation: countUp 0.6s ease-out;
}

/* ==================== PRODUCT CARDS ANIMATION ==================== */
.product-card {
    opacity: 0;
    transform: translateY(20px);
}

.product-card.in-view {
    animation: fadeInUp 0.6s ease-out forwards;
}

.product-card:nth-child(1) { animation-delay: 0s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.2s; }
.product-card:nth-child(4) { animation-delay: 0s; }
.product-card:nth-child(5) { animation-delay: 0.1s; }
.product-card:nth-child(6) { animation-delay: 0.2s; }

/* ==================== PRODUCT FAVORITE ANIMATION ==================== */
@keyframes favoriteHeart {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.favorite-btn.active {
    animation: favoriteHeart 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==================== BUTTON ANIMATIONS ==================== */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(74, 155, 93, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(74, 155, 93, 0);
    }
}

.cta-btn:active {
    animation: buttonPulse 0.5s ease-out;
}

/* ==================== CAROUSEL ANIMATIONS ==================== */
@keyframes slideLeftCarousel {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRightCarousel {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.testimonial-card.active {
    animation: slideLeftCarousel 0.5s ease-out;
}

.testimonial-card.prev {
    animation: slideRightCarousel 0.5s ease-out;
}

/* ==================== CIRCULAR PROGRESS ANIMATION ==================== */
@keyframes progressFill {
    from {
        stroke-dashoffset: 282.7;
    }
    to {
        stroke-dashoffset: var(--progress-offset, 0);
    }
}

.circle-progress.animate {
    animation: progressFill 2s ease-out forwards;
}

/* ==================== BRAND STORY ANIMATIONS ==================== */
@keyframes leafDraw {
    from {
        stroke-dasharray: 300;
        stroke-dashoffset: 300;
    }
    to {
        stroke-dasharray: 300;
        stroke-dashoffset: 0;
    }
}

@keyframes waterDrop {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(100px);
    }
}

.leaf-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.leaf-path.animate {
    animation: leafDraw 2s ease-out forwards;
}

.water-drop {
    animation: waterDrop 1.5s ease-in forwards;
}

.water-drop:nth-child(1) { animation-delay: 0s; }
.water-drop:nth-child(2) { animation-delay: 0.3s; }
.water-drop:nth-child(3) { animation-delay: 0.6s; }
.water-drop:nth-child(4) { animation-delay: 0.9s; }
.water-drop:nth-child(5) { animation-delay: 1.2s; }

/* ==================== LOADING SPINNER ==================== */
@keyframes spinLoader {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: spinLoader 0.8s linear infinite;
}

/* ==================== NEWSLETTER FORM ANIMATIONS ==================== */
@keyframes floatLabel {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0.8;
    }
}

.input-wrapper input:focus ~ .floating-label {
    animation: floatLabel 0.3s ease-out forwards;
}

/* ==================== HAMBURGER MENU ANIMATION ==================== */
@keyframes rotateHamburger {
    from {
        transform: rotate(0);
    }
    to {
        transform: rotate(45deg);
    }
}

.hamburger.active span:nth-child(1) {
    animation: rotateHamburger 0.3s ease-out forwards;
}

/* ==================== GRADIENT CANVAS ANIMATION ==================== */
@keyframes gradientShift {
    0% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.8;
    }
}

#gradientCanvas {
    animation: gradientShift 8s ease-in-out infinite;
}

/* ==================== NAVBAR SCROLL EFFECT ==================== */
@keyframes navbarShadow {
    from {
        box-shadow: none;
    }
    to {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }
}

.navbar.scrolled {
    animation: navbarShadow 0.3s ease-out forwards;
}

/* ==================== PARALLAX EFFECT ==================== */
@keyframes parallaxMove {
    0% {
        transform: translateY(0px);
    }
    100% {
        transform: translateY(-50px);
    }
}

.parallax-element {
    will-change: transform;
}

/* ==================== MAGNETIC BUTTON EFFECT ==================== */
@keyframes magneticPull {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(var(--tx, 0), var(--ty, 0));
    }
}

.magnetic-btn {
    will-change: transform;
    transition: all 0.2s ease-out;
}

/* ==================== TILT EFFECT FOR CARDS ==================== */
@keyframes tiltCard {
    0% {
        transform: perspective(1200px) rotateX(0) rotateY(0) scale(1);
    }
    100% {
        transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.02);
    }
}

.product-card.tilting {
    animation: tiltCard 0.4s ease-out forwards;
}

/* ==================== FADE & SCALE ON ENTRY ==================== */
@keyframes entryAnimation {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.entry-animation {
    animation: entryAnimation 0.6s ease-out;
}

/* ==================== BOUNCE ANIMATION ==================== */
@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: gentleBounce 1s ease-in-out;
}

/* ==================== SUCCESS CHECKMARK ANIMATION ==================== */
@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.form-message.success::before {
    content: '✓';
    display: inline-block;
    margin-right: 0.5rem;
    animation: checkmark 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* ==================== STAGGER ANIMATIONS FOR GRIDS ==================== */
.grid-stagger > * {
    opacity: 0;
}

.grid-stagger > *.in-view {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Compute stagger based on grid position */
.grid-stagger > *:nth-child(1) { animation-delay: 0s; }
.grid-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.grid-stagger > *:nth-child(3) { animation-delay: 0.2s; }
.grid-stagger > *:nth-child(4) { animation-delay: 0.3s; }
.grid-stagger > *:nth-child(5) { animation-delay: 0.4s; }
.grid-stagger > *:nth-child(6) { animation-delay: 0.5s; }
.grid-stagger > *:nth-child(7) { animation-delay: 0.6s; }
.grid-stagger > *:nth-child(8) { animation-delay: 0.7s; }
.grid-stagger > *:nth-child(9) { animation-delay: 0.8s; }

/* ==================== SMOOTH PAGE TRANSITION ==================== */
@keyframes pageEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

html {
    animation: pageEnter 0.5s ease-out;
}

/* ==================== FLOATING ANIMATION ==================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* ==================== PULSE ANIMATION ==================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ==================== SHIMMER LOADING ANIMATION ==================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
