/* =========================================================
   VULTREX AI CHATBOT
========================================================= */

.vultrex-chatbot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: inherit;
}


/* =========================================================
   LAUNCHER
========================================================= */

.vultrex-chatbot-launcher {
    min-width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 0 18px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;

    background: var(--chat-accent, #2f7df4);
    color: #ffffff;

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.22),
        0 4px 12px rgba(0, 0, 0, 0.12);

    cursor: pointer;

    font: inherit;
    font-size: 14px;
    font-weight: 700;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}


.vultrex-chatbot-launcher:hover {
    transform: translateY(-2px);

    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.26),
        0 5px 14px rgba(0, 0, 0, 0.14);
}


.vultrex-chatbot-launcher-icon {
    width: 25px;
    height: 25px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.16);

    font-size: 13px;
}


/* =========================================================
   CHAT WINDOW
========================================================= */

.vultrex-chatbot-window {
    position: absolute;

    right: 0;
    bottom: 72px;

    width: min(390px, calc(100vw - 32px));
    height: min(600px, calc(100vh - 120px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;

    background: #111722;
    color: #f7f9fc;

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.34),
        0 8px 24px rgba(0, 0, 0, 0.20);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(15px) scale(0.98);

    transform-origin: bottom right;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}


.vultrex-chatbot.is-open .vultrex-chatbot-window {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0) scale(1);

    pointer-events: auto;
}


/* =========================================================
   HEADER
========================================================= */

.vultrex-chatbot-header {
    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 16px;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.08);

    background: #151d2a;
}


.vultrex-chatbot-header-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}


.vultrex-chatbot-logo {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 13px;

    background: var(--chat-accent, #2f7df4);
    color: #ffffff;

    font-size: 19px;
    font-weight: 800;
}


.vultrex-chatbot-header-brand>div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.vultrex-chatbot-header strong {
    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;
}


.vultrex-chatbot-header span {
    color: #9ca9bb;
    font-size: 12px;
}


.vultrex-chatbot-close {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 11px;

    background: transparent;
    color: #aab5c5;

    cursor: pointer;

    font-size: 26px;
    font-weight: 300;
    line-height: 1;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.vultrex-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}


/* =========================================================
   MESSAGES
========================================================= */

.vultrex-chatbot-messages {
    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 13px;

    overflow-y: auto;

    padding: 18px 15px;

    scroll-behavior: smooth;
}


.vultrex-chatbot-messages::-webkit-scrollbar {
    width: 5px;
}


.vultrex-chatbot-messages::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.13);
}


.vultrex-chat-message {
    display: flex;
    width: 100%;
}


.vultrex-chat-message.assistant {
    justify-content: flex-start;
}


.vultrex-chat-message.user {
    justify-content: flex-end;
}


.vultrex-chat-message-bubble {
    max-width: 82%;

    padding: 11px 13px;

    border-radius: 15px;

    font-size: 14px;
    line-height: 1.5;

    word-wrap: break-word;
    overflow-wrap: anywhere;
}


.vultrex-chat-message.assistant .vultrex-chat-message-bubble {
    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-bottom-left-radius: 5px;

    background: #1a2331;
    color: #e9eef6;
}


.vultrex-chat-message.user .vultrex-chat-message-bubble {
    border-bottom-right-radius: 5px;

    background: var(--chat-accent, #2f7df4);
    color: #ffffff;
}

/* =========================================================
   VULTREX SUPPORT MESSAGE
========================================================= */

.vultrex-chat-message.support {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}


.vultrex-chat-support-label {
    margin-left: 4px;

    color: #8fa0b6;

    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;

    letter-spacing: 0.2px;
}


.vultrex-chat-message.support .vultrex-chat-message-bubble {
    max-width: 82%;

    border:
        1px solid rgba(47, 125, 244, 0.22);

    border-bottom-left-radius: 5px;

    background:
        rgba(47, 125, 244, 0.10);

    color: #e9eef6;
}

/* =========================================================
   SAFE TRACKING LINK
========================================================= */

.vultrex-chat-tracking-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-top: 8px;
    padding: 9px 12px;

    border-radius: 10px;

    background: rgba(47, 125, 244, 0.13);
    border: 1px solid rgba(47, 125, 244, 0.30);

    color: #75aaff;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.vultrex-chat-tracking-link:hover {
    background: rgba(47, 125, 244, 0.20);
    border-color: rgba(47, 125, 244, 0.48);
}


/* =========================================================
   TYPING INDICATOR
========================================================= */

.vultrex-chatbot-typing {
    align-self: flex-start;

    display: flex;
    align-items: center;
    gap: 4px;

    margin: 0 15px 10px;
    padding: 10px 13px;

    width: fit-content;

    border:
        1px solid rgba(255, 255, 255, 0.08);

    border-radius: 14px;
    border-bottom-left-radius: 5px;

    background: #1a2331;
}


.vultrex-chatbot-typing[hidden] {
    display: none;
}


.vultrex-chatbot-typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #8c99aa;

    animation:
        vultrex-chat-typing 1.2s infinite ease-in-out;
}


