:root {
    --primary-color: #2D3748;
    --secondary-color: #4299E1;
    --background-color: #F7FAFC;
    --message-bg-user: #EBF8FF;
    --message-bg-assistant: #ffffff;
    --border-color: #E2E8F0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
    color: var(--primary-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

header p {
    color: var(--primary-color);
    opacity: 0.8;
}

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

.chat-header {
    padding: 20px;
    background: #1e88e5;
    color: white;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.chat-header h1 {
    margin: 0;
    font-size: 24px;
}

.chat-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 15px;
    border-radius: 15px;
    line-height: 1.5;
}

.user-message {
    align-self: flex-end;
    background-color: #1e88e5;
    color: white;
    margin-left: 20%;
}

.bot-message {
    align-self: flex-start;
    background-color: #f0f2f5;
    color: #1a1a1a;
    margin-right: 20%;
}

.bot-message h1 {
    font-size: 1.5em;
    margin-top: 0;
    color: #1e88e5;
}

.bot-message h2 {
    font-size: 1.2em;
    margin-top: 15px;
    color: #2196f3;
}

.bot-message ul, .bot-message ol {
    margin: 10px 0;
    padding-left: 20px;
}

.bot-message li {
    margin: 5px 0;
}

.loading {
    align-self: center;
    background-color: #e3f2fd;
    color: #1e88e5;
    font-style: italic;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 12px 12px;
}

.chat-form {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.chat-input button {
    padding: 12px 24px;
    background-color: #1e88e5;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.chat-input button:hover {
    background-color: #1976d2;
}

.chat-input button:disabled {
    background-color: #90caf9;
    cursor: not-allowed;
}

.chat-footer {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

.chat-footer p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Markdown Styling */
.bot-message p {
    margin: 8px 0;
}

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

.bot-message blockquote {
    border-left: 4px solid #1e88e5;
    margin: 10px 0;
    padding-left: 10px;
    color: #666;
}

.bot-message table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.bot-message th, .bot-message td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: left;
}

.bot-message th {
    background-color: #f5f5f5;
}

/* Emoji styling */
.bot-message em {
    font-style: normal;
}

.message-content {
    font-size: 0.95rem;
}

.message-content ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.typing-indicator {
    padding: 1rem;
    color: var(--primary-color);
    opacity: 0.7;
    font-style: italic;
}
