/* Drishti - Intelligent Water, Agriculture & Resource AI Platform
   Design Concept: Deep Hydro-Teal (#0284c7), Emerald Earth (#10b981), and Golden Harvest (#f59e0b)
   Iconography: The "All-Seeing Eye of Resources" (Drishti / दृष्टि = Vision / Insight)
*/

:root {
    --drishti-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Drishti Core Palette: Water (Teal/Cyan), Earth (Emerald), Sun (Gold) */
    --drishti-primary: #0284c7;        /* Hydro Cyan/Teal */
    --drishti-primary-glow: rgba(2, 132, 199, 0.35);
    --drishti-emerald: #10b981;        /* Agri Green */
    --drishti-amber: #f59e0b;          /* Resource/Harvest Amber */
    --drishti-gradient: linear-gradient(135deg, #0284c7 0%, #0d9488 50%, #10b981 100%);
    --drishti-accent-gradient: linear-gradient(135deg, #0369a1, #059669);
    
    /* Dark Theme (Hydro-Deep Obsidian Palette) */
    --drishti-bg-main: #0c131a;        /* Deep Aquatic Obsidian */
    --drishti-bg-sidebar: #070d13;     /* Abyss Black */
    --drishti-bg-card: #131f2b;        /* Surface Tile */
    --drishti-bg-input: #121c26;       /* Input Box */
    --drishti-bg-hover: #182836;       /* Hover Pill */
    --drishti-bg-active: #0c131a;
    --drishti-border-subtle: rgba(255, 255, 255, 0.08);
    --drishti-border-focus: rgba(2, 132, 199, 0.55);
    
    --drishti-text-main: #f0f6fc;
    --drishti-text-muted: #94a3b8;
    --drishti-text-faint: #64748b;
    
    --drishti-code-bg: #060b10;
    --drishti-user-bubble: #172432;
    --drishti-shadow-ambient: 0 4px 24px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="light"] {
    /* Clean Hydro-Eco Light Palette */
    --drishti-bg-main: #f8fafc;
    --drishti-bg-sidebar: #f1f5f9;
    --drishti-bg-card: #e2e8f0;
    --drishti-bg-input: #f1f5f9;
    --drishti-bg-hover: #e2e8f0;
    --drishti-bg-active: #cbd5e1;
    --drishti-border-subtle: rgba(0, 0, 0, 0.08);
    --drishti-border-focus: rgba(2, 132, 199, 0.55);
    
    --drishti-text-main: #0f172a;
    --drishti-text-muted: #475569;
    --drishti-text-faint: #94a3b8;
    
    --drishti-code-bg: #0f172a;
    --drishti-user-bubble: #e2e8f0;
    --drishti-shadow-ambient: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Base Body */
body.drishti-body {
    background-color: var(--drishti-bg-main);
    color: var(--drishti-text-main);
    font-family: var(--drishti-font);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Overlay for Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 13, 19, 0.7);
    backdrop-filter: blur(3px);
    z-index: 1040;
    transition: opacity 0.2s ease;
}

.sidebar-backdrop.active {
    display: block;
}

/* Sidebar Layout */
.drishti-sidebar {
    width: 260px;
    background-color: var(--drishti-bg-sidebar);
    border-right: 1px solid var(--drishti-border-subtle);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    flex-shrink: 0;
}

.drishti-sidebar.collapsed {
    margin-left: -260px;
}

/* Buttons and Hover States */
.btn-ghost-hover {
    color: var(--drishti-text-muted);
    background: transparent;
    border: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn-ghost-hover:hover {
    background-color: var(--drishti-bg-hover);
    color: var(--drishti-text-main);
}

.btn-ghost-hover:active {
    transform: scale(0.96);
}

/* ========================================================
   DRISHTI POWERFUL ICON & BRAND LOGO
   ======================================================== */
.drishti-brand-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.2px;
    font-weight: 700;
    background: var(--drishti-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Sidebar Logo Badge: Glowing Eye / Water-Earth Emblem */
.drishti-logo-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 10px var(--drishti-primary-glow);
    overflow: hidden;
    flex-shrink: 0;
    background-color: #0c131a;
    border: 1px solid rgba(2, 132, 199, 0.35);
}

.drishti-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
    display: block;
}

.explore-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--drishti-bg-hover);
    color: var(--drishti-primary);
}

