:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --accent-cyan: #00d4ff;
    --accent-violet: #8b5cf6;
    --accent-amber: #f59e0b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: #1e3a5f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet), var(--accent-amber));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar-custom {
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.5rem;
    flex-shrink: 0;
}

.navbar-custom .brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent-cyan);
    text-decoration: none;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-custom .brand:hover { color: var(--accent-cyan); }

.logo-img {
    height: 28px;
    width: auto;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar { width: 6px; }
.chat-container::-webkit-scrollbar-track { background: var(--bg-primary); }
.chat-container::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

/* Messages */
.message {
    display: flex;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease-out;
}

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

.message.user { justify-content: flex-end; }

.message-bubble {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    line-height: 1.6;
    font-size: 0.9rem;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-bottom-right-radius: 0.25rem;
}

.message.assistant .message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 0.25rem;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.message.user .message-avatar {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
    order: 1;
    margin-left: 0.75rem;
}

.message.assistant .message-avatar {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-violet);
    margin-right: 0.75rem;
}

.sources-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(30, 58, 95, 0.5);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.sources-section i { margin-right: 0.25rem; }

.source-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin: 0.15rem;
    background: rgba(30, 58, 95, 0.3);
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Welcome */
.welcome-section {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.example-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.example-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.example-btn:hover {
    border-color: rgba(0, 212, 255, 0.4);
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.05);
}

/* Input Area */
.input-area {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    max-width: 900px;
    margin: 0 auto;
}

.input-wrapper textarea {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    resize: none;
    min-height: 44px;
    max-height: 150px;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.5);
}

.input-wrapper textarea::placeholder { color: var(--text-muted); }

.btn-send {
    width: 44px;
    height: 44px;
    background: var(--accent-cyan);
    border: none;
    border-radius: 0.75rem;
    color: var(--bg-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-send:hover {
    background: #33ddff;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}

.btn-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Footer */
.footer-info {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-top: 1px solid rgba(30, 58, 95, 0.3);
}

@media (max-width: 768px) {
    .message-bubble { max-width: 85%; }
    .welcome-section { padding: 2rem 1rem; }
    .welcome-section h2 { font-size: 1.3rem; }
}