/* Lead Chat Olivia Comercial (public) */

#lead-chat {
    z-index: 99999;
}

#lead-chat-panel {
    width: 395px;
    height: 520px;

    /* Allow resizing by dragging the border/corner */
    resize: both;
    overflow: hidden;

    /* Keep it usable */
    min-width: 320px;
    min-height: 420px;
    max-width: 92vw;
    max-height: 80vh;
}

@media (max-width: 640px) {
    #lead-chat-panel {
        width: 92vw;
        height: 60vh;
        right: 8px;

        /* On mobile, resizing is often awkward; keep the panel stable */
        resize: none;
    }
}

/* loading / thinking shimmer */
.thinking {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.06) 25%,
            rgba(255, 255, 255, 0.14) 50%,
            rgba(255, 255, 255, 0.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite linear;
    color: transparent;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Speech bubble floating button (transparent background, white border, small tail) */
.speech-bubble {
    position: relative;
    background: transparent;
    border-radius: .4em;
    border: 2px solid #fff;
}

.speech-bubble:after,
#lead-chat-button:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

#lead-chat {
    border-radius: .4em;
    border: 2px solid #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Edge flash effect when the assistant triggers scroll-lp */
#lead-scroll-edge-flash {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99998;
    opacity: 0;
    background:
        linear-gradient(to bottom, rgba(255, 0, 43, 0.55), rgba(255, 0, 43, 0) 28%),
        linear-gradient(to top, rgba(255, 0, 43, 0.55), rgba(255, 0, 43, 0) 28%),
        linear-gradient(to right, rgba(255, 0, 43, 0.45), rgba(255, 0, 43, 0) 22%),
        linear-gradient(to left, rgba(255, 0, 43, 0.45), rgba(255, 0, 43, 0) 22%);
}

#lead-scroll-edge-flash.is-active {
    animation: leadEdgeFlash 900ms ease-out;
}

@keyframes leadEdgeFlash {
    0% { opacity: 0; }
    18% { opacity: 1; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    #lead-scroll-edge-flash.is-active {
        animation: none;
        opacity: 0;
    }
}