.sidebar-nav-item {
    color: var(--drishti-text-main);
    transition: background-color 0.15s;
}

.sidebar-nav-item:hover {
    background-color: var(--drishti-bg-hover);
}

.sidebar-nav-item.active {
    background-color: var(--drishti-bg-hover);
    border-left: 2px solid var(--drishti-primary);
}

/* History Items */
.history-section-header {
    font-size: 0.72rem;
    letter-spacing: 0.6px;
    color: var(--drishti-text-faint);
    text-transform: uppercase;
    font-weight: 600;
}

.history-item {
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.88rem;
    color: var(--drishti-text-main);
    text-decoration: none;
    position: relative;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}

.history-item:hover {
    background-color: var(--drishti-bg-hover);
}

.history-item.active {
    background-color: var(--drishti-bg-hover);
    font-weight: 500;
    border-left: 2px solid var(--drishti-primary);
}

.history-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.history-actions {
    display: none;
    opacity: 0.8;
}

.history-item:hover .history-actions,
.history-item.active .history-actions {
    display: flex;
}

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

/* Main Chat Section */
.drishti-main-content {
    background-color: var(--drishti-bg-main);
    position: relative;
    height: 100vh;
}

.chat-top-bar {
    height: 56px;
    border-bottom: 1px solid var(--drishti-border-subtle);
    z-index: 10;
}

.btn-model-selector {
    color: var(--drishti-text-main);
    background-color: transparent;
    border: none;
    font-size: 1.05rem;
    transition: background-color 0.15s;
}

.btn-model-selector:hover {
    background-color: var(--drishti-bg-hover);
}

/* Model / Agent Selector Dropdown Menu */
.drishti-model-dropdown-menu {
    background-color: var(--drishti-bg-card) !important;
    border: 1px solid var(--drishti-border-subtle) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    border-radius: 14px;
    min-width: 320px;
    padding: 6px;
}

