:root {
    /* Light theme based on MIT help page color scheme */
    --background: 0 0% 98%;
    /* very light grey page background */
    --foreground: 222 47% 11%;
    /* dark text */
    --card: 0 0% 100%;
    /* white cards / bubbles */
    --primary: 213 79% 46%;
    /* MIT-style blue for links/buttons */
    --primary-foreground: 0 0% 100%;
    /* white text on primary */
    --secondary: 0 0% 97%;
    /* subtle grey section background */
    --muted: 210 16% 93%;
    /* light grey for assistant bubbles */
    --muted-foreground: 215 16% 35%;
    /* muted text */
    --border: 210 14% 90%;
    /* light grey borders */
    --input: 210 14% 90%;
    --ring: 213 79% 46%;
    /* focus ring in primary blue */
    --radius: 0.5rem;

    /* Legacy compatibility / UI specific */
    --bg-primary: hsl(var(--background));
    --bg-secondary: hsl(var(--card));
    --bg-sidebar: hsl(var(--card));
    --bg-input: hsl(var(--background));
    --text-primary: hsl(var(--foreground));
    --text-secondary: hsl(var(--muted-foreground));
    --text-muted: hsl(var(--muted-foreground) / 0.7);
    --border-color: hsl(var(--border));
    --border-light: hsl(var(--muted));

    --accent-primary: hsl(var(--primary));
    --accent-secondary: hsl(var(--primary) / 0.85);
    --accent-gradient: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(213 79% 60%) 100%);

    --user-bubble-bg: hsl(var(--primary));
    --user-bubble-text: hsl(var(--primary-foreground));
    --assistant-bubble-bg: hsl(var(--muted));
    --assistant-bubble-text: hsl(var(--foreground));

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);

    --sidebar-width: 260px;
    --header-height: 56px;
}

[data-theme="dark"] {
    --background: 222 47% 11%;
    --foreground: 210 40% 98%;
    --card: 217 33% 17%;
    --primary: 239 84% 67%;
    --muted: 217 33% 18%;
    --muted-foreground: 215 20% 65%;
    --border: 217 33% 22%;
    --input: 217 33% 22%;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== App Container ===== */
.app-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    overflow: hidden;
}

