@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-primary: #050505;
    --bg-secondary: #0d0d0d;
    --accent: #3b82f6;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --border: #1f1f1f;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    min-height: 100dvh;
    overflow: auto;
    transition: background-color 0.3s ease;
}

html {
    height: 100%;
}

/* Make scrolling work smoothly across desktop/mobile and long conversations. */
#chat-window {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#messages-container {
    padding-bottom: max(8rem, env(safe-area-inset-bottom));
}

.stealth-mode {
    --bg-primary: #000000;
    --bg-secondary: #050505;
    --accent: #2563eb;
    --border: #111111;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #333;
}

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

.animate-fade-in {
    animation: fadeInUp 0.4s cubic-bezier(0, 0, 0.2, 1) forwards;
}

/* Chat Layout */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message-user {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 1.25rem 1.25rem 0.25rem 1.25rem;
}

.message-assistant {
    background-color: transparent;
}

/* Markdown Styling */
.prose pre {
    background: #0a0a0a !important;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem 1rem;
    margin: 1rem 0;
    position: relative;
    overflow-x: auto;
}

.code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    gap: 0.75rem;
}

.code-lang {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b949e;
}

.prose code {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    color: #60a5fa;
}

.copy-btn {
    position: static;
    padding: 4px 8px;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 6px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #333;
    color: #fff;
}

/* Thinking Dots */
.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--text-secondary);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Glassmorphism */
.glass {
    background: rgba(13, 13, 13, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}

/* Sidebar Styling */
#sidebar {
    background: linear-gradient(180deg, #0d0d0d 0%, #050505 100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover .trash-icon {
    opacity: 1;
}

/* Input Area */
.input-wrapper {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

#mic-btn.mic-active {
    color: #60a5fa;
    background: rgba(37, 99, 235, 0.18);
}

.attachment-pill {
    max-width: 100%;
}
