/* =========================================================
   MWORC CHATBOT - FULL CSS
========================================================= */

#mworc-chatbot {
    font-family: Arial, Helvetica, sans-serif;
    position: static;
}


/* =========================================================
   FLOATING CHAT BUTTON
========================================================= */

#mworc-chat-toggle {
    position: fixed;

    right: 20px;
    bottom: 20px;

    width: 62px;
    height: 62px;
    min-width: 62px;
    min-height: 62px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;

    border: none;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;

    background: #08a6c9;
    color: #ffffff;

    font-size: 25px;
    line-height: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow:
        0 10px 30px rgba(0, 74, 105, 0.22);

    z-index: 2147483001;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


#mworc-chat-toggle .mworc-chat-toggle-icon {
    display: block;
    width: 30px;
    height: 30px;
    margin: 0;
    fill: currentColor;
    pointer-events: none;
}


#mworc-chat-toggle:hover {
    transform: translateY(-2px);

    background: #0698ba;

    box-shadow:
        0 14px 34px rgba(0, 74, 105, 0.28);
}


/* =========================================================
   CHAT WINDOW
========================================================= */

#mworc-chat-window {
    position: fixed;

    right: 20px;
    bottom: 95px;

    width: 380px;
    height: 520px;

    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 120px);

    display: none;
    flex-direction: column;

    background: #ffffff;

    border-radius: 16px;

    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 50, 80, 0.20);

    z-index: 2147483000;
}


#mworc-chat-window.open {
    display: flex;
}


/* =========================================================
   HEADER
========================================================= */

.mworc-chat-header {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;

    background:
        linear-gradient(
            135deg,
            #056488,
            #0798bb
        );

    color: #ffffff;
}


.mworc-chat-header > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.mworc-chat-header strong {
    display: block;

    margin: 0;

    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;

    color: #ffffff;
}


.mworc-chat-header small {
    display: block;

    margin: 0;

    font-size: 13px;
    line-height: 1.3;

    color: rgba(255, 255, 255, 0.92);
}


#mworc-chat-close {
    width: 34px;
    height: 34px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    background: transparent;

    color: #ffffff;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;

    transition: background 0.2s ease;
}


#mworc-chat-close:hover {
    background: rgba(255, 255, 255, 0.12);
}


/* =========================================================
   MESSAGE AREA
========================================================= */

#mworc-chat-messages {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    padding: 18px 14px;

    overflow-y: auto;
    overflow-x: hidden;

    background: #f3f8fa;

    scroll-behavior: smooth;
}


/* =========================================================
   GENERAL MESSAGE BUBBLE
========================================================= */

#mworc-chatbot .mworc-message {
    display: block;
    flex: 0 0 auto;

    width: fit-content !important;
    height: auto !important;
    min-height: 0 !important;

    max-width: 82%;

    margin: 0 0 14px 0;

    padding: 13px 15px;

    box-sizing: border-box;

    border-radius: 14px;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;

    text-align: left;

    white-space: pre-line;

    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
}


/* =========================================================
   BOT MESSAGE
========================================================= */

#mworc-chatbot .mworc-message.bot {
    align-self: flex-start;
    max-width: 90%;

    margin-right: auto;

    background: #ffffff;

    color: #173849;

    border: 1px solid #dbe7eb;

    border-bottom-left-radius: 5px;

    text-align: left !important;

    box-shadow:
        0 2px 5px rgba(0, 50, 80, 0.03);
}


/* =========================================================
   USER MESSAGE
========================================================= */

#mworc-chatbot .mworc-message.user {
    align-self: flex-end;
    max-width: 82%;

    margin-left: auto;
    margin-right: 0;

    background:
        linear-gradient(
            135deg,
            #069fc3,
            #09afd1
        );

    color: #ffffff;

    border: none;

    border-bottom-right-radius: 5px;

    text-align: left;
}


/* =========================================================
   THINKING MESSAGE
========================================================= */

#mworc-chatbot .mworc-message.loading {
    align-self: flex-start;

    width: auto !important;
    min-width: 90px;

    background: #ffffff;

    color: #748a95;

    border: 1px solid #dbe7eb;

    font-style: italic;

    opacity: 0.85;
}


/* =========================================================
   INPUT AREA
========================================================= */

.mworc-chat-input {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    gap: 8px;

    padding: 12px;

    background: #ffffff;

    border-top: 1px solid #dce7eb;
}


/* =========================================================
   INPUT FIELD
========================================================= */

#mworc-chat-text {
    flex: 1;

    min-width: 0;

    height: 42px;

    padding: 0 13px;

    box-sizing: border-box;

    border: 1px solid #9fc5d2;

    border-radius: 9px;

    background: #ffffff;

    color: #173849;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 42px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


#mworc-chat-text::placeholder {
    color: #9aaab2;
}


#mworc-chat-text:focus {
    border-color: #079fc4;

    box-shadow:
        0 0 0 3px rgba(7, 159, 196, 0.10);
}


#mworc-chat-text:disabled {
    background: #f1f5f6;
    cursor: not-allowed;
}


/* =========================================================
   SEND BUTTON
========================================================= */

#mworc-chat-send {
    flex-shrink: 0;

    height: 42px;

    padding: 0 18px;

    border: none;
    border-radius: 9px;

    background: #045578;

    color: #ffffff;

    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


#mworc-chat-send:hover {
    background: #034867;
}


#mworc-chat-send:active {
    transform: scale(0.98);
}


#mworc-chat-send:disabled {
    opacity: 0.5;

    cursor: not-allowed;

    transform: none;
}


/* =========================================================
   SCROLLBAR
========================================================= */

#mworc-chat-messages::-webkit-scrollbar {
    width: 7px;
}


#mworc-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}


#mworc-chat-messages::-webkit-scrollbar-thumb {
    background: #c3d4da;

    border-radius: 10px;
}


#mworc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8c0c9;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 768px) {

    #mworc-chat-window {
        right: 15px;
        bottom: 90px;

        width: 360px;
        height: 500px;

        max-width: calc(100vw - 30px);
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    #mworc-chat-window {
        left: 10px;
        right: 10px;

        bottom: 82px;

        width: auto;

        height: calc(100vh - 105px);

        max-width: none;
        max-height: none;

        border-radius: 14px;
    }


    #mworc-chat-toggle {
        right: 16px;
        bottom: 16px;

        width: 58px;
        height: 58px;
        min-width: 58px;
        min-height: 58px;
    }


    .mworc-chat-header {
        padding: 16px 17px;
    }


    #mworc-chat-messages {
        padding: 16px 12px;
    }


    #mworc-chatbot .mworc-message {
        max-width: 88%;

        font-size: 14px;
    }


    .mworc-chat-input {
        padding: 10px;
    }


    #mworc-chat-text {
        height: 42px;
    }


    #mworc-chat-send {
        height: 42px;

        padding: 0 15px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    #mworc-chatbot .mworc-message {
        max-width: 92%;
    }


    #mworc-chat-send {
        padding: 0 12px;

        font-size: 13px;
    }

}
