/**
 * Do It All Demo - Animations
 * 
 * Professional scroll-triggered animations and micro-interactions
 * 
 * @package DoItAllDemo
 * @since 1.0.0
 */

/* ==========================================================================
   Animation Base States
   Elements start hidden/offset, then animate in when visible
   ========================================================================== */

.animate-fade-up,
.animate-fade-down,
.animate-fade-left,
.animate-fade-right,
.animate-slide-right,
.animate-scale-up,
.animate-counter {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-fade-up {
    transform: translateY(40px);
}

.animate-fade-down {
    transform: translateY(-40px);
}

.animate-fade-left {
    transform: translateX(40px);
}

.animate-fade-right {
    transform: translateX(-40px);
}

.animate-slide-right {
    transform: translateX(-60px);
}

.animate-scale-up {
    transform: scale(0.9);
}

/* ==========================================================================
   Animation Active States
   Applied when elements enter viewport
   ========================================================================== */

.animate-fade-up.is-visible,
.animate-fade-down.is-visible,
.animate-fade-left.is-visible,
.animate-fade-right.is-visible,
.animate-slide-right.is-visible,
.animate-scale-up.is-visible,
.animate-counter.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Animation Delays */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="700"] { transition-delay: 0.7s; }
[data-delay="800"] { transition-delay: 0.8s; }

/* ==========================================================================
   Button Hover Animations
   ========================================================================== */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Card Hover Animations
   ========================================================================== */

.card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(27, 54, 93, 0.15);
}

/* Service scope cards with icon animation */
.service-scope__item:hover .service-scope__icon {
    transform: scale(1.1) rotate(5deg);
}

.service-scope__icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-scope__icon svg {
    transition: stroke 0.3s ease;
}

.service-scope__item:hover .service-scope__icon svg {
    stroke: var(--color-amber-accent);
}

/* ==========================================================================
   Link Animations
   ========================================================================== */

.service-scope__item h3,
.service-benefits__item h4 {
    position: relative;
    display: inline-block;
}

.service-scope__item h3::after,
.service-benefits__item h4::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-amber-accent);
    transition: width 0.3s ease;
}

.service-scope__item:hover h3::after,
.service-benefits__item:hover h4::after {
    width: 100%;
}

/* ==========================================================================
   Process Timeline Animations
   ========================================================================== */

.service-process__step {
    position: relative;
}

.service-process__number {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s ease,
                color 0.3s ease;
}

.service-process__step:hover .service-process__number {
    transform: scale(1.15);
    background-color: var(--color-amber-accent);
    color: var(--color-clean-white);
}

/* Line animation for timeline */
.service-process__timeline::before {
    transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Stats Counter Animation
   ========================================================================== */

.service-benefits__stat {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-benefits__stat:hover {
    transform: scale(1.05);
}

.service-benefits__stat-number {
    transition: color 0.3s ease;
}

.service-benefits__stat:hover .service-benefits__stat-number {
    color: var(--color-amber-accent);
}

/* ==========================================================================
   Hero Background Parallax Effect
   ========================================================================== */

.service-hero__background {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ==========================================================================
   Trust Items Stagger Animation
   ========================================================================== */

.service-hero__trust-item {
    opacity: 0;
    transform: translateY(20px);
    animation: trustItemFadeIn 0.5s ease forwards;
}

.service-hero__trust-item:nth-child(1) { animation-delay: 0.6s; }
.service-hero__trust-item:nth-child(2) { animation-delay: 0.7s; }
.service-hero__trust-item:nth-child(3) { animation-delay: 0.8s; }

@keyframes trustItemFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Pricing Card Animations
   ========================================================================== */

.service-pricing__card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-pricing__card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.service-pricing__card--featured {
    transform: scale(1.05);
}

.service-pricing__card--featured:hover {
    transform: translateY(-12px) scale(1.08);
}

.service-pricing__badge {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

/* Pricing feature checkmarks */
.service-pricing__features li {
    opacity: 0;
    transform: translateX(-20px);
    animation: featureFadeIn 0.4s ease forwards;
}

.service-pricing__card.is-visible .service-pricing__features li:nth-child(1) { animation-delay: 0.1s; }
.service-pricing__card.is-visible .service-pricing__features li:nth-child(2) { animation-delay: 0.15s; }
.service-pricing__card.is-visible .service-pricing__features li:nth-child(3) { animation-delay: 0.2s; }
.service-pricing__card.is-visible .service-pricing__features li:nth-child(4) { animation-delay: 0.25s; }
.service-pricing__card.is-visible .service-pricing__features li:nth-child(5) { animation-delay: 0.3s; }

@keyframes featureFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   FAQ Hover Effects
   ========================================================================== */

.service-faq__item {
    transition: transform 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    border-left: 4px solid transparent;
    padding-left: var(--space-md);
}

.service-faq__item:hover {
    transform: translateX(8px);
    border-left-color: var(--color-amber-accent);
}

/* ==========================================================================
   CTA Section Animation
   ========================================================================== */

.service-cta__content {
    animation: ctaFloat 6s ease-in-out infinite;
}

@keyframes ctaFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   Icon Hover Animations
   ========================================================================== */

.service-benefits__icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s ease;
}

.service-benefits__item:hover .service-benefits__icon {
    transform: scale(1.15) rotate(-5deg);
    background-color: var(--color-amber-accent);
}

.service-benefits__item:hover .service-benefits__icon svg {
    stroke: var(--color-clean-white);
}

/* ==========================================================================
   Guarantee Card Animation
   ========================================================================== */

.service-benefits__guarantee {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.service-benefits__guarantee::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.service-benefits__guarantee:hover::before {
    left: 100%;
}

.service-benefits__guarantee:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(27, 54, 93, 0.2);
}

.service-benefits__guarantee-icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-benefits__guarantee:hover .service-benefits__guarantee-icon {
    transform: scale(1.1);
}

/* ==========================================================================
   Scroll Progress Indicator (optional)
   ========================================================================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--color-amber-accent);
    z-index: 9999;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s linear;
}

/* ==========================================================================
   Loading Animation for Images
   ========================================================================== */

.service-showcase__image {
    position: relative;
    overflow: hidden;
}

.service-showcase__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: imageShimmer 2s infinite;
}

@keyframes imageShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

/* ==========================================================================
   Reasons Grid Animations
   ========================================================================== */

.service-reasons__item {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s ease;
}

.service-reasons__item:hover {
    transform: translateY(-8px);
    background-color: var(--color-clean-white);
}

.service-reasons__icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                color 0.3s ease;
}

.service-reasons__item:hover .service-reasons__icon {
    transform: scale(1.2);
    color: var(--color-amber-accent);
}

/* ==========================================================================
   Ideal For Grid Animations
   ========================================================================== */

.service-ideal__item {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--color-clean-white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.service-ideal__item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(27, 54, 93, 0.15);
}

.service-ideal__icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--color-amber-accent);
}

.service-ideal__item:hover .service-ideal__icon {
    transform: scale(1.15) rotate(5deg);
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-fade-up,
    .animate-fade-down,
    .animate-fade-left,
    .animate-fade-right,
    .animate-slide-right,
    .animate-scale-up,
    .animate-counter {
        opacity: 1;
        transform: none;
    }
}
