/* ============================================================
   HZX LABS — ANIMATIONS (animations.css)
   Keyframes, Transitions, and Scroll Reveals
   ============================================================ */

/* --- Shimmer / Gradient Animation --- */
@keyframes shimmer {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 200% center;
    }
}

/* --- Floating Animations --- */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes float-delay {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes float-reverse {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(15px);
    }
}

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

.animate-float-delay {
    animation: float-delay 7s ease-in-out infinite;
    animation-delay: 2s;
}

.animate-float-reverse {
    animation: float-reverse 8s ease-in-out infinite;
    animation-delay: 1s;
}

/* --- Pulse / Ping --- */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.animate-pulse-ring {
    animation: pulse-ring 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* --- Typewriter Effect --- */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-start infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* --- Marquee (Infinite Scroll) --- */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* Assuming content is doubled */
}

.animate-marquee {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

/* --- Preloader --- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-progress {
    width: 200px;
    height: 2px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.preloader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--color-accent);
    transition: width 0.1s ease;
}

/* --- GSAP Scroll Reveals (Initial States) --- */
.reveal,
.reveal-l,
.reveal-r {
    opacity: 0;
    visibility: hidden;
    /* Prevent interaction before reveal */
}

.reveal {
    transform: translateY(40px);
}

.reveal-l {
    transform: translateX(-40px);
}

.reveal-r {
    transform: translateX(40px);
}

/* Override visibility for JS-disabled clients via <noscript> tag in HTML */
noscript .reveal,
noscript .reveal-l,
noscript .reveal-r {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* --- Dynamic Height Scale (For Estimator Bars) --- */
@keyframes heightScale {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

.animate-height {
    transform-origin: bottom;
    animation: heightScale 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* --- Chatbot Widget Animations --- */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
        pointer-events: none;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.chatbot-panel {
    display: none;
    /* Initially hidden */
}

.chatbot-panel.open {
    display: flex;
    animation: slideUpFade 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Chat typing dots */
.typing-dots span {
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}