:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --bg-color: #f4f7f6;
    --chat-bg: #ffffff;
    --user-msg-bg: #3498db;
    --bot-msg-bg: #ecf0f1;
    --text-color: #2c3e50;
    --light-text: #7f8c8d;
    --border-radius: 12px;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: var(--text-color);
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: var(--chat-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 20px;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #2ecc71;
    border-radius: 50%;
    display: inline-block;
}

.messages-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-color: #fafafa;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    align-self: flex-end;
    background-color: var(--user-msg-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message {
    align-self: flex-start;
    background-color: var(--bot-msg-bg);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Markdown Styling inside bot messages */
.bot-message p {
    margin-top: 0;
    margin-bottom: 12px;
}

.bot-message p:last-child {
    margin-bottom: 0;
}

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

.bot-message li {
    margin-bottom: 6px;
}

.bot-message h1, .bot-message h2, .bot-message h3, .bot-message h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.bot-message h1:first-child, .bot-message h2:first-child, .bot-message h3:first-child {
    margin-top: 0;
}

.bot-message strong {
    color: #2980b9;
    font-weight: 600;
}

.bot-message code {
    background-color: rgba(0,0,0,0.05);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.bot-message hr {
    border: 0;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin: 16px 0;
}

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

.bot-message th, .bot-message td {
    border: 1px solid rgba(0,0,0,0.1);
    padding: 8px;
    text-align: left;
}

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


.typing-indicator {
    padding: 10px 24px;
    color: var(--light-text);
    font-size: 0.85rem;
    font-style: italic;
    display: none;
}

.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

#message-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #edf2f7;
    border-radius: 30px;
    outline: none;
    font-size: 1rem;
    transition: border-color 0.2s;
}

#message-input:focus {
    border-color: var(--accent-color);
}

#send-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
}

#send-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

#send-btn:active {
    transform: scale(0.95);
}

#send-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* Custom Scrollbar */
.messages-area::-webkit-scrollbar {
    width: 6px;
}

.messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.messages-area::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

