/* Basic Reset & Body Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f0f2f5; /* Light grey background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 700px; /* Adjust as needed */
    height: 85vh; /* Adjust height as needed */
    background-color: #ffffff; /* White chat area */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Ensures child elements fit */
}

/* Chat Header */
.chat-header {
    background-color: #4A90E2; /* A pleasant blue */
    color: white;
    padding: 15px 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0; /* Prevents header from shrinking */
}

.chat-header h1 {
    font-size: 1.4em;
    margin: 0;
}

/* Chat Box (Message Area) */
.chat-box {
    flex-grow: 1; /* Takes up available vertical space */
    overflow-y: auto; /* Enables vertical scrolling */
    padding: 20px;
    background-color: #f9f9f9; /* Slightly off-white for message area */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between messages */
}

/* General Message Styling */
.message {
    max-width: 80%; /* Messages don't span full width */
    padding: 10px 15px;
    border-radius: 18px; /* Bubble shape */
    line-height: 1.4;
    word-wrap: break-word; /* Prevents long words from overflowing */
}

.message p {
    margin: 0;
}

/* Bot Message Styling */
.bot-message {
    background-color: #e9e9eb; /* Light grey for bot */
    color: #333;
    align-self: flex-start; /* Align to the left */
    border-bottom-left-radius: 5px; /* Slightly different shape */
}

/* User Message Styling */
.user-message {
    background-color: #007bff; /* Blue for user */
    color: white;
    align-self: flex-end; /* Align to the right */
    border-bottom-right-radius: 5px; /* Slightly different shape */
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    align-items: center; /* Vertically align items */
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    background-color: #ffffff;
    flex-shrink: 0; /* Prevents input area from shrinking */
}

#user-input {
    flex-grow: 1; /* Takes up available horizontal space */
    border: 1px solid #ccc;
    border-radius: 20px; /* Pill shape */
    padding: 10px 15px;
    font-size: 1em;
    margin-right: 10px;
    resize: none; /* Disable textarea resizing */
    overflow-y: hidden; /* Hide scrollbar initially */
    max-height: 100px; /* Limit max height */
    line-height: 1.4;
}

#send-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%; /* Circle shape */
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
}

#send-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

#send-button:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

/* Scrollbar Styling (Optional, Webkit browsers like Chrome/Safari) */
.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}