/**
 * Drishti - VB-G RAM G Specialist Custom Stylesheet
 * ==================================================
 * Clean, modern, minimalist AI consultation interface.
 */

:root {
    --drishti-primary: #0284c7;
    --drishti-primary-glow: rgba(2, 132, 199, 0.25);
    --drishti-gold: #f59e0b;
    --drishti-gold-subtle: rgba(245, 158, 11, 0.12);
    --drishti-main-bg: #0b1118;
    --drishti-card-bg: #121c26;
    --drishti-input-bg: #111a24;
    --drishti-user-bubble: #162230;
    --drishti-border: rgba(255, 255, 255, 0.08);
    --drishti-border-hover: rgba(2, 132, 199, 0.4);
}

[data-bs-theme="light"] {
    --drishti-main-bg: #f8fafc;
    --drishti-card-bg: #ffffff;
    --drishti-input-bg: #ffffff;
    --drishti-user-bubble: #f1f5f9;
    --drishti-border: rgba(0, 0, 0, 0.08);
    --drishti-border-hover: rgba(2, 132, 199, 0.5);
}

body.vbgramg-body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--drishti-main-bg);
    color: var(--bs-body-color);
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* App Navbar */
.vbgramg-navbar {
    height: 56px;
    background-color: var(--drishti-main-bg);
    border-bottom: 1px solid var(--drishti-border) !important;
}

/* Logo badges */
.drishti-nav-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--drishti-border);
}

.drishti-nav-logo img,
.drishti-hero-logo img,
.drishti-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.drishti-hero-logo {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid rgba(2, 132, 199, 0.35);
    box-shadow: 0 4px 20px var(--drishti-primary-glow);
}

/* Main Content Area */
.main-content {
    background-color: var(--drishti-main-bg);
}

/* Suggestion Cards */
.suggestion-card {
    background: var(--drishti-card-bg);
    border: 1px solid var(--drishti-border);
    color: var(--bs-body-color);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

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

.suggestion-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--drishti-gold-subtle);
    color: var(--drishti-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

/* Message Rows */
.message-row {
    display: flex;
    margin-bottom: 24px;
    width: 100%;
}

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

.user-bubble {
    max-width: 80%;
    background-color: var(--drishti-user-bubble);
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    border: 1px solid var(--drishti-border);
}

.assistant-row {
    justify-content: flex-start;
    gap: 12px;
}

.drishti-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid var(--drishti-border);
}

.assistant-content {
    flex-grow: 1;
    max-width: calc(100% - 44px);
    font-size: 0.95rem;
    line-height: 1.65;
    word-break: break-word;
}

/* Markdown formatting */
.assistant-content table {
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.assistant-content th,
.assistant-content td {
    padding: 8px 12px;
    border: 1px solid var(--drishti-border);
}

.assistant-content th {
    background: rgba(2, 132, 199, 0.12);
    font-weight: 600;
}

.assistant-content pre {
    background: #060b10;
    border-radius: 8px;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    border: 1px solid var(--drishti-border);
}

.assistant-content code:not(pre code) {
    background: rgba(2, 132, 199, 0.12);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Input Area */
.input-box {
    background-color: var(--drishti-input-bg) !important;
    border: 1px solid var(--drishti-border) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 52px;
}

.input-box:focus-within {
    border-color: rgba(2, 132, 199, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
}

.btn-icon-attach {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.btn-icon-attach i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-send {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    background-color: var(--drishti-gold) !important;
    border: none;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.btn-send i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1.15rem;
    font-weight: 700;
}

.btn-send:hover:not(:disabled) {
    transform: scale(1.04);
}

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

.btn-ghost-hover {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-ghost-hover:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] .btn-ghost-hover:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Stop Generating Button positioned directly above input box */
#stop-generating-container {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-stop-generating {
    background-color: var(--drishti-card-bg) !important;
    border: 1px solid var(--drishti-border) !important;
    color: var(--bs-body-color) !important;
    font-size: 0.8rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease;
}

.btn-stop-generating:hover {
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #ef4444 !important;
    transform: translateY(-1px);
}

/* Statutory Reference Header & List in Chat Bubble */
.assistant-content h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--drishti-gold);
}

.assistant-content ul {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.assistant-content li {
    margin-bottom: 4px;
    font-size: 0.92rem;
}

/* Typing Indicator */
.typing-bubble {
    background: var(--drishti-user-bubble);
    border: 1px solid var(--drishti-border);
}

.typing-bubble .dot {
    width: 7px;
    height: 7px;
    background: var(--drishti-gold);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-bubble .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-bubble .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; }
}

/* Research Paper Style Inline Citation Pills (Muted, no bright highlights) */
.cite-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    line-height: 1;
    color: var(--bs-secondary-color, #94a3b8);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 4px;
    padding: 1px 4px;
    margin: 0 2px;
    vertical-align: 0.35em;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    box-shadow: none;
}

.cite-pill:hover {
    color: var(--bs-body-color, #e2e8f0);
    background: rgba(148, 163, 184, 0.24);
    border-color: rgba(148, 163, 184, 0.5);
    transform: translateY(-1px);
}

/* References Accordion & Cards (Clean, readable brightness, no yellow highlights) */
.references-accordion {
    transition: all 0.2s ease;
}

.references-accordion .btn-toggle-references {
    color: var(--bs-body-color) !important;
    opacity: 0.9;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.references-accordion .btn-toggle-references:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.05);
}

.ref-card {
    background-color: var(--drishti-card-bg) !important;
    border-color: var(--drishti-border) !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ref-card.ref-card-active {
    border-color: rgba(148, 163, 184, 0.6) !important;
    background-color: rgba(148, 163, 184, 0.15) !important;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4);
}

.ref-quote {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--bs-body-color) !important;
    background-color: var(--drishti-main-bg) !important;
}

/* Toast */
.vbgramg-toast {
    background: var(--drishti-card-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--drishti-border) !important;
}

/* Test Cards in Testing Modal */
.test-card {
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.test-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
