/* Reset some default styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212; /* Dark background */
    color: #e0e0e0; /* Light text for contrast */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Chat Container */
#chat-container {
    background-color: #1e1e1e; /* Slightly lighter than body for contrast */
    width: 100%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
#chat-container h2 {
    background-color: #2c2c2c; /* Dark header */
    color: #ffffff;
    padding: 15px;
    text-align: center;
    font-size: 1.5em;
    border-bottom: 1px solid #333;
}

/* Messages Area */
#messages {
    flex-grow: 1;
    padding: 20px;
    background-color: #1e1e1e;
    overflow-y: auto;
}

/* Message Bubbles */
.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message .text {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 1em;
    line-height: 1.5; /* Adjust line height for better readability */
    word-wrap: break-word;
    white-space: pre-wrap; /* This preserves newlines and spaces */
    margin-bottom: 10px; /* Space between messages */
}

/* User Message Styling */
.user-message .text {
    background-color: #4a90e2; /* Blue bubble for user */
    color: #ffffff;
    border-bottom-right-radius: 0;
}

/* Bot Message Styling */
.bot-message .text {
    background-color: #333333; /* Dark gray bubble for bot */
    color: #e0e0e0;
    border-bottom-left-radius: 0;
}

/* Timestamp (Optional) */
.message .timestamp {
    font-size: 0.8em;
    color: #888888;
    margin: 0 10px;
}

/* Input Form */
#input-form {
    display: flex;
    border-top: 1px solid #333;
    padding: 10px;
    background-color: #2c2c2c;
}

#input-field {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #555;
    border-radius: 20px;
    background-color: #1e1e1e;
    color: #e0e0e0;
    outline: none;
    font-size: 1em;
    transition: border-color 0.3s, background-color 0.3s;
}

#input-field::placeholder {
    color: #aaaaaa;
}

#input-field:focus {
    border-color: #4a90e2;
    background-color: #2a2a2a;
}

#send-button {
    background-color: #4a90e2;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    margin-left: 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

#send-button:hover {
    background-color: #357ab8;
}

/* Scrollbar Styling */
#messages::-webkit-scrollbar {
    width: 8px;
}

#messages::-webkit-scrollbar-track {
    background: #2c2c2c;
}

#messages::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 600px) {
    #chat-container {
        border-radius: 0;
        height: 100vh;
    }

    #messages {
        height: calc(100vh - 120px);
    }
}
