@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    background-color: #050505;
    color: #ececec;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chat-container {
    height: calc(100vh - 140px);
    overflow-y: auto;
    scroll-behavior: auto; /* Managed by JS for smart scrolling */
}

/* User Message Bubble */
.user-message {
    background-color: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Markdown Rendering Overrides */
.prose {
    max-width: none !important;
    font-size: 0.95rem;
    line-height: 1.6;
}

.prose pre {
    background-color: #0d0d0d !important;
    border: 1px solid #2a2a2a;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

/* Code Block Wrapper for Copy Button */
.code-block-wrapper {
    position: relative;
    margin: 1rem 0;
}

.code-block-wrapper pre {
    margin: 0 !important;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #222;
    border: 1px solid #444;
    color: #aaa;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.copy-btn:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

.copy-btn.copied {
    background: #059669;
    color: #fff;
    border-color: #047857;
}

.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85em;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.3rem;
    border-radius: 0.25rem;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
}

.prose p { margin-bottom: 1rem; }
.prose ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose h1, .prose h2, .prose h3 { font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #fff; }
.prose a { color: #10B981; text-decoration: underline; text-underline-offset: 2px; }

/* Thinking Block */
.thinking-block {
    border-left: 2px solid #333;
    background-color: #0f0f0f;
}

.thinking-block[open] {
    border-left-color: #10B981;
}

/* Message Controls (Hover) */
.message-row {
    position: relative;
}

.message-controls {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.message-row:hover .message-controls {
    opacity: 1;
}

/* Toggle Switch Styles */
.toggle-checkbox:checked { right: 0; border-color: #10B981; }
.toggle-checkbox:checked + .toggle-label { background-color: #10B981; }

/* Typing Indicator Animation */
.typing-dot {
    animation: typing 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 typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Sidebar active state */
.sidebar-item { transition: all 0.2s; }
.sidebar-item:hover { background-color: #1a1a1a; }
.sidebar-item.active { background-color: #10B981; color: #fff; border-color: #047857; }
