/* Chat button */
#chatbot-toggle {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    z-index: 99999;
}


/* Chat box */
#chatbot-box {
    position: fixed;
    right: 25px;
    bottom: 95px;
    width: 360px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.20);
    display: none;
    overflow: hidden;
    z-index: 99999;
}

#chatbot-box.open {
    display: flex;
    flex-direction: column;
}


/* Header */
#chatbot-header {
    height: 55px;
    min-height: 55px;
    background: #007bff;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 15px;
    font-weight: 600;
}

#chatbot-close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}


/* Messages area */
#chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f5f5;

    display: flex;
    flex-direction: column;
}


/* Common message */
.chatbot-message {
    max-width: 75%;
    padding: 10px 13px;
    margin-bottom: 10px;

    border-radius: 12px;

    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;

    line-height: 1.4;
}


/* Customer message - RIGHT */
.chatbot-message.customer {
    align-self: flex-end;

    background: #007bff;
    color: #fff;

    border-bottom-right-radius: 3px;
}


/* Agent message - LEFT */
.chatbot-message.agent {
    align-self: flex-start;

    background: #fff;
    color: #333;

    border: 1px solid #ddd;

    border-bottom-left-radius: 3px;
}


/* Backward compatibility */
.chatbot-message.user {
    align-self: flex-end;

    background: #007bff;
    color: #fff;

    border-bottom-right-radius: 3px;
}

.chatbot-message.assistant {
    align-self: flex-start;

    background: #fff;
    color: #333;

    border: 1px solid #ddd;

    border-bottom-left-radius: 3px;
}


/* Input area */
#chatbot-form {
    display: flex;

    padding: 10px;

    border-top: 1px solid #ddd;

    background: #fff;
}


/* Input */
#chatbot-input {
    flex: 1;

    border: 1px solid #ccc;
    border-radius: 20px;

    padding: 10px 15px;

    outline: none;

    min-width: 0;
}


/* Send button */
#chatbot-form button {
    margin-left: 8px;

    border: 0;
    border-radius: 20px;

    padding: 0 18px;

    background: #007bff;
    color: #fff;

    cursor: pointer;
}

#chatbot-form button:hover {
    background: #0056b3;
}


/* Mobile */
@media (max-width: 500px) {

    #chatbot-box {
        right: 10px;
        bottom: 80px;

        width: calc(100% - 20px);
        height: 70vh;
    }

    .chatbot-message {
        max-width: 80%;
    }

}