/* =========================================================
   REALCRM CHATBOT
   ========================================================= */

:root {

    --chatbot-primary: #0094AA;
    --chatbot-primary-dark: #007F91;

    --chatbot-white: #ffffff;

    --chatbot-bg: #f6f8f9;

    --chatbot-text: #263746;

    --chatbot-muted: #87969c;

    --chatbot-border: #dce4e7;

}


/* =========================================================
   FLOATING BUTTON
   ========================================================= */

.chatbot-toggle {

    position: fixed;

    right: 25px;
    bottom: 25px;

    width: 64px;
    height: 64px;

    border: none;

    border-radius: 50%;

    background: var(--chatbot-primary);

    color: #ffffff;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 999999;

    box-shadow:
        0 10px 30px rgba(0, 148, 170, 0.30);

    transition: all 0.25s ease;

}


.chatbot-toggle:hover {

    background: var(--chatbot-primary-dark);

    transform: translateY(-3px);

    box-shadow:
        0 14px 35px rgba(0, 148, 170, 0.35);

}


.chat-icon {

    font-size: 28px;

    line-height: 1;

}


/* =========================================================
   CHAT WINDOW
   ========================================================= */

.chatbot-window {

    position: fixed;

    right: 25px;
    bottom: 105px;

    width: 430px;

    height: 590px;

    background: #ffffff;

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.18);

    border: 1px solid #e3e9eb;

    z-index: 999998;

    display: flex;

    flex-direction: column;

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(20px)
        scale(0.96);

    transform-origin: bottom right;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;

}


.chatbot-window.active {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);

}


/* =========================================================
   HEADER
   ========================================================= */

.chatbot-header {

    min-height: 76px;

    background: var(--chatbot-primary);

    color: #ffffff;

    padding: 0 20px;

    display: flex;

    align-items: center;

    justify-content: space-between;

}


.chatbot-title {

    display: flex;

    align-items: center;

    gap: 11px;

}


.chatbot-bot-icon {

    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: rgba(255,255,255,0.18);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 21px;

}


.chatbot-title-text {

    display: flex;

    flex-direction: column;

    gap: 3px;

}


.chatbot-title-text strong {

    font-size: 17px;

    font-weight: 700;

    line-height: 1.2;

}


.chatbot-title-text span {

    font-size: 11px;

    opacity: 0.95;

    display: flex;

    align-items: center;

    gap: 5px;

}


.online-dot {

    width: 7px;
    height: 7px;

    display: inline-block;

    border-radius: 50%;

    background: #62d88a;

}


/* =========================================================
   CLOSE BUTTON
   ========================================================= */

.chatbot-close {

    width: 38px;
    height: 38px;

    border: none;

    background: transparent;

    color: #ffffff;

    font-size: 32px;

    line-height: 1;

    cursor: pointer;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    transition: background 0.2s ease;

}


.chatbot-close:hover {

    background: rgba(255,255,255,0.15);

}


/* =========================================================
   MESSAGE AREA
   ========================================================= */

.chatbot-messages {

    flex: 1;

    padding: 20px;

    overflow-y: auto;

    background: #f8fafb;

    scroll-behavior: smooth;

}


/* scrollbar */

.chatbot-messages::-webkit-scrollbar {

    width: 6px;

}


.chatbot-messages::-webkit-scrollbar-track {

    background: transparent;

}


.chatbot-messages::-webkit-scrollbar-thumb {

    background: #cbd7db;

    border-radius: 10px;

}


/* =========================================================
   MESSAGE ROW
   ========================================================= */

.message-row {

    display: flex;

    margin-bottom: 5px;

}


.bot-row {

    justify-content: flex-start;

}


.user-row {

    justify-content: flex-end;

}


/* =========================================================
   BOT MESSAGE
   ========================================================= */

.bot-message {

    max-width: 82%;

    padding: 14px 16px;

    background: #ffffff;

    color: var(--chatbot-text);

    border: 1px solid var(--chatbot-border);

    border-radius: 16px;

    border-top-left-radius: 5px;

    font-size: 14px;

    line-height: 1.65;

    box-shadow:
        0 2px 8px rgba(0,0,0,0.03);

}


