﻿#chatButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#chatbot-entry {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    text-align: center;
    animation: floatUpDown 2s ease-in-out infinite;
}

.chatbot-avatar {
    width: 64px;
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: floatUpDown 2s ease-in-out infinite;
}

    .chatbot-avatar:hover {
        transform: scale(1.05) rotate(-2deg);
    }

.chatbot-bubble {
    background: #ffffff;
    border-radius: 20px;
    padding: 5px 14px;
    color: #333;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: blinkBubble 1.5s infinite;
}


@keyframes blinkBubble {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

#chatPopup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 100%;
    max-width: 360px; /* 👈 Giới hạn chiều rộng tối đa */
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    flex-direction: column;
    font-family: sans-serif;
}

#chatBody,
#chatHeader,
#chatInputContainer {
    max-width: 100%;
    box-sizing: border-box;
}

/*#chatPopup {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    z-index: 1000;
}*/

#userForm {
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
    justify-content: center;
}

    #userForm input, #userForm select {
        margin-bottom: 10px;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }

    #userForm button {
        padding: 10px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

#chatContainer {
    display: none;
    flex-direction: column;
    height: 100%;
}

#chatHeader {
    background-color: #007bff;
    color: white;
    padding: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#chatBody {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #f9f9f9;
    height: 280px;
}

#chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    height: 340px;
    background-color: #f9f9f9;
}

#chatInputContainer {
    padding: 10px;
    border-top: 1px solid #ccc;
    display: flex;
}

#chatInput {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
}

#sendButton {
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.message {
    margin: 5px 0;
    display: flex;
}

    .message.user {
        justify-content: flex-end;
    }

    .message.bot {
        justify-content: flex-start;
    }

.bubble {
    max-width: 70%;
    padding: 10px;
    border-radius: 10px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

.message.user .bubble {
    background-color: #007bff;
    color: white;
}

.message.bot .bubble {
    background-color: #e0e0e0;
    color: black;
}

.chat-message {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-end;
}

    .chat-message.bot {
        justify-content: flex-start;
    }

    .chat-message.user {
        justify-content: flex-end;
    }

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 8px;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 75%;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

    .chat-bubble.bot {
        background-color: #f1f1f1;
        color: #000;
        border-bottom-left-radius: 4px;
    }

    .chat-bubble.user {
        background-color: #2563eb;
        color: white;
        border-bottom-right-radius: 4px;
    }
