body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #333;
}

#chat-container {
    width: 100%; /* Changed from 80% */
    /* max-width: 600px; Removed */
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 70vh; /* Adjust height as needed */
}

#chat-history {
    flex-grow: 1; /* Allows this area to take up available space */
    overflow-y: auto; /* Add scrollbar if content overflows */
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

#input-area {
    display: flex;
    padding: 10px;
}

#message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
}

#send-button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#send-button:hover {
    background-color: #0056b3;
}

/* Basic message styling (will be added dynamically later) */
.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 5px;
    max-width: 70%;
    white-space: pre-wrap; /* Render line breaks */
    word-wrap: break-word; /* Ensure long words don't overflow */
}

.user-message {
    background-color: #d1e7dd; /* Light green */
    align-self: flex-end;
    margin-left: auto; /* Push to the right */
}

.ai-message {
    background-color: #f8d7da; /* Light red/pink */
    align-self: flex-start;
    margin-right: auto; /* Push to the left */
}
#prompt-display {
    width: 100%;
    height: 100px;
    border: 1px solid #ccc;
    margin-top: 10px; /* Added some margin for spacing */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    padding: 5px; /* Added some padding */
    font-family: inherit; /* Use the same font as the rest of the page */
    resize: vertical; /* Allow vertical resizing */
}
#clear-chat-button {
    margin-left: 5px; /* Add some space between buttons */
}
/* --- Markdown Styling --- */
.ai-message pre {
    background-color: #eee;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto; /* Add scrollbar for long code lines */
    white-space: pre; /* Preserve whitespace and line breaks */
}

.ai-message code {
    font-family: monospace;
    background-color: #eee;
    padding: 2px 4px;
    border-radius: 3px;
}

.ai-message pre code {
    background-color: transparent; /* Avoid double background for code inside pre */
    padding: 0;
    border-radius: 0;
}

.ai-message ul,
.ai-message ol {
    margin-left: 20px;
    padding-left: 20px; /* Add padding for list items */
}

.ai-message blockquote {
    border-left: 4px solid #ccc;
    padding-left: 10px;
    margin-left: 0;
    color: #666;
}
/* --- End Markdown Styling --- */