/* =========================================
   Animations - Leak Detect Theme
   ========================================= */

/* Base Animation Classes - Smooth gradual in-place appearance */
.ld-animate {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1), transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}

.ld-animate.is-visible {
    opacity: 1;
    transform: translate(0, 0) !important;
}

/* Fade Up - Subtle vertical motion */
.ld-animate[data-animation="fade-up"] {
    transform: translateY(15px);
}

/* Fade Down - Subtle vertical motion */
.ld-animate[data-animation="fade-down"] {
    transform: translateY(-15px);
}

/* Fade Right - Converted to pure gradual fade-in to prevent side displacement */
.ld-animate[data-animation="fade-right"] {
    transform: none;
}

/* Fade Left - Converted to pure gradual fade-in to prevent side displacement */
.ld-animate[data-animation="fade-left"] {
    transform: none;
}

/* Fade In - Pure gradual fade */
.ld-animate[data-animation="fade-in"] {
    transform: none;
}

/* Zoom In - Subtle smooth scale */
.ld-animate[data-animation="zoom-in"] {
    transform: scale(0.97);
}

/* Mobile & Tablet: Completely disable animations, transitions and delays to prevent overlap and layout shift */
@media (max-width: 992px) {
    .ld-animate,
    .ld-animate[data-animation="fade-up"],
    .ld-animate[data-animation="fade-down"],
    .ld-animate[data-animation="fade-right"],
    .ld-animate[data-animation="fade-left"],
    .ld-animate[data-animation="fade-in"],
    .ld-animate[data-animation="zoom-in"] {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
        will-change: auto !important;
        transition-delay: 0s !important;
        animation-delay: 0s !important;
    }

    .ld-hero__slide .ld-hero__badge,
    .ld-hero__slide .ld-hero__title,
    .ld-hero__slide .ld-hero__desc,
    .ld-hero__slide .ld-hero__buttons,
    .ld-hero__slide .ld-hero__trust {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
        transition-delay: 0s !important;
        animation-delay: 0s !important;
    }

    .ld-float,
    .ld-pulse,
    .ld-shine::after,
    .ld-hero__particle,
    .ld-hero__particle--1,
    .ld-hero__particle--2,
    .ld-hero__particle--3 {
        animation: none !important;
        transform: none !important;
    }

    .ld-hero__particles {
        display: none !important;
    }

    /* Disable hover transforms on touch screens */
    .ld-services__card:hover,
    .ld-features__item:hover,
    .ld-pricing__card:hover,
    .ld-testimonials__card:hover,
    .ld-contact__form-card:hover {
        transform: none !important;
    }
}

/* Reduced Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ld-animate,
    [data-animation],
    .ld-hero__slide .ld-hero__badge,
    .ld-hero__slide .ld-hero__title,
    .ld-hero__slide .ld-hero__desc,
    .ld-hero__slide .ld-hero__buttons,
    .ld-hero__slide .ld-hero__trust {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    .ld-float,
    .ld-pulse,
    .ld-shine::after,
    .ld-hero__particle {
        animation: none !important;
        transform: none !important;
    }
}

/* =========================================
   Counter Animation
   ========================================= */
.ld-counter {
    display: inline-block;
}

/* =========================================
   Slide Animations (Hero Section Texts)
   ========================================= */
.ld-hero__slide .ld-hero__badge,
.ld-hero__slide .ld-hero__title,
.ld-hero__slide .ld-hero__desc,
.ld-hero__slide .ld-hero__buttons,
.ld-hero__slide .ld-hero__trust {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.ld-hero__slide.is-active .ld-hero__badge {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.ld-hero__slide.is-active .ld-hero__title {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.ld-hero__slide.is-active .ld-hero__desc {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.ld-hero__slide.is-active .ld-hero__buttons {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.ld-hero__slide.is-active .ld-hero__trust {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* =========================================
   Hover Effects
   ========================================= */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

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

/* Pulse Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

/* Shine Effect */
@keyframes shine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

.ld-shine {
    position: relative;
    overflow: hidden;
}

.ld-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shine 3s infinite;
}

/* Water Drop Animation */
@keyframes waterDrop {
    0% { transform: translateY(-100px) scaleY(0.5); opacity: 0; }
    30% { opacity: 1; transform: translateY(0) scaleY(1); }
    50% { transform: translateY(10px) scaleY(0.9) scaleX(1.1); }
    65% { transform: translateY(-5px) scaleY(1.05) scaleX(0.95); }
    80% { transform: translateY(3px) scaleY(0.98); }
    100% { transform: translateY(0) scaleY(1) scaleX(1); }
}

/* Typewriter Effect */
@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--ld-primary); }
}

/* Scale In */
@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Slide In Right (for RTL) - Converted to fade to prevent horizontal scroll */
@keyframes slideInRight {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Rotate */
@keyframes rotate360 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bounce */
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