.vultrex-chatbot-typing span:nth-child(2) {
    animation-delay: 0.15s;
}


.vultrex-chatbot-typing span:nth-child(3) {
    animation-delay: 0.3s;
}


@keyframes vultrex-chat-typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}


/* =========================================================
   INPUT AREA
========================================================= */

.vultrex-chatbot-form {
    display: flex;
    align-items: flex-end;
    gap: 9px;

    padding: 12px 13px;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);

    background: #151d2a;
}


.vultrex-chatbot-input {
    flex: 1;

    min-height: 43px;
    max-height: 110px;

    resize: none;

    padding: 11px 13px;

    border:
        1px solid rgba(255, 255, 255, 0.10);

    border-radius: 13px;

    outline: none;

    background: #0f1621;
    color: #ffffff;

    font: inherit;
    font-size: 14px;
    line-height: 1.4;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.vultrex-chatbot-input::placeholder {
    color: #748195;
}


.vultrex-chatbot-input:focus {
    border-color:
        rgba(47, 125, 244, 0.65);

    box-shadow:
        0 0 0 3px rgba(47, 125, 244, 0.10);
}


.vultrex-chatbot-send {
    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border: 0;
    border-radius: 13px;

    background: var(--chat-accent, #2f7df4);
    color: #ffffff;

    cursor: pointer;

    font: inherit;
    font-size: 18px;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}


.vultrex-chatbot-send:hover {
    transform: translateY(-1px);
}


.vultrex-chatbot-send:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}


/* =========================================================
   DISCLAIMER
========================================================= */

.vultrex-chatbot-disclaimer {
    padding: 0 13px 10px;

    background: #151d2a;

    color: #6f7d90;

    text-align: center;
    font-size: 10px;
    line-height: 1.35;
}


/* =========================================================
   LIGHT MODE
========================================================= */

html[data-theme="light"] .vultrex-chatbot-window,
body.light-theme .vultrex-chatbot-window {
    border-color: rgba(15, 23, 42, 0.10);

    background: #ffffff;
    color: #172033;

    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.18),
        0 8px 24px rgba(15, 23, 42, 0.10);
}


html[data-theme="light"] .vultrex-chatbot-header,
html[data-theme="light"] .vultrex-chatbot-form,
html[data-theme="light"] .vultrex-chatbot-disclaimer,
body.light-theme .vultrex-chatbot-header,
body.light-theme .vultrex-chatbot-form,
body.light-theme .vultrex-chatbot-disclaimer {
    background: #f8fafc;
}


html[data-theme="light"] .vultrex-chatbot-header,
html[data-theme="light"] .vultrex-chatbot-form,
body.light-theme .vultrex-chatbot-header,
body.light-theme .vultrex-chatbot-form {
    border-color: rgba(15, 23, 42, 0.08);
}


html[data-theme="light"] .vultrex-chat-message.assistant .vultrex-chat-message-bubble,
body.light-theme .vultrex-chat-message.assistant .vultrex-chat-message-bubble {
    border-color: rgba(15, 23, 42, 0.07);

    background: #f1f5f9;
    color: #1e293b;
}


html[data-theme="light"] .vultrex-chatbot-input,
body.light-theme .vultrex-chatbot-input {
    border-color: rgba(15, 23, 42, 0.10);

    background: #ffffff;
    color: #172033;
}


html[data-theme="light"] .vultrex-chatbot-close,
body.light-theme .vultrex-chatbot-close {
    color: #64748b;
}


html[data-theme="light"] .vultrex-chatbot-close:hover,
body.light-theme .vultrex-chatbot-close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #172033;
}


html[data-theme="light"] .vultrex-chatbot-typing,
body.light-theme .vultrex-chatbot-typing {
    border-color: rgba(15, 23, 42, 0.07);
    background: #f1f5f9;
}

html[data-theme="light"] .vultrex-chat-message.support .vultrex-chat-message-bubble,
body.light-theme .vultrex-chat-message.support .vultrex-chat-message-bubble {
    border-color: rgba(47, 125, 244, 0.18);

    background: rgba(47, 125, 244, 0.08);

    color: #1e293b;
}


html[data-theme="light"] .vultrex-chat-support-label,
body.light-theme .vultrex-chat-support-label {
    color: #64748b;
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .vultrex-chatbot {
        right: 14px;
        bottom: 14px;
    }


    .vultrex-chatbot-launcher {
        min-width: 54px;
        height: 54px;

        padding: 0 15px;

        border-radius: 17px;
    }


    .vultrex-chatbot-window {
        position: fixed;

        left: 10px;
        right: 10px;
        bottom: 78px;

        width: auto;

        height:
            min(620px,
                calc(100dvh - 100px));

        border-radius: 20px;

        transform-origin: bottom center;
    }
}


@media (max-width: 420px) {

    .vultrex-chatbot-launcher-text {
        display: none;
    }


    .vultrex-chatbot-launcher {
        width: 54px;
        padding: 0;
        border-radius: 50%;
    }


    .vultrex-chatbot-window {
        left: 8px;
        right: 8px;
        bottom: 76px;
    }


    .vultrex-chat-message-bubble {
        max-width: 88%;
    }
}