/* =========================================================
   CATALYST AI FLOATING ASSISTANT
   ========================================================= */

.catalyst-assistant {
    position: fixed;
    right: 28px;
    bottom: 24px;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 82px;
    height: 82px;

    margin: 0;
    padding: 0;
}

.catalyst-assistant-button {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 76px;
    height: 76px;

    min-width: 76px;
    min-height: 76px;
    max-width: 76px;
    max-height: 76px;

    margin: 0;
    padding: 6px;

    border:
        1px solid rgba(75, 190, 255, 0.7);
    border-radius: 50%;

    overflow: visible;

    cursor: pointer;

    background:
        linear-gradient(
            145deg,
            rgba(7, 38, 72, 0.96),
            rgba(21, 13, 58, 0.98)
        );

    box-shadow:
        0 15px 38px rgba(0, 0, 0, 0.5),
        0 0 24px rgba(45, 170, 255, 0.35),
        0 0 42px rgba(151, 66, 255, 0.22);

    animation:
        catalystBotFloat
        3.5s
        ease-in-out
        infinite;

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.catalyst-assistant-button:hover {
    border-color: #53e4ff;

    transform: scale(1.09);

    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.55),
        0 0 30px rgba(45, 180, 255, 0.48),
        0 0 50px rgba(151, 66, 255, 0.3);

    animation-play-state: paused;
}

.catalyst-assistant-button:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 4px rgba(68, 221, 255, 0.18),
        0 0 32px rgba(45, 180, 255, 0.5);
}

/* Force the chatbot image to stay small. */

.catalyst-assistant-button img {
    position: relative;
    z-index: 3;

    display: block;

    width: 62px !important;
    height: 62px !important;

    min-width: 62px !important;
    min-height: 62px !important;

    max-width: 62px !important;
    max-height: 62px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 50%;

    object-fit: contain;

    pointer-events: none;
    user-select: none;
}

.assistant-pulse {
    position: absolute;
    inset: -7px;

    z-index: 1;

    border:
        1px solid rgba(67, 201, 255, 0.45);
    border-radius: 50%;

    pointer-events: none;

    animation:
        catalystBotPulse
        2.8s
        ease-out
        infinite;
}

.assistant-status {
    position: absolute;

    right: 4px;
    bottom: 6px;

    z-index: 5;

    width: 14px;
    height: 14px;

    border:
        3px solid #071326;
    border-radius: 50%;

    background: #46e884;

    box-shadow:
        0 0 11px rgba(70, 232, 132, 0.8);
}

/* Tooltip */

.assistant-tooltip {
    position: absolute;

    right: 91px;
    top: 50%;

    z-index: 4;

    width: max-content;

    margin: 0;
    padding: 9px 13px;

    border:
        1px solid rgba(67, 157, 230, 0.5);
    border-radius: 9px;

    color: #e3f2ff;

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 12px;
    line-height: 1;

    white-space: nowrap;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    background:
        rgba(4, 22, 43, 0.98);

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.45);

    transform:
        translateY(-50%)
        translateX(8px);

    transition:
        opacity 160ms ease,
        visibility 160ms ease,
        transform 160ms ease;
}

.catalyst-assistant:hover
.assistant-tooltip {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(-50%)
        translateX(0);
}

/* =========================================================
   ASSISTANT PREVIEW WINDOW
   ========================================================= */

.assistant-message {
    position: fixed;

    right: 28px;
    bottom: 119px;

    z-index: 9998;

    display: block;

    width:
        min(
            370px,
            calc(100vw - 36px)
        );

    margin: 0;
    padding: 0;

    overflow: hidden;

    border:
        1px solid rgba(54, 165, 244, 0.62);
    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            rgba(7, 28, 53, 0.99),
            rgba(8, 13, 35, 0.99)
        );

    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.6),
        0 0 34px rgba(45, 160, 244, 0.17);

    opacity: 0;

    transform:
        translateY(14px)
        scale(0.96);

    transform-origin:
        bottom right;
}

.assistant-message[hidden] {
    display: none !important;
}

.assistant-message.visible {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);

    animation:
        catalystAssistantOpen
        180ms
        ease-out;
}

.assistant-message.closing {
    opacity: 0;

    transform:
        translateY(12px)
        scale(0.97);

    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.assistant-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin: 0;
    padding: 17px 18px;

    border-bottom:
        1px solid rgba(52, 103, 151, 0.34);

    background:
        linear-gradient(
            90deg,
            rgba(29, 109, 181, 0.18),
            rgba(111, 48, 179, 0.12)
        );
}

.assistant-message-header > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.assistant-message-header span {
    color: #48ddff;

    font-size: 8px;
    letter-spacing: 1.8px;
}

.assistant-message-header strong {
    color: #edf6ff;

    font-size: 15px;
    font-weight: 500;
}

.assistant-message-header button {
    display: grid;
    place-items: center;

    width: 32px;
    height: 32px;

    min-width: 32px;

    margin: 0;
    padding: 0;

    border:
        1px solid rgba(72, 132, 187, 0.48);
    border-radius: 50%;

    color: #9dafc2;

    font-size: 21px;
    line-height: 1;

    cursor: pointer;

    background:
        rgba(8, 36, 63, 0.65);
}

.assistant-message-header button:hover {
    color: #ffffff;

    border-color: #45ddff;
}

.assistant-message-body {
    margin: 0;
    padding: 19px 18px 17px;
}

.assistant-message-body p {
    margin: 0 0 9px;

    color: #f0f6ff;

    font-size: 15px;
    font-weight: 500;
}

.assistant-message-body span {
    display: block;

    color: #91a4b9;

    font-size: 11px;
    line-height: 1.65;
}

.assistant-coming-soon {
    display: flex;
    align-items: center;
    gap: 8px;

    margin: 0 18px 18px;
    padding: 10px 12px;

    border:
        1px solid rgba(143, 72, 221, 0.36);
    border-radius: 9px;

    color: #c49aef;

    font-size: 9px;
    letter-spacing: 1px;

    background:
        rgba(69, 29, 105, 0.25);
}

.assistant-live-dot {
    display: block;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #4ae18a;

    box-shadow:
        0 0 9px rgba(74, 225, 138, 0.75);
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes catalystBotFloat {
    0%,
    100% {
        transform:
            translateY(0);
    }

    42%,
    58% {
        transform:
            translateY(-9px);
    }
}

@keyframes catalystBotPulse {
    0% {
        opacity: 0.75;

        transform:
            scale(0.88);
    }

    70%,
    100% {
        opacity: 0;

        transform:
            scale(1.24);
    }
}

@keyframes catalystAssistantOpen {
    from {
        opacity: 0;

        transform:
            translateY(14px)
            scale(0.96);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {
    .catalyst-assistant {
        right: 15px;
        bottom: 15px;

        width: 68px;
        height: 68px;
    }

    .catalyst-assistant-button {
        width: 64px;
        height: 64px;

        min-width: 64px;
        min-height: 64px;

        max-width: 64px;
        max-height: 64px;
    }

    .catalyst-assistant-button img {
        width: 52px !important;
        height: 52px !important;

        min-width: 52px !important;
        min-height: 52px !important;

        max-width: 52px !important;
        max-height: 52px !important;
    }

    .assistant-tooltip {
        display: none;
    }

    .assistant-message {
        right: 15px;
        bottom: 94px;

        width:
            calc(100vw - 30px);
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .catalyst-assistant-button,
    .assistant-pulse {
        animation: none;
    }
}