/* Basic styling for the chat interface */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 95vh; /* Use min-height to allow content to push down */
}

.chat-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px; /* Limit maximum width */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Hide overflow from rounded corners */
}

h1 {
    text-align: center;
    color: #333;
    padding: 15px;
    margin: 0;
    background-color: #e9e9e9;
    border-bottom: 1px solid #ddd;
}

.chat-box {
    flex-grow: 1; /* Allow chat box to take available space */
    padding: 15px;
    overflow-y: auto; /* Enable scrolling for messages */
    max-height: 400px; /* Set a maximum height for the chat box */
    display: flex; /* Use flexbox for message layout */
    flex-direction: column; /* Stack messages vertically */
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 5px;
    max-width: 80%; /* Limit message width */
    word-wrap: break-word; /* Break long words */
}

.user-message {
    background-color: #007bff;
    color: white;
    align-self: flex-end; /* Align user messages to the right */
}

.system-message {
    background-color: #e9e9eb;
    color: #333;
    align-self: flex-start; /* Align system messages to the left */
}

.input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
}

#messageInput {
    flex-grow: 1; /* Allow input to take available space */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 1rem;
}

#sendButton {
    padding: 10px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

#sendButton:hover {
    background-color: #218838;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .chat-container {
        margin: 10px;
    }

    .input-area {
        flex-direction: column; /* Stack input and button on small screens */
    }

    #messageInput {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
