#chatbot-ai-container {
    position: fixed;
    bottom: 25px; /* Slightly increase bottom spacing */
    right: 25px; /* Slightly increase right spacing */
    z-index: 9999;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; /* More modern font stack */
    -webkit-font-smoothing: antialiased; /* Better font rendering */
    -moz-osx-font-smoothing: grayscale; /* Better font rendering */
}

#chatbot-ai-toggle {
    width: 60px;
    height: 60px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

#chatbot-ai-toggle:hover {
    background-color: #0056b3; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

#chatbot-ai-box {
    width: 350px; /* Slightly wider chat box */
    background: #fff;
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); /* Softer, larger shadow */
    overflow: hidden;
    margin-top: 15px; /* Slightly more space from toggle button */
    display: flex; /* Use flexbox for layout */
    flex-direction: column; /* Stack header, messages, input vertically */
    height: 450px; /* Fixed height for consistent look */
}

#chatbot-ai-header {
    background: linear-gradient(to right, #007bff, #0056b3); /* Gradient background */
    color: white;
    padding: 15px; /* More padding */
    text-align: center;
    font-weight: bold;
    font-size: 18px; /* Slightly larger font for header */
    border-top-left-radius: 12px; /* Match box border-radius */
    border-top-right-radius: 12px; /* Match box border-radius */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow below header */
}

#chatbot-ai-messages {
    flex-grow: 1; /* Allow messages area to take available space */
    overflow-y: auto;
    padding: 15px; /* More padding */
    background: #f0f2f5; /* Lighter, subtle background for messages area */
    border-bottom: 1px solid #e0e0e0; /* Separator line */
}

/* Scrollbar styling for WebKit browsers */
#chatbot-ai-messages::-webkit-scrollbar {
    width: 8px;
}

#chatbot-ai-messages::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 10px;
}

#chatbot-ai-messages::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 10px;
}

#chatbot-ai-messages::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.message {
    margin-bottom: 12px; /* More space between messages */
    padding: 12px 16px; /* Slightly more padding */
    border-radius: 20px; /* More rounded, "bubble" look */
    display: inline-block;
    max-width: 85%; /* Slightly more width for messages */
    line-height: 1.5; /* Improved readability */
    font-size: 15px; /* Slightly larger font for messages */
    word-wrap: break-word; /* Ensure long words wrap */
}

.message.user {
    align-self: flex-end;         /* Đẩy sang phải */
    background-color: #007bff;
    color: white;
    text-align: right;
    margin-left: auto;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;       /* Đẩy sang trái */
    background-color: #e5eaf0;
    color: #333;
    text-align: left;
    margin-right: auto;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

#chatbot-ai-messages {
    display: flex;
    flex-direction: column;
}

#chatbot-ai-input-area {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px 15px; /* Add padding to the input area */
    background-color: #fff; /* Ensure white background for input area */
    border-bottom-left-radius: 12px; /* Match box border-radius */
    border-bottom-right-radius: 12px; /* Match box border-radius */
}

#chatbot-ai-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0; /* Subtle border for input */
    border-radius: 20px; /* Rounded input field */
    outline: none;
    font-size: 15px;
    margin-right: 10px; /* Space between input and send button */
    transition: border-color 0.3s ease;
}

#chatbot-ai-input:focus {
    border-color: #007bff; /* Highlight border on focus */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); /* Focus ring */
}

#chatbot-ai-send {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px; /* More padding for button */
    border-radius: 20px; /* Rounded button */
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

#chatbot-ai-send:hover {
    background-color: #0056b3;
    transform: translateY(-1px); /* Slight lift */
}

#chatbot-ai-send:active {
    transform: translateY(0); /* Reset on click */
}

.hidden {
    display: none;
}