/* =========================================================
   SIARA TECHVISION AI CHATBOT
   Medium Floating Widget
========================================================= */


/* =========================================================
   1. FLOATING CHAT BUTTON
========================================================= */

#siara-chat-button {
    position: fixed;

    right: 22px;
    bottom: 22px;

    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #0f172a,
        #2563eb
    );

    color: #ffffff;

    font-size: 24px;

    cursor: pointer;

    z-index: 999999;

    overflow: visible !important;

    box-shadow:
        0 10px 30px rgba(37, 99, 235, 0.30);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


#siara-chat-button:hover {
    transform: translateY(-3px) scale(1.05);

    box-shadow:
        0 14px 35px rgba(37, 99, 235, 0.38);
}


/* =========================================================
   2. TEXT LABEL BESIDE BUTTON
========================================================= */

#siara-chat-button::before {
    content: "Need Assistant? Chat Now";

    position: absolute;

    right: 70px;
    top: 50%;

    transform: translateY(-50%);

    padding: 9px 14px;

    background: #ffffff;

    color: #172554;

    border:
        1px solid rgba(226, 232, 240, 0.95);

    border-radius: 10px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 13px;
    font-weight: 600;

    line-height: 1.2;

    white-space: nowrap;

    pointer-events: none;

    box-shadow:
        0 5px 18px rgba(15, 23, 42, 0.16);
}


/* Small arrow */

#siara-chat-button::after {
    content: "";

    position: absolute;

    right: 62px;
    top: 50%;

    transform: translateY(-50%);

    width: 0;
    height: 0;

    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 9px solid #ffffff;

    pointer-events: none;
}


/* =========================================================
   3. CHAT WINDOW
========================================================= */

#siara-chat-window {
    position: fixed;

    right: 22px;
    bottom: 92px;

    width: 330px;
    height: 460px;

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    display: none;
    flex-direction: column;

    z-index: 999999;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    border:
        1px solid rgba(226, 232, 240, 0.8);

    box-shadow:
        0 22px 55px rgba(15, 23, 42, 0.20),
        0 8px 20px rgba(37, 99, 235, 0.08);
}


/* =========================================================
   4. CHAT HEADER
========================================================= */

.siara-chat-header {
    flex-shrink: 0;

    min-height: 58px;

    padding: 11px 13px;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: linear-gradient(
        135deg,
        #0f172a 0%,
        #172554 50%,
        #2563eb 100%
    );

    color: #ffffff;
}


/* =========================================================
   5. HEADER LEFT SECTION
========================================================= */

.siara-header-left {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;
}


/* =========================================================
   6. LOGO
========================================================= */

.siara-logo {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.15);

    border:
        1px solid rgba(255, 255, 255, 0.20);

    color: #ffffff;

    font-size: 17px;
    font-weight: 700;
}


/* =========================================================
   7. HEADER TITLE
========================================================= */

.siara-chat-header strong {
    display: block;

    margin: 0;

    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.25;

    text-align: left;
}


/* =========================================================
   8. ONLINE STATUS
========================================================= */

.siara-chat-header small {
    display: block;

    margin-top: 2px;

    color: #86efac;

    font-size: 10px;
    font-weight: 400;

    line-height: 1.2;

    text-align: left;
}


/* =========================================================
   9. CLOSE BUTTON
========================================================= */

#siara-close-chat {
    width: 31px;
    height: 31px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background:
        rgba(255, 255, 255, 0.10);

    border: none;

    border-radius: 8px;

    color: #ffffff;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition: background 0.2s ease;
}


#siara-close-chat:hover {
    background:
        rgba(255, 255, 255, 0.20);
}


/* =========================================================
   10. CHAT MESSAGE AREA
========================================================= */