/* ===== Loading Screen ===== */
.loading-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-screen p {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* ===== Error Screen ===== */
.error-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 1000;
    padding: 24px;
    text-align: center;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-screen h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-screen p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.retry-button {
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.retry-button:hover {
    background: var(--accent-secondary);
}

/* ===== Hidden Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Chat Interface ===== */
.chat-interface {
    display: flex;
    width: 100%;
    height: 100%;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 72px;
    border-right: 1px solid var(--border-color);
}

.sidebar.collapsed .logo-container,
.sidebar.collapsed .new-chat-btn span,
.sidebar.collapsed .history-section {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 0;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .new-chat-btn {
    justify-content: center;
    padding: 10px;
    position: relative;
}

.sidebar.collapsed .new-chat-btn:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    color: #000000;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
    border: 1px solid var(--border-light);
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}

.sidebar.collapsed .new-chat-btn svg {
    margin-right: 0;
    width: 28px;
    height: 28px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.logo-container {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.toggle-sidebar-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.toggle-sidebar-btn:hover {
    background: var(--border-light);
}

.toggle-sidebar-btn svg {
    width: 18px;
    height: 18px;
}

/* New Chat Button */
.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px;
    padding: 12px 16px;
    background: var(--btn-new-chat-bg, var(--accent-gradient));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.new-chat-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.new-chat-btn svg {
    width: 18px;
    height: 18px;
}

/* History Section */
.history-section {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-label {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

/* Sidebar Footer - keeps theme toggle fixed at bottom */
.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-sidebar);
    flex-shrink: 0;
    margin-top: auto;
}

/* History Item */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
    /* Ensure content doesn't overlap with absolute buttons */
}

.history-item:hover {
    background: var(--border-light);
}

.history-item.active {
    background: var(--border-color);
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-title {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    outline: none;
}

.history-item-actions {
    display: flex;
    gap: 4px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding-left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.history-item:hover .history-item-actions {
    opacity: 1;
    pointer-events: auto;
}

.history-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.history-action-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.history-action-btn.delete:hover {
    color: #ef4444;
}

.history-action-btn svg {
    width: 14px;
    height: 14px;
}

/* ==============================================================================================================*/

.chat-interface.chat-empty .chat-main {
    display: flex;
    flex-direction: column;
}

.chat-interface.chat-empty .messages-container {
    display: none;
}

.chat-interface.chat-empty .chat-form {
    margin-top: auto;
    margin-bottom: auto;
    position: relative;
    background: transparent;
    border-top: none;
}

.chat-interface.chat-empty .input-wrapper {
    max-width: 720px;
}

/* ===== Chat Info Text  ===== */
.chat-info {
    margin-top: 4px;
    padding-bottom: 4px;
    font-size: 12px;
    color: hsl(var(--muted-foreground));
    text-align: center;
    line-height: 1.2;
    display: none;
    pointer-events: none;
}

/* Show info text only when chat has messages */
.chat-interface:not(.chat-empty) .chat-info {
    display: block;
}

/* ===== Empty Chat Message with Icon ===== */
.empty-chat-message {
    display: none;
    margin-bottom: 28px;
    margin-top: -40px;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

.chat-interface.chat-empty .empty-chat-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-chat-icon {
    width: 48px;
    height: 48px;
    color: hsl(var(--muted-foreground));
    opacity: 0.7;
}

.empty-chat-icon svg {
    width: 100%;
    height: 100%;
}

.empty-chat-text {
    font-size: 1rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    max-width: 420px;
    line-height: 1.4;
}


/* ====================================================================================================== */

/* ===== Main Chat Area ===== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-primary);
}

/* Chat Header */
.chat-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--foreground);

    flex-shrink: 0;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* Show header toggle when sidebar is collapsed */
.sidebar.collapsed+.chat-main .mobile-menu-btn {
    display: none;
    /* Hidden on desktop because we have the rail */
}

@media (max-width: 768px) {
    .sidebar.collapsed {
        width: 0;
        /* Fully hide on mobile */
        border-right: none;
    }

    .sidebar.collapsed+.chat-main .mobile-menu-btn {
        display: flex;
        /* Show hamburger on mobile */
    }
}

.header-new-chat-btn {
    display: none !important;
    /* Always hide, replaced by rail */
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
}

.collection-name {
    display: none;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: var(--border-light);
    border-color: var(--accent-primary);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: hsl(var(--background));
}

.messages-end {
    height: 1px;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row {
    display: flex;
    width: 100%;
}

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

.message-row.assistant {
    justify-content: flex-start;
}

.message-content {
    animation: fadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.message-time {
    font-size: 10px;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

.message-text-wrapper {
    flex: 1;
}

.message-content {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 0.75rem;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.message-row.user .message-content {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    max-width: 65%;
}

.message-row.assistant .message-content {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border) / 0.8);
    width: 80%;
    max-width: 80%;
    min-width: 80%;
}

#typing-indicator .message-content {
    width: fit-content;
    max-width: 80%;
    min-width: auto;
}

/* List Styles */
.message-body ul,
.message-body ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message-body ul {
    list-style-type: disc !important;
}

.message-body ol {
    list-style-type: decimal !important;
}

.message-body li {
    margin-bottom: 4px;
    display: list-item !important;
    /* Ensure markers are shown */
}

.message-body .chat-suggestion-section {
    margin-top: 8px;
}

.message-body .chat-suggestion-title {
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    margin-bottom: 6px;
}

.message-body .chat-suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-body .chat-suggestion-item {
    width: 100%;
    text-align: left;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: hsl(var(--foreground) / 0.85);
    font-size: 12px;
    line-height: 1.35;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.message-body .chat-suggestion-item:hover {
    background: hsl(var(--muted) / 0.55);
    border-color: hsl(var(--border));
}

/* Clickable URLs in assistant/user message HTML */
.message-body a.chat-inline-link {
    color: hsl(var(--primary));
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: hsl(var(--primary) / 0.45);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.message-body a.chat-inline-link:hover {
    text-decoration-color: hsl(var(--primary));
}

.message-row.user .message-body a.chat-inline-link {
    color: hsl(var(--primary-foreground));
    text-decoration-color: hsl(var(--primary-foreground) / 0.55);
}

.message-row.user .message-body a.chat-inline-link:hover {
    text-decoration-color: hsl(var(--primary-foreground));
}

/* Message Time - Hidden per request */
.message-time {
    display: none;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.message-row.user .message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Stop Button */

.stop-btn {

    height: 2.75rem;

    padding: 0 1rem;

    display: flex;

    align-items: center;

    justify-content: center;

    background: hsl(0 84% 60%);

    border: none;

    border-radius: var(--radius);

    cursor: pointer;

    color: white;

    transition: opacity 0.2s, transform 0.2s;

}



.stop-btn:hover {

    opacity: 0.9;

    transform: scale(1.02);

}



.stop-btn svg {

    width: 20px;

    height: 20px;

}

/* Sources */
.message-sources {
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .message-sources {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.sources-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.source-item:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.source-item.web {
    /* subtle blue-tinted background for web sources */
    background: rgba(25, 118, 210, 0.06);
}

.source-item svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
}

.message-poc {
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .message-poc {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.message-poc .sources-label {
    margin-bottom: 2px !important;
}

.poc-contact-list {
    display: flex;
    flex-direction: column;
    gap: 2px !important;
    margin-top: 0 !important;
}

.poc-contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.poc-contact-card:hover {
    background: rgba(20, 184, 166, 0.05);
    border-color: rgba(20, 184, 166, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.poc-card-left {
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
}

.poc-contact-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.poc-separator {
    margin: 0 8px;
    opacity: 0.4;
}

.poc-role, .poc-email, .poc-phone {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.poc-email {
    color: var(--accent-primary);
}

.poc-mail-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.7;
}

.loading-spinner-small {
    width: 1rem;
    height: 1rem;
    border: 2px solid hsl(var(--muted-foreground) / 0.2);
    border-top-color: hsl(var(--muted-foreground));
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.thinking-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thinking-text {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.thinking-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
}


.thinking-logo {
    height: 1.25rem;
    width: 1.25rem;
    opacity: 0.9;
}

.typing-dots {

    display: flex;
    gap: 2px;
    align-items: center;
}



.typing-dots .dot {

    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent-primary);
    animation: typingPulse 1s infinite ease-in-out both;
}



.typing-dots .dot:nth-child(1) {
    animation-delay: 0s;
}



.typing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}



.typing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-5px);
        opacity: 1;
    }

}

/* Empty State */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50vh;
    color: hsl(var(--muted-foreground));
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1rem;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Chat Form ===== */
.chat-form {
    padding: 12px;
    background: hsl(var(--background));
    /* changed the background colour */

    flex-shrink: 0;
    position: sticky;
    bottom: 0;
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.message-input {
    flex: 1;
    height: 44px;
    min-height: 44px; 
    padding: 11px 10px;
    font-weight: 200; 
    border: 1px solid hsl(var(--input));
    border-radius: 6px;
    background: hsl(var(--background));
    font-size: 0.875rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: hsl(var(--foreground));
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
    resize: none;
    box-shadow: none;
    appearance: none;
    max-height: 44px;
    overflow: hidden;
    box-sizing: border-box;
    scrollbar-gutter: stable;
    display: block;
    width: 100%;
}

.message-input::-webkit-scrollbar {
    width: 10px;
}

.message-input::-webkit-scrollbar-track {
    background: transparent;
}
.message-input::placeholder {
    color: #6b7280;   
    opacity: 1;          
    font-size: 14px;
    font-weight: 400;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.message-input::-webkit-scrollbar-thumb {
    background-color: hsl(var(--muted));
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: content-box;

}

.message-input:focus {
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
    border-color: hsl(var(--ring));
}

.send-btn {
    height: 2.75rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--btn-send-bg, hsl(var(--primary)));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: hsl(var(--primary-foreground));
    transition: opacity 0.2s;
}

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

.send-btn:not(:disabled):hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-btn {
        display: flex;
    }

    .message-content {
        max-width: 85%;
    }

    .messages-container {
        padding: 16px;
    }

    .chat-form {
        padding: 12px 16px;
    }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.visible {
    display: block;
}
html,
#root {
  background-color: hsl(var(--background));
  height: 100%;
}

/* Make body fill viewport and inherit background variable */
body {
  min-height: 100vh;
  background-color: hsl(var(--background));
}

/* Basic custom scrollbar that adapts to theme via CSS variables. */
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: hsl(var(--background));
}

*::-webkit-scrollbar-thumb {
  background-color: hsl(var(--muted));
  border-radius: 9999px;
  border: 3px solid hsl(var(--background));
}
