/* Base styles */
:root {
    --primary-color: #4a76a8;
    --primary-hover: #365e89;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #ddd;
    --sidebar-width: 280px;
    --header-height: 60px;
    --footer-height: 40px;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* Chat container */
.chatbot-container {
    display: flex;
    height: 100vh;
    background-color: white;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--light-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar .logo {
    padding: 20px;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .logo i {
    margin-right: 10px;
    color: var(--primary-color);
}

.new-chat-btn {
    margin: 15px;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.new-chat-btn i {
    margin-right: 8px;
}

.new-chat-btn:hover {
    background-color: var(--primary-hover);
}

.sidebar-nav {
    display: none !important;
}

.recent-chats {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.recent-chats h3 {
    font-size: 14px;
    color: #a0a0c0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-left: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-chats h3 i {
    font-size: 16px;
    color: #4a76a8;
}

.search-box {
    position: relative;
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-left: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
}

.search-box input::placeholder {
    color: #666;
}

.search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
}

.conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conversation-item {
    margin-bottom: 6px;
}

.conversation-link {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a0c0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.conversation-link:hover {
    background: rgba(74, 118, 168, 0.1);
    border-color: rgba(74, 118, 168, 0.2);
    color: #fff;
    transform: translateX(2px);
}

.conversation-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.conversation-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(74, 118, 168, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a76a8;
    font-size: 14px;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-timestamp {
    font-size: 11px;
    color: #666;
}

.no-conversations {
    padding: 20px;
    text-align: center;
    color: #666;
}

.no-conversations p {
    margin: 0 0 4px;
    font-size: 13px;
    color: #a0a0c0;
}

.no-conversations small {
    font-size: 11px;
    opacity: 0.7;
}

/* Main chat area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0; /* Prevent flex item from overflowing */
    position: relative;
}

.chat-header {
    flex: 0 0 var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    justify-content: space-between;
    background: white;
    z-index: 10;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    display: none;
}

.upgrade-section {
    display: flex;
    align-items: center;
}

.upgrade-section span {
    margin-right: 15px;
    font-size: 14px;
}

.upgrade-btn {
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Share button - Now in input-action-buttons area */
.share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(74, 74, 176, 0.1);
    border: 1px solid #4a4ab0;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #8282f5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: rgba(74, 74, 176, 0.2);
    color: #a5a5ff;
}

.share-btn i {
    font-size: 14px;
}

/* Mobile responsive adjustment for share button */
@media (max-width: 768px) {
    .share-btn span {
        display: none;
    }
    .share-btn {
        padding: 8px 10px;
        border-radius: 20px;
    }
}

/* Print Button Styles */
.print-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid #10b981;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #10b981;
    cursor: pointer;
    transition: all 0.2s ease;
}

.print-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.print-btn i {
    font-size: 14px;
}

/* Mobile responsive adjustment for print button */
@media (max-width: 768px) {
    .print-btn span {
        display: none;
    }
    .print-btn {
        padding: 8px 10px;
        border-radius: 20px;
    }
}

/* Response Style Toggle Button - Now in input-action-buttons area */
.response-style-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #a0a0c0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.response-style-btn:hover {
    background: #1f2937;
    border-color: #4a5568;
    color: #e2e8f0;
}

.response-style-btn i {
    font-size: 14px;
}

.response-style-btn[data-style="citation_first"] {
    background: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
    color: #38bdf8;
}

.response-style-btn[data-style="citation_first"]:hover {
    background: rgba(56, 189, 248, 0.2);
}

/* Verify Position Toggle Button - Now in input-action-buttons area */
.verify-position-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #a0a0c0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.verify-position-btn:hover {
    background: #1f2937;
    border-color: #4a5568;
    color: #e2e8f0;
}

.verify-position-btn i {
    font-size: 14px;
}

.verify-position-btn[data-enabled="true"],
.verify-position-btn.active {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

.verify-position-btn[data-enabled="true"]:hover,
.verify-position-btn.active:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* Mobile responsive adjustment for input action buttons */
@media (max-width: 768px) {
    .response-style-btn span,
    .verify-position-btn span {
        display: none;
    }
    .response-style-btn,
    .verify-position-btn {
        padding: 8px 10px;
        border-radius: 20px;
    }
}

/* Verification Warning Message */
.verification-warning-message {
    padding: 0 20px;
    margin-bottom: 16px;
}

.verification-warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
}

.verification-warning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b45309;
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 14px;
}

.verification-warning-header i {
    font-size: 16px;
    color: #f59e0b;
}

.verification-warning-content {
    font-size: 14px;
    line-height: 1.6;
    color: #92400e;
}

.verification-warning-content p {
    margin-bottom: 8px;
}

.verification-warning-content .official-position {
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
    font-style: italic;
    color: #78350f;
}

.verification-warning-content .verification-details {
    font-size: 13px;
    color: #a16207;
    margin-top: 8px;
}

/* Dark theme adjustments for verification warning */
@media (prefers-color-scheme: dark) {
    .verification-warning {
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
        border-color: #d97706;
    }
    
    .verification-warning-header {
        color: #fbbf24;
    }
    
    .verification-warning-content {
        color: #fcd34d;
    }
    
    .verification-warning-content .official-position {
        background: rgba(0, 0, 0, 0.2);
        color: #fef3c7;
    }
    
    .verification-warning-content .verification-details {
        color: #fde68a;
    }
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.conversation-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for Firefox */
    position: relative;
    overflow: hidden;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.welcome-message {
    text-align: center;
    margin: auto;
    max-width: 600px;
    padding: 30px;
}

.welcome-message .bot-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.welcome-message h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.welcome-message p {
    color: #666;
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
    max-width: 100%;
}

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

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

.ai-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.user-message .message-avatar {
    background-color: #5c5c5c;
    order: 2;
    margin-left: 10px;
}

.ai-message .message-avatar {
    margin-right: 10px;
}

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

.message-bubble {
    font-size: 16px !important;
    line-height: 1.7 !important;
    white-space: pre-wrap !important;
    max-width: 800px !important;
    margin: 0 auto !important;
}

.user-message .message-bubble {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message .message-bubble,
.assistant-message .message-bubble {
    background-color: #1f2937 !important;
    color: #e0e0e0 !important;
    padding: 24px 28px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Main topic introduction */
.ai-message .message-bubble > p:first-of-type,
.assistant-message .message-bubble > p:first-of-type {
    font-size: 17px !important;
    color: #e0e0e0 !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
}

/* Numbered sections */
.ai-message .message-bubble strong,
.assistant-message .message-bubble strong {
    display: block !important;
    font-size: 16px !important;
    color: #7c9fd4 !important;
    margin-top: 12px !important;
    margin-bottom: 4px !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid rgba(124, 159, 212, 0.3) !important;
}

/* Section content */
.ai-message .message-bubble p,
.assistant-message .message-bubble p {
    margin-bottom: 8px !important;
    padding-left: 8px !important;
    color: #d1d5db !important;
}

/* Fix code blocks that shouldn't be code (markdown parsing issue) */
.ai-message .message-bubble > code,
.assistant-message .message-bubble > code,
.ai-message .message-bubble > pre > code,
.assistant-message .message-bubble > pre > code {
    display: block !important;
    font-family: inherit !important;
    font-size: 17px !important;
    color: #e0e0e0 !important;
    background: transparent !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-x: visible !important;
    padding: 0 !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
}

.ai-message .message-bubble > pre,
.assistant-message .message-bubble > pre {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: visible !important;
}

/* Scripture references and citations */
.ai-message .message-bubble cite,
.assistant-message .message-bubble cite {
    display: inline-block !important;
    color: #9ca3af !important;
    font-size: 14px !important;
    font-style: normal !important;
    background: rgba(124, 159, 212, 0.15) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
}

/* Add subtle dividers between major sections */
.ai-message .message-bubble hr,
.assistant-message .message-bubble hr {
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    margin: 20px 0 !important;
}

/* Blockquote styling for Ellen White quotes - Dark theme */
.ai-message .message-bubble blockquote,
.assistant-message .message-bubble blockquote {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    border-left: 4px solid #6366f1 !important;
    margin: 10px 0 !important;
    padding: 16px 20px !important;
    border-radius: 0 8px 8px 0 !important;
    font-style: italic !important;
    color: #e2e8f0 !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.ai-message .message-bubble blockquote::before,
.assistant-message .message-bubble blockquote::before {
    content: '"' !important;
    font-size: 48px !important;
    color: rgba(99, 102, 241, 0.3) !important;
    position: absolute !important;
    top: -5px !important;
    left: 10px !important;
    font-family: Georgia, serif !important;
}

.ai-message .message-bubble blockquote p,
.assistant-message .message-bubble blockquote p {
    margin: 0 !important;
    padding-left: 20px !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    color: #e2e8f0 !important;
}

/* Reference links inside blockquotes */
.ai-message .message-bubble blockquote a.reference-link,
.assistant-message .message-bubble blockquote a.reference-link {
    color: #818cf8 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    font-style: normal !important;
    background: rgba(129, 140, 248, 0.2) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

.ai-message .message-bubble blockquote a.reference-link:hover,
.assistant-message .message-bubble blockquote a.reference-link:hover {
    background: rgba(129, 140, 248, 0.35) !important;
    text-decoration: underline !important;
}

/* Reference links (general - outside blockquotes) */
.ai-message .message-bubble a.reference-link,
.assistant-message .message-bubble a.reference-link {
    color: #818cf8 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    background: rgba(129, 140, 248, 0.2) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

.ai-message .message-bubble a.reference-link:hover,
.assistant-message .message-bubble a.reference-link:hover {
    background: rgba(129, 140, 248, 0.35) !important;
    text-decoration: underline !important;
}

/* General links in message bubbles (e.g., Full-Text Search links) */
.ai-message .message-bubble a:not(.reference-link):not(.cite-ref-btn):not(.verify-ref-btn),
.assistant-message .message-bubble a:not(.reference-link):not(.cite-ref-btn):not(.verify-ref-btn) {
    color: #60a5fa !important; /* Bright blue - highly visible on dark backgrounds */
    text-decoration: underline !important;
    font-weight: 500 !important;
}

.ai-message .message-bubble a:not(.reference-link):not(.cite-ref-btn):not(.verify-ref-btn):hover,
.assistant-message .message-bubble a:not(.reference-link):not(.cite-ref-btn):not(.verify-ref-btn):hover {
    color: #93c5fd !important; /* Lighter blue on hover */
    text-decoration: underline !important;
}

/* Quote list container */
.ai-message .message-bubble ul,
.assistant-message .message-bubble ul {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin: 10px 0 !important;
}

.ai-message .message-bubble li,
.assistant-message .message-bubble li {
    margin-bottom: 10px !important;
    color: #e0e0e0 !important;
    /* Style quote list items like blockquotes */
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    border-left: 4px solid #6366f1 !important;
    padding: 16px 20px !important;
    border-radius: 0 8px 8px 0 !important;
    font-style: italic !important;
    position: relative !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    list-style: none !important;
    margin-left: 0 !important;
}

/* Add decorative quote mark */
.ai-message .message-bubble li::before,
.assistant-message .message-bubble li::before {
    content: """ !important;
    font-family: Georgia, serif !important;
    font-size: 3em !important;
    color: rgba(99, 102, 241, 0.3) !important;
    position: absolute !important;
    left: 10px !important;
    top: 5px !important;
    line-height: 1 !important;
    font-style: normal !important;
}

/* Adjust padding to account for quote mark */
.ai-message .message-bubble li,
.assistant-message .message-bubble li {
    padding-left: 50px !important;
}

/* Style the reference links inside quote list items */
.ai-message .message-bubble li a.reference-link,
.assistant-message .message-bubble li a.reference-link {
    color: #a5b4fc !important;
    font-weight: 700 !important;
    font-style: normal !important;
    background: rgba(129, 140, 248, 0.25) !important;
    padding: 3px 10px !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
}


/* Unverified quote styling - minimal inline indicator */
.ai-message .message-bubble .unverified-quote,
.assistant-message .message-bubble .unverified-quote {
    display: inline !important;
}

/* Warning indicator for unverified quotes - small inline icon */
.ai-message .message-bubble .quote-warning-badge,
.assistant-message .message-bubble .quote-warning-badge {
    display: inline-flex !important;
    color: #f59e0b !important;
    font-size: 0 !important;
    margin-left: 4px !important;
    opacity: 0.8 !important;
    vertical-align: middle !important;
}

.ai-message .message-bubble .quote-warning-badge i,
.assistant-message .message-bubble .quote-warning-badge i {
    font-size: 14px !important;
}

/* Regenerating indicator - shown when style is changed */
.regenerating-indicator {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #818cf8 !important;
    font-style: italic !important;
    padding: 16px !important;
    background: rgba(99, 102, 241, 0.1) !important;
    border-radius: 8px !important;
    border-left: 3px solid #6366f1 !important;
}

.regenerating-indicator i {
    font-size: 16px !important;
}

/* Citation reference button - bookmark icon */
.cite-ref-btn {
    background: transparent !important;
    border: none !important;
    color: #818cf8 !important;
    cursor: pointer !important;
    padding: 2px 4px !important;
    margin-left: 2px !important;
    font-size: 12px !important;
    opacity: 0.7 !important;
    transition: all 0.2s ease !important;
    vertical-align: middle !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

.cite-ref-btn:hover {
    opacity: 1 !important;
    color: #a5b4fc !important;
    transform: scale(1.1) !important;
}

/* Verify reference button - check icon */
.verify-ref-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    padding: 2px 4px !important;
    margin-left: 2px !important;
    font-size: 12px !important;
    opacity: 0.7 !important;
    transition: all 0.2s ease !important;
    vertical-align: middle !important;
}

.verify-ref-btn:hover {
    opacity: 1 !important;
    color: #9ca3af !important;
    transform: scale(1.1) !important;
}

/* Verify button states */
.verify-ref-btn.verifying {
    color: #60a5fa !important;
    opacity: 1 !important;
    cursor: wait !important;
}

.verify-ref-btn.verified {
    color: #22c55e !important;
    opacity: 1 !important;
    cursor: default !important;
}

.verify-ref-btn.verified:hover {
    transform: none !important;
}

.verify-ref-btn.not-verified {
    color: #ef4444 !important;
    opacity: 1 !important;
    cursor: default !important;
}

.verify-ref-btn.not-verified:hover {
    transform: none !important;
}

.verify-ref-btn.verification-error {
    color: #f59e0b !important;
    opacity: 1 !important;
    cursor: pointer !important;
    padding: 6px 10px !important;
    background: rgba(245, 158, 11, 0.15) !important;
    border-radius: 4px !important;
    border-left: 3px solid #f59e0b !important;
}

/* Hide empty list items (from hallucination filtering) */
.ai-message .message-bubble li:empty,
.assistant-message .message-bubble li:empty {
    display: none !important;
}

/* Hide empty lists (ul/ol with no visible content) */
.ai-message .message-bubble ul:empty,
.assistant-message .message-bubble ul:empty,
.ai-message .message-bubble ol:empty,
.assistant-message .message-bubble ol:empty {
    display: none !important;
}

/* Also use :has() selector for lists with only empty children */
.ai-message .message-bubble ul:not(:has(li:not(:empty))),
.assistant-message .message-bubble ul:not(:has(li:not(:empty))),
.ai-message .message-bubble ol:not(:has(li:not(:empty))),
.assistant-message .message-bubble ol:not(:has(li:not(:empty))) {
    display: none !important;
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    margin-right: 4px;
    background-color: #666;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.3s infinite;
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Chat input area */
.chat-input-area {
    flex: 0 0 auto;
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    background: white;
    z-index: 10;
    position: relative;
    margin-bottom: 0;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 0;
}

.input-wrapper input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 8px 0;
    font-size: 16px;
    font-family: inherit;
}

.voice-btn, .send-btn {
    background: none;
    border: none;
    margin-left: 8px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.send-btn {
    background-color: var(--primary-color);
    color: white;
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.input-options {
    display: none !important;
}

/* Suggestion buttons container */
.suggestion-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.suggestion-buttons::-webkit-scrollbar {
    width: 4px;
}

.suggestion-buttons::-webkit-scrollbar-track {
    background: transparent;
}

.suggestion-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Category headers */
.suggestion-category {
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 600;
    color: #8892a0;
    margin-top: 15px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-category i {
    font-size: 16px;
}

/* Individual suggestion buttons */
.suggestion-buttons button {
    background: linear-gradient(135deg, rgba(74, 118, 168, 0.05) 0%, rgba(74, 118, 168, 0.1) 100%);
    border: 1px solid rgba(74, 118, 168, 0.15);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #a0a0c0;
    cursor: pointer;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
    height: 100%;
    min-height: 48px;
    width: 100%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.suggestion-buttons button:nth-child(4n+1) {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05) 0%, rgba(76, 175, 80, 0.1) 100%);
    border-color: rgba(76, 175, 80, 0.15);
}

.suggestion-buttons button:nth-child(4n+2) {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.05) 0%, rgba(33, 150, 243, 0.1) 100%);
    border-color: rgba(33, 150, 243, 0.15);
}

.suggestion-buttons button:nth-child(4n+3) {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.05) 0%, rgba(156, 39, 176, 0.1) 100%);
    border-color: rgba(156, 39, 176, 0.15);
}

.suggestion-buttons button:nth-child(4n+4) {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: rgba(255, 152, 0, 0.15);
}

.suggestion-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.suggestion-buttons button:nth-child(4n+1):hover {
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.suggestion-buttons button:nth-child(4n+2):hover {
    color: #2196F3;
    border-color: rgba(33, 150, 243, 0.3);
}

.suggestion-buttons button:nth-child(4n+3):hover {
    color: #9C27B0;
    border-color: rgba(156, 39, 176, 0.3);
}

.suggestion-buttons button:nth-child(4n+4):hover {
    color: #FF9800;
    border-color: rgba(255, 152, 0, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chatbot-container {
        height: 100%;
        height: -webkit-fill-available;
    }

    .messages-container {
        padding: 15px;
    }

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

    .input-wrapper {
        padding: 6px 12px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .upgrade-section span {
        display: none;
    }
    
    .input-options {
        display: none;
    }
    
    .suggestion-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 12px;
        max-height: 280px;
    }
    
    .suggestion-buttons button {
        padding: 8px 10px;
        min-height: 42px;
        font-size: 11px;
    }
    
    .suggestion-category {
        font-size: 14px;
        margin-top: 12px;
        margin-bottom: 6px;
    }

    .recent-chats {
        padding: 12px;
    }
    
    .search-box input {
        padding: 6px 10px;
        padding-left: 28px;
        font-size: 12px;
    }
    
    .conversation-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .conversation-title {
        font-size: 12px;
    }
    
    .conversation-timestamp {
        font-size: 10px;
    }
}

/* iOS height fix */
@supports (-webkit-touch-callout: none) {
    .chatbot-container {
        height: -webkit-fill-available;
    }
}

/* Share dialog styles */
.share-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.share-dialog.active {
    display: flex;
}

.share-dialog-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.share-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.share-dialog-header h3 {
    margin: 0;
    font-size: 18px;
}

.share-dialog-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

.share-dialog-form {
    margin-bottom: 20px;
}

.share-dialog-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.share-expiration {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
}

.share-url-container {
    display: flex;
    margin-top: 15px;
}

.share-url {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    background-color: #f8f9fa;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    padding: 10px 15px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.copy-btn:hover {
    background-color: #365e89;
}

.share-btn-container {
    text-align: center;
    margin-top: 20px;
}

.create-share-btn {
    padding: 10px 20px;
    background-color: #4a76a8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.create-share-btn:hover {
    background-color: #365e89;
}

.share-status {
    margin-top: 15px;
    text-align: center;
    color: #4CAF50;
    font-weight: 500;
    display: none;
}

/* Keep the new chat button visible */
.new-chat-btn {
    margin-bottom: 0;
}

/* Ensure logo stays visible */
.logo {
    margin-bottom: 20px;
}

.user-profile {
    display: none !important;
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide UI elements not needed for print */
    .sidebar,
    .chat-header,
    .chat-input-area,
    .source-panel,
    .share-dialog,
    .citation-modal,
    .sidebar-toggle,
    .new-chat-btn,
    .input-wrapper,
    .input-action-buttons,
    .input-options,
    .chat-footer,
    .permanent-disclaimer,
    .typing-indicator,
    .suggestion-buttons,
    .trending-topics-section,
    .welcome-message,
    .cite-ref-btn,
    .verify-ref-btn,
    .message-avatar {
        display: none !important;
    }
    
    /* Reset container styles for print */
    .chatbot-container {
        position: static !important;
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        background: white !important;
    }
    
    .chat-area {
        position: static !important;
        display: block !important;
        flex: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    .conversation-container {
        position: static !important;
        display: block !important;
        overflow: visible !important;
        height: auto !important;
    }
    
    .messages-container {
        position: static !important;
        display: block !important;
        overflow: visible !important;
        height: auto !important;
        padding: 0 !important;
    }
    
    /* Print header - shown only in print */
    .print-header {
        display: block !important;
        text-align: center;
        padding: 20px 0 30px;
        border-bottom: 2px solid #333;
        margin-bottom: 30px;
    }
    
    .print-header h1 {
        font-size: 24pt;
        color: #333;
        margin: 0 0 5px;
    }
    
    .print-header .print-subtitle {
        font-size: 12pt;
        color: #666;
        margin: 0 0 10px;
    }
    
    .print-header .print-date {
        font-size: 10pt;
        color: #888;
    }
    
    /* Message styling for print */
    .message {
        display: block !important;
        margin-bottom: 20px;
        page-break-inside: auto !important;
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .message-content {
        max-width: 100% !important;
        background: none !important;
        background-color: transparent !important;
        overflow: visible !important;
        border-radius: 0 !important;
        padding: 0 !important;
        color: #333 !important;
    }
    
    .message-bubble {
        background: white !important;
        color: #333 !important;
        padding: 10px 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        font-size: 11pt !important;
        line-height: 1.6 !important;
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
    }
    
    /* User message styling for print */
    .user-message {
        margin-left: 0 !important;
        align-self: stretch !important;
        flex-direction: row !important;
    }
    
    .user-message::before {
        content: "QUESTION:";
        font-weight: bold;
        color: #4a76a8;
        display: block;
        margin-bottom: 5px;
        font-size: 10pt;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .user-message .message-bubble {
        background: #f0f4f8 !important;
        color: #333 !important;
        padding: 15px !important;
        border-left: 4px solid #4a76a8 !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: none !important;
    }
    
    .user-message .message-content {
        background: none !important;
    }
    
    /* AI/Assistant message styling for print */
    .ai-message::before,
    .assistant-message::before {
        content: "Response: ";
        font-weight: bold;
        color: #2e7d32;
        display: block;
        margin-bottom: 5px;
        font-size: 10pt;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .ai-message .message-bubble,
    .assistant-message .message-bubble {
        background: white !important;
        color: #333 !important;
        border: none !important;
        border-left: 4px solid #2e7d32 !important;
        padding: 15px !important;
        box-shadow: none !important;
    }
    
    .ai-message .message-content,
    .assistant-message .message-content {
        background: none !important;
    }
    
    /* Blockquote styling for print - EGW quotes */
    .ai-message .message-bubble blockquote,
    .assistant-message .message-bubble blockquote {
        background: #f9f9f9 !important;
        border-left: 4px solid #6366f1 !important;
        margin: 15px 0 !important;
        padding: 15px 20px !important;
        font-style: italic !important;
        color: #333 !important;
        page-break-inside: avoid;
    }
    
    .ai-message .message-bubble blockquote::before,
    .assistant-message .message-bubble blockquote::before {
        content: none !important;
    }
    
    /* List items (quotes) styling for print */
    .ai-message .message-bubble li,
    .assistant-message .message-bubble li {
        background: #f9f9f9 !important;
        border-left: 4px solid #6366f1 !important;
        margin: 10px 0 !important;
        padding: 12px 15px 12px 20px !important;
        font-style: italic !important;
        color: #333 !important;
        list-style: none !important;
        page-break-inside: avoid;
    }
    
    .ai-message .message-bubble li::before,
    .assistant-message .message-bubble li::before {
        content: none !important;
    }
    
    /* Reference links for print */
    .reference-link {
        color: #333 !important;
        background: none !important;
        text-decoration: none !important;
        font-weight: bold !important;
        padding: 0 !important;
    }
    
    .reference-link::after {
        content: " [" attr(data-source) "]";
        font-weight: normal;
        font-style: normal;
        color: #666;
        font-size: 9pt;
    }
    
    /* Strong/bold text for print */
    .ai-message .message-bubble strong,
    .assistant-message .message-bubble strong {
        display: block !important;
        color: #333 !important;
        border-bottom: 1px solid #ddd !important;
        padding-bottom: 5px !important;
        margin-top: 15px !important;
        margin-bottom: 8px !important;
    }
    
    /* Unverified quote styling for print */
    .unverified-quote {
        opacity: 1 !important;
        border-left: 4px solid #f59e0b !important;
        background: #fffbeb !important;
        padding: 10px 15px !important;
    }
    
    .quote-warning-badge {
        display: block !important;
        color: #92400e !important;
        font-size: 9pt !important;
        margin-top: 8px !important;
        font-style: normal !important;
    }
    
    /* Verification warning for print */
    .verification-warning {
        background: #fffbeb !important;
        border: 1px solid #f59e0b !important;
        padding: 15px !important;
        margin: 15px 0 !important;
        page-break-inside: avoid;
    }
    
    .verification-warning-header {
        color: #92400e !important;
    }
    
    .verification-warning-content {
        color: #78350f !important;
    }
    
    /* Print footer */
    .print-footer {
        display: block !important;
        text-align: center;
        padding: 20px 0;
        border-top: 1px solid #ddd;
        margin-top: 30px;
        font-size: 9pt;
        color: #888;
    }
    
    /* Page break controls - allow long messages to flow across pages */
    .message {
        page-break-inside: auto !important;
    }
    
    .user-message {
        page-break-inside: avoid;
    }
    
    /* Ensure proper page margins */
    @page {
        margin: 1in;
        size: letter;
    }
    
    /* First page - no top margin for header */
    @page :first {
        margin-top: 0.5in;
    }
}

/* Follow-up question buttons (inline in V4 responses) */
.followup-question-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(99, 102, 241, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    margin: 6px 0;
    font-size: 0.85rem;
    color: #b0b8d0;
    cursor: pointer;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.followup-question-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.22) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #c8cee8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.followup-question-btn::before {
    content: '→ ';
    opacity: 0.5;
}

@media (max-width: 768px) {
    .followup-question-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

@media print {
    .followup-question-btn {
        display: none !important;
    }
}

/* Print header/footer - hidden by default, shown only in print */
.print-header,
.print-footer {
    display: none;
} 