* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
}

.chat-container {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 80vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message-content {
    padding: 0.8rem 1.2rem;
    border-radius: 1rem;
    max-width: 70%;
    word-wrap: break-word;
}

.user .message-content {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 0.3rem;
}

.bot .message-content {
    background-color: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 0.3rem;
}

/* Markdown styles for bot messages */
.bot .message-content h1,
.bot .message-content h2,
.bot .message-content h3,
.bot .message-content h4,
.bot .message-content h5,
.bot .message-content h6 {
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.bot .message-content h1 {
    font-size: 1.5rem;
}

.bot .message-content h2 {
    font-size: 1.3rem;
}

.bot .message-content h3 {
    font-size: 1.1rem;
}

.bot .message-content p {
    margin-bottom: 0.7rem;
}

.bot .message-content ul,
.bot .message-content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.7rem;
}

.bot .message-content li {
    margin-bottom: 0.2rem;
}

.bot .message-content code {
    background-color: rgba(0, 0, 0, 0.06);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.bot .message-content pre {
    background-color: rgba(0, 0, 0, 0.06);
    padding: 0.8rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0.7rem 0;
}

.bot .message-content pre code {
    background-color: transparent;
    padding: 0;
}

.bot .message-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 0.7rem;
    color: #555;
}

.bot .message-content a {
    color: #0066cc;
    text-decoration: underline;
}

.bot .message-content table {
    border-collapse: collapse;
    margin: 0.7rem 0;
    width: 100%;
}

.bot .message-content th,
.bot .message-content td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

.bot .message-content th {
    background-color: rgba(0, 0, 0, 0.05);
}

.chat-input-container {
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

#chat-form {
    display: flex;
    gap: 0.5rem;
}

#user-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 1.5rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#user-input:focus {
    border-color: #007bff;
}

button {
    padding: 0.8rem 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

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

button:active {
    transform: scale(0.98);
}