.drishti-model-dropdown-menu .dropdown-item {
    color: var(--drishti-text-main) !important;
    background-color: transparent;
    padding: 10px 14px;
    transition: background-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.drishti-model-dropdown-menu .dropdown-item .fw-semibold {
    color: var(--drishti-text-main);
    transition: color 0.15s ease;
}

.drishti-model-dropdown-menu .dropdown-item .text-secondary {
    color: var(--drishti-text-muted) !important;
    font-size: 0.78rem;
    line-height: 1.4;
    transition: color 0.15s ease;
}

/* Dark Theme Dropdown Hover & Active States */
[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item:focus {
    background-color: var(--drishti-bg-hover) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item:hover .fw-semibold,
[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item:focus .fw-semibold {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item:hover .text-secondary,
[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item:focus .text-secondary {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item.active {
    background-color: rgba(2, 132, 199, 0.16) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item.active .fw-semibold {
    color: #38bdf8 !important;
}

[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item.active .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .drishti-model-dropdown-menu .dropdown-item.active .check-icon {
    color: var(--drishti-primary) !important;
}

/* Light Theme Dropdown Rules & High-Contrast States */
[data-bs-theme="light"] .drishti-model-dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item {
    color: #0f172a !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item .fw-semibold {
    color: #0f172a !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item .text-secondary {
    color: #64748b !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item:hover,
[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item:focus {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item:hover .fw-semibold,
[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item:focus .fw-semibold {
    color: #0284c7 !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item:hover .text-secondary,
[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item:focus .text-secondary {
    color: #334155 !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item.active {
    background-color: #e0f2fe !important; /* Soft cyan/sky tint */
    color: #0369a1 !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item.active .fw-semibold {
    color: #0284c7 !important;
    font-weight: 700 !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item.active .text-secondary {
    color: #0369a1 !important;
}

[data-bs-theme="light"] .drishti-model-dropdown-menu .dropdown-item.active .check-icon {
    color: #0284c7 !important;
}

/* ========================================================
   ZERO STATE / BIG DRISHTI LOGO
   ======================================================== */
.empty-state-view {
    max-width: 820px;
}

.drishti-big-logo {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    box-shadow: 0 8px 30px var(--drishti-primary-glow), 0 0 24px rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background-color: #0c131a;
    border: 2px solid rgba(2, 132, 199, 0.45);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    animation: drishtiPulse 3.5s infinite ease-in-out;
}

.drishti-big-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px var(--drishti-primary-glow), 0 0 30px rgba(16, 185, 129, 0.5);
}

.drishti-big-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    display: block;
}

@keyframes drishtiPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 30px var(--drishti-primary-glow), 0 0 20px rgba(16, 185, 129, 0.25);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 36px rgba(2, 132, 199, 0.5), 0 0 28px rgba(16, 185, 129, 0.45);
    }
}

.domain-pill {
    font-size: 0.72rem;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--drishti-border-subtle);
    background-color: var(--drishti-bg-card);
    color: var(--drishti-text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.domain-pill:hover {
    border-color: rgba(2, 132, 199, 0.5);
    color: var(--drishti-text-main);
    transform: translateY(-1px);
}

.domain-pill.active {
    border-color: rgba(2, 132, 199, 0.5);
    background-color: rgba(2, 132, 199, 0.12);
    color: var(--drishti-primary);
    font-weight: 600;
}

.suggestion-card {
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    border: 1px solid var(--drishti-border-subtle);
    background-color: transparent;
    cursor: pointer;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    background-color: var(--drishti-bg-hover);
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.suggestion-card:active {
    transform: scale(0.98);
}

/* ========================================================
   CHAT MESSAGES LAYOUT & FORMATTING
   ======================================================== */
.chat-messages-inner {
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.message-row {
    padding: 1.25rem 0;
    width: 100%;
}

/* USER ROW: Right aligned bubble with crisp styling */
.message-row.user-row {
    display: flex;
    justify-content: flex-end;
}

.message-bubble-user {
    background-color: var(--drishti-user-bubble);
    color: var(--drishti-text-main);
    max-width: 74%;
    padding: 0.85rem 1.25rem;
    border-radius: 1.4rem;
    word-break: break-word;
    font-size: 0.96rem;
    line-height: 1.6;
    border: 1px solid var(--drishti-border-subtle);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ASSISTANT ROW: Left aligned with Drishti avatar */
.message-row.assistant-row {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    width: 100%;
}

.avatar-drishti {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    box-shadow: 0 2px 10px var(--drishti-primary-glow);
    overflow: hidden;
    background-color: #0c131a;
    border: 1px solid rgba(2, 132, 199, 0.35);
}

.avatar-drishti-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
    display: block;
}

.assistant-content {
    flex-grow: 1;
    overflow-x: auto;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--drishti-text-main);
    min-width: 0;
}

/* Markdown Elements Styling */
.assistant-content h1, 
.assistant-content h2, 
.assistant-content h3, 
.assistant-content h4 {
    font-weight: 600;
    margin-top: 1.4rem;
    margin-bottom: 0.6rem;
    color: var(--drishti-text-main);
}

.assistant-content h1 { font-size: 1.4rem; }
.assistant-content h2 { font-size: 1.25rem; }
.assistant-content h3 { font-size: 1.1rem; }

.assistant-content p {
    margin-bottom: 0.95rem;
}

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

.assistant-content ul, 
.assistant-content ol {
    margin-bottom: 0.95rem;
    padding-left: 1.5rem;
}

.assistant-content li {
    margin-bottom: 0.35rem;
}

.assistant-content blockquote {
    border-left: 3px solid var(--drishti-primary);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: rgba(2, 132, 199, 0.08);
    border-radius: 0 8px 8px 0;
}

/* Inline Code */
.assistant-content :not(pre) > code {
    background-color: var(--drishti-bg-card);
    color: #38bdf8;
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border: 1px solid var(--drishti-border-subtle);
}

/* Structured Markdown Tables */
.assistant-content table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    font-size: 0.92rem;
    border: 1px solid var(--drishti-border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

.assistant-content th, 
.assistant-content td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--drishti-border-subtle);
}

.assistant-content th {
    background-color: var(--drishti-bg-card);
    font-weight: 600;
    color: var(--drishti-text-main);
    border-bottom: 2px solid var(--drishti-primary);
}

.assistant-content tr:last-child td {
    border-bottom: none;
}

/* Code Blocks with Header Bar */
.code-block-container {
    background-color: var(--drishti-code-bg);
    border-radius: 10px;
    overflow: hidden;
    margin: 1.2rem 0;
    border: 1px solid var(--drishti-border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.code-header {
    background-color: rgba(255, 255, 255, 0.04);
    padding: 7px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--drishti-text-muted);
    border-bottom: 1px solid var(--drishti-border-subtle);
}

.code-header button {
    background: transparent;
    border: none;
    color: var(--drishti-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 5px;
    transition: background-color 0.15s, color 0.15s;
}

.code-header button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--drishti-text-main);
}

.code-block-container pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: transparent;
}

.code-block-container code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.88rem;
    line-height: 1.55;
}

/* Typing Indicator Animation */
.typing-bubble {
    width: fit-content;
}

.typing-dot {
    width: 7px;
    height: 7px;
    margin: 0 2px;
    background-color: var(--drishti-primary);
    border-radius: 50%;
    animation: typingBounce 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 typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Feedback Actions */
.message-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.message-row:hover .message-actions {
    opacity: 1;
}

/* Scroll-to-bottom Floating Button */
#btn-scroll-bottom {
    background-color: var(--drishti-bg-card);
    color: var(--drishti-text-main);
    border: 1px solid var(--drishti-border-subtle);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

#btn-scroll-bottom:hover {
    transform: translateY(-2px);
    background-color: var(--drishti-bg-hover);
    border-color: var(--drishti-primary);
}

/* ========================================================
   BOTTOM CHAT INPUT AREA & DEDICATED STOP PILL
   ======================================================== */
.chat-input-area {
    background: linear-gradient(180deg, rgba(12, 19, 26, 0) 0%, var(--drishti-bg-main) 30%);
}

[data-bs-theme="light"] .chat-input-area {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, var(--drishti-bg-main) 30%);
}

/* Floating Stop Pill anchored neatly above the prompt box */
.stop-pill-container {
    min-height: 38px;
}

.btn-stop-pill {
    background-color: var(--drishti-bg-card);
    color: var(--drishti-text-main);
    border: 1px solid var(--drishti-border-subtle);
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.15s ease;
    backdrop-filter: blur(8px);
}

.btn-stop-pill:hover {
    background-color: var(--drishti-bg-hover);
    border-color: var(--drishti-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--drishti-primary-glow);
}

.stop-square-icon {
    width: 11px;
    height: 11px;
    background-color: var(--drishti-primary);
    border-radius: 2px;
    display: inline-block;
}

/* Prompt Input Box */
.input-box-wrapper {
    background-color: var(--drishti-bg-input);
    border: 1px solid var(--drishti-border-subtle);
    box-shadow: var(--drishti-shadow-ambient);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-box-wrapper:focus-within {
    border-color: var(--drishti-border-focus);
    box-shadow: 0 0 25px rgba(2, 132, 199, 0.25);
}

[data-bs-theme="light"] .input-box-wrapper:focus-within {
    border-color: var(--drishti-border-focus);
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.15);
}

.custom-textarea {
    resize: none;
    max-height: 200px;
    min-height: 24px;
    outline: none;
    font-size: 0.98rem;
    line-height: 1.5;
    padding-top: 4px;
    padding-bottom: 4px;
}

.custom-textarea::placeholder {
    color: var(--drishti-text-muted);
}

/* Send Action Button inside Input Wrapper */
.btn-send-message {
    background-color: var(--drishti-text-main);
    color: var(--drishti-bg-main);
    border: none;
    width: 32px;
    height: 32px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
    cursor: pointer;
}

.btn-send-message i {
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
}

.btn-send-message:hover:not(.disabled) {
    background: var(--drishti-gradient);
    color: #ffffff;
    opacity: 1;
    transform: scale(1.06);
    box-shadow: 0 0 10px var(--drishti-primary-glow);
}

.btn-send-message.disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* User avatar */
.user-avatar {
    width: 32px;
    height: 32px;
}

.bg-drishti-avatar {
    background: linear-gradient(135deg, #0369a1, #0f766e);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .drishti-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100vh;
    }

    .drishti-sidebar.collapsed {
        margin-left: -260px;
    }

    .drishti-sidebar:not(.collapsed) {
        margin-left: 0;
        box-shadow: 6px 0 24px rgba(0, 0, 0, 0.7);
    }

    .message-actions {
        opacity: 1;
    }

    .message-bubble-user {
        max-width: 88%;
    }
}

/* Document Attachments in Input Bar */
#attachments-preview-container {
    max-height: 120px;
    overflow-y: auto;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: var(--drishti-bg-card);
    border: 1px solid var(--drishti-border-subtle);
    border-radius: 12px;
    font-size: 0.82rem;
    color: var(--drishti-text-main);
    transition: all 0.2s ease;
    max-width: 280px;
}

.attachment-chip.loading {
    opacity: 0.75;
}

.attachment-chip .chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    font-weight: 500;
}

.attachment-chip .chip-meta {
    font-size: 0.72rem;
    color: var(--drishti-text-muted);
}

.attachment-chip .btn-remove-attachment {
    background: none;
    border: none;
    padding: 0;
    margin-left: 2px;
    color: var(--drishti-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.attachment-chip .btn-remove-attachment:hover {
    color: #ef4444;
}

/* Document Chip inside User Chat Message Bubble */
.user-attachment-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 0.82rem;
}

[data-bs-theme="light"] .user-attachment-card {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Drag & Drop Full Chat Overlay */
.drag-drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 13, 19, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

[data-bs-theme="light"] .drag-drop-overlay {
    background: rgba(241, 245, 249, 0.85);
}

.drag-drop-modal {
    background: var(--drishti-bg-card);
    border: 2px dashed var(--drishti-primary);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    max-width: 480px;
    width: 90%;
    animation: dragPulse 2.4s infinite ease-in-out;
}

.drag-icon-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes dragPulse {
    0%, 100% {
        transform: scale(1);
        border-color: var(--drishti-primary);
        box-shadow: 0 16px 48px rgba(2, 132, 199, 0.25);
    }
    50% {
        transform: scale(1.02);
        border-color: var(--drishti-emerald);
        box-shadow: 0 20px 54px rgba(16, 185, 129, 0.3);
    }
}

/* Drishti Quick-Info Toast Notification Pill */
.drishti-quick-toast {
    background-color: var(--drishti-bg-card) !important;
    border: 1px solid var(--drishti-border-subtle) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px !important; /* Elegant pill shape */
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;
    color: var(--drishti-text-main);
    max-width: 380px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

[data-bs-theme="light"] .drishti-quick-toast {
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12) !important;
}

.toast-quick-icon {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-quick-content {
    font-weight: 500;
    line-height: 1.35;
    font-size: 0.82rem;
    color: var(--drishti-text-main);
}

/* RAG Citations Accordion in Assistant Message */
.rag-citation-box {
    margin-bottom: 12px;
}

.rag-citation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .rag-citation-toggle {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.25);
}

.rag-citation-toggle:hover {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
}

[data-bs-theme="light"] .rag-citation-toggle:hover {
    background: rgba(2, 132, 199, 0.14);
    color: #0284c7;
}

.rag-citation-toggle .chevron-icon {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}

.rag-citation-toggle[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.rag-citation-list {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="light"] .rag-citation-list {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.rag-citation-item {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 0.8rem;
}

[data-bs-theme="light"] .rag-citation-item {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

.rag-citation-match-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.25);
}



