:root {
    --bg-primary: #ffffff; 
    --bg-chat: #ffffff;
    --header-bg: #2b3a82;
    --text-primary: #374151;
    --text-header: #ffffff;
    --text-subtitle: #e5e7eb;
    --border-color: #eaecf0;
    --bot-bg: #fdfdfd;
    --bot-border: #f0f0f0;
    --input-area-bg: #f8f9fa;
    --send-btn-bg: #8ba2cb;
    --send-btn-hover: #7b94bf;
    --chat-max-width: 800px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.chat-interface {
    width: 100%;
    max-width: var(--chat-max-width);
    height: 90vh; /* roughly taking up most */
    background: var(--bg-chat);
    border: 1px solid #d1d5db;
    border-radius: 8px; /* Slightly less rounded than before */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 24px 32px;
    background: var(--header-bg);
    color: var(--text-header);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-subtitle);
    font-weight: 400;
}

.chat-messages {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background-color: var(--bg-chat);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 4px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.message-content {
    line-height: 1.6;
    font-size: 1.05rem;
    word-break: break-word;
}

.assistant-message {
    align-self: flex-start;
}

.assistant-message .message-content {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px 24px;
    color: #4b5563;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* User Message */
.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: #eff6ff; 
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 16px 20px;
    color: #1e3a8a;
}

.typing-indicator {
    align-self: flex-start;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px 24px;
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    margin-left: 32px;
}

.typing-indicator.hidden {
    display: none;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
    padding: 20px 32px;
    display: flex;
    gap: 16px;
    background: #f9fafb;
    border-top: 1px solid var(--border-color);
}

#message-input {
    flex: 1;
    background: #ffffff;
    border: 1px solid #d1d5db; /* Grey border for input */
    border-radius: 6px;
    padding: 16px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

#message-input:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 2px rgba(156, 163, 175, 0.2);
}

#message-input::placeholder {
    color: #9ca3af;
}

.send-button {
    background: var(--send-btn-bg);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    min-width: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.send-button:not(:disabled):hover {
    background: var(--send-btn-hover);
}

.send-button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.message-content p {
    margin-bottom: 0px; 
}