/* =========================================================
   USER MESSAGE
   ========================================================= */

.user-message {

    max-width: 82%;

    padding: 13px 16px;

    background: var(--chatbot-primary);

    color: #ffffff;

    border-radius: 16px;

    border-top-right-radius: 5px;

    font-size: 14px;

    line-height: 1.6;

}


/* =========================================================
   TIME
   ========================================================= */

.message-time {

    color: var(--chatbot-muted);

    font-size: 11px;

    margin-bottom: 14px;

    padding-left: 3px;

}


/* =========================================================
   INPUT AREA
   ========================================================= */

.chatbot-input-area {

    min-height: 84px;

    background: #ffffff;

    border-top: 1px solid var(--chatbot-border);

    padding: 16px;

    display: flex;

    align-items: center;

    gap: 10px;

}


/* =========================================================
   INPUT
   ========================================================= */

.chatbot-input {

    flex: 1;

    height: 52px;

    border: 1px solid #d6dfe2;

    border-radius: 28px;

    padding: 0 18px;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    color: var(--chatbot-text);

    outline: none;

    background: #ffffff;

    transition: 0.2s ease;

}


.chatbot-input::placeholder {

    color: #9aa7ad;

}


.chatbot-input:focus {

    border-color: var(--chatbot-primary);

    box-shadow:
        0 0 0 3px rgba(0,148,170,0.08);

}


/* =========================================================
   SEND BUTTON
   ========================================================= */

.chatbot-send {

    width: 52px;
    height: 52px;

    flex-shrink: 0;

    border: none;

    border-radius: 50%;

    background: var(--chatbot-primary);

    color: #ffffff;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

    font-size: 20px;

    transition: 0.2s ease;

}


.chatbot-send:hover {

    background: var(--chatbot-primary-dark);

    transform: scale(1.04);

}


.chatbot-send:disabled {

    opacity: 0.6;

    cursor: not-allowed;

}


/* =========================================================
   TYPING
   ========================================================= */

.typing-message {

    display: inline-flex;

    align-items: center;

    gap: 4px;

    padding: 14px 17px;

    background: #ffffff;

    border: 1px solid var(--chatbot-border);

    border-radius: 16px;

    border-top-left-radius: 5px;

}


.typing-message span {

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--chatbot-primary);

    animation: chatbotTyping 1.2s infinite;

}


.typing-message span:nth-child(2) {

    animation-delay: 0.15s;

}


.typing-message span:nth-child(3) {

    animation-delay: 0.3s;

}


@keyframes chatbotTyping {

    0%,
    60%,
    100% {

        opacity: 0.3;

        transform: translateY(0);

    }

    30% {

        opacity: 1;

        transform: translateY(-3px);

    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {


    .chatbot-toggle {

        right: 18px;

        bottom: 18px;

        width: 58px;
        height: 58px;

    }


    .chat-icon {

        font-size: 25px;

    }


    .chatbot-window {

        right: 12px;
        left: 12px;

        bottom: 88px;

        width: auto;

        height: calc(100vh - 115px);

        max-height: 650px;

        border-radius: 16px;

    }


    .chatbot-header {

        min-height: 68px;

        padding: 0 15px;

    }


    .chatbot-title-text strong {

        font-size: 15px;

    }


    .chatbot-messages {

        padding: 15px;

    }


    .bot-message,
    .user-message {

        max-width: 88%;

        font-size: 14px;

    }


    .chatbot-input-area {

        min-height: 76px;

        padding: 12px;

    }


    .chatbot-input {

        height: 48px;

        font-size: 14px;

    }


    .chatbot-send {

        width: 48px;
        height: 48px;

    }

}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {


    .chatbot-window {

        right: 8px;
        left: 8px;

        bottom: 78px;

        height: calc(100vh - 95px);

    }


    .chatbot-title-text strong {

        font-size: 14px;

    }


    .chatbot-bot-icon {

        width: 36px;
        height: 36px;

        font-size: 18px;

    }


    .chatbot-close {

        font-size: 28px;

    }

}