#siara-chat-messages {
    flex: 1;

    min-height: 0;

    padding: 12px;

    overflow-y: auto;
    overflow-x: hidden;

    scroll-behavior: smooth;

    background:

        radial-gradient(
            circle at 10% 10%,
            rgba(59, 130, 246, 0.12),
            transparent 35%
        ),

        radial-gradient(
            circle at 90% 85%,
            rgba(99, 102, 241, 0.10),
            transparent 35%
        ),

        linear-gradient(
            145deg,
            #f8fbff 0%,
            #eef4ff 55%,
            #f5f3ff 100%
        );
}


/* =========================================================
   11. ALL CHAT MESSAGES
========================================================= */

.siara-message {
    width: fit-content;

    max-width: 82%;

    box-sizing: border-box;

    padding: 9px 11px;

    margin-bottom: 10px;

    font-size: 13px;

    line-height: 1.45;

    text-align: left;

    white-space: pre-wrap;

    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: anywhere;
}


/* =========================================================
   12. BOT MESSAGE
========================================================= */

.bot-message {
    margin-left: 0;
    margin-right: auto;

    background:
        rgba(255, 255, 255, 0.95);

    color: #172033;

    border:
        1px solid rgba(148, 163, 184, 0.23);

    border-radius:
        5px 14px 14px 14px;

    text-align: left;

    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.05);
}


/* =========================================================
   13. USER MESSAGE
========================================================= */

.user-message {
    margin-left: auto;
    margin-right: 0;

    background: linear-gradient(
        135deg,
        #172554,
        #2563eb
    );

    color: #ffffff;

    border-radius:
        14px 14px 5px 14px;

    text-align: left;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.18);
}


/* =========================================================
   14. INPUT FORM
========================================================= */

#siara-chat-form {
    flex-shrink: 0;

    display: flex;
    align-items: center;

    gap: 7px;

    padding: 9px;

    box-sizing: border-box;

    background:
        rgba(255, 255, 255, 0.98);

    border-top:
        1px solid #e2e8f0;
}


/* =========================================================
   15. TEXT INPUT
========================================================= */

#siara-chat-input {
    flex: 1;

    min-width: 0;

    height: 42px;

    box-sizing: border-box;

    padding: 0 12px;

    background: #f8fafc;

    border:
        1px solid #cbd5e1;

    border-radius: 11px;

    outline: none;

    color: #0f172a;

    font-size: 13px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


#siara-chat-input:focus {
    background: #ffffff;

    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);
}


#siara-chat-input::placeholder {
    color: #94a3b8;
}


/* =========================================================
   16. SEND BUTTON
========================================================= */

#siara-send-button {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;

    border-radius: 11px;

    background: linear-gradient(
        135deg,
        #172554,
        #2563eb
    );

    color: #ffffff;

    font-size: 17px;

    cursor: pointer;

    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


#siara-send-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 7px 18px rgba(37, 99, 235, 0.30);
}


/* =========================================================
   17. SCROLLBAR
========================================================= */

#siara-chat-messages::-webkit-scrollbar {
    width: 5px;
}


#siara-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}


#siara-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 20px;
}


#siara-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* =========================================================
   18. MOBILE RESPONSIVE
========================================================= */

@media (max-width: 500px) {

    #siara-chat-button {
        right: 15px;
        bottom: 15px;

        width: 54px;
        height: 54px;

        font-size: 22px;
    }


    #siara-chat-button::before {
        content: "Chat Now";

        right: 64px;

        padding: 7px 10px;

        font-size: 11px;
    }


    #siara-chat-button::after {
        right: 56px;
    }


    #siara-chat-window {
        right: 10px;
        bottom: 78px;

        width: calc(100% - 20px);

        height: 70vh;
        max-height: 500px;

        border-radius: 16px;
    }


    .siara-chat-header {
        min-height: 56px;

        padding: 10px 12px;
    }


    .siara-logo {
        width: 34px;
        height: 34px;

        font-size: 16px;
    }


    .siara-message {
        max-width: 86%;

        font-size: 13px;
    }


    #siara-chat-messages {
        padding: 11px;
    }

}