:root {
    --primary-color: #2563EB;
    --primary-dark: #1D4ED8;
    --bg-color: #F8FAFC;
    --chat-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border-color: #E2E8F0;
    --message-bot-bg: #F1F5F9;
    --message-user-bg: #2563EB;
    --message-user-text: #FFFFFF;
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    background-color: var(--chat-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

.chat-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10;
}

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

.logo-icon {
    color: var(--primary-color);
}

.header-content h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

.message {
    display: flex;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

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

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.message.bot .message-content {
    background-color: var(--message-bot-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background-color: var(--message-user-bg);
    color: var(--message-user-text);
    border-bottom-right-radius: 4px;
}

/* Markdown Styles inside Bubbles */
.message-content p {
    margin-bottom: 8px;
}

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

.message-content code {
    background: rgba(0,0,0,0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: #1e1e1e;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-bottom: 8px;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--chat-bg);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg-color);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    max-height: 120px;
    padding: 8px 4px;
    outline: none;
}

button#sendBtn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

button#sendBtn:hover {
    background: var(--primary-dark);
}

button#sendBtn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

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

/* Loading Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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