/* Professional Dark Theme - Bootstrap Variable Overrides */
:root {
    /* Core Bootstrap Color System */
    --bs-primary: #007bff;
    --bs-primary-rgb: 0, 123, 255;
    --bs-primary-text-emphasis: #002952;
    --bs-primary-bg-subtle: rgba(0, 123, 255, 0.1);
    --bs-primary-border-subtle: rgba(0, 123, 255, 0.2);
    
    --bs-secondary: #6c757d;
    --bs-secondary-rgb: 108, 117, 125;
    --bs-secondary-text-emphasis: #2d3034;
    --bs-secondary-bg-subtle: rgba(108, 117, 125, 0.1);
    --bs-secondary-border-subtle: rgba(108, 117, 125, 0.2);
    
    --bs-success: #28a745;
    --bs-success-rgb: 40, 167, 69;
    --bs-success-text-emphasis: #0f3419;
    --bs-success-bg-subtle: rgba(40, 167, 69, 0.1);
    --bs-success-border-subtle: rgba(40, 167, 69, 0.2);
    
    --bs-info: #17a2b8;
    --bs-info-rgb: 23, 162, 184;
    --bs-info-text-emphasis: #083c46;
    --bs-info-bg-subtle: rgba(23, 162, 184, 0.1);
    --bs-info-border-subtle: rgba(23, 162, 184, 0.2);
    
    --bs-warning: #ffc107;
    --bs-warning-rgb: 255, 193, 7;
    --bs-warning-text-emphasis: #664d03;
    --bs-warning-bg-subtle: rgba(255, 193, 7, 0.1);
    --bs-warning-border-subtle: rgba(255, 193, 7, 0.2);
    
    --bs-danger: #dc3545;
    --bs-danger-rgb: 220, 53, 69;
    --bs-danger-text-emphasis: #58151c;
    --bs-danger-bg-subtle: rgba(220, 53, 69, 0.1);
    --bs-danger-border-subtle: rgba(220, 53, 69, 0.2);
    
    --bs-light: #f8f9fa;
    --bs-light-rgb: 248, 249, 250;
    --bs-light-text-emphasis: #495057;
    --bs-light-bg-subtle: rgba(248, 249, 250, 0.1);
    --bs-light-border-subtle: rgba(248, 249, 250, 0.2);
    
    --bs-dark: #1a1a1a;
    --bs-dark-rgb: 26, 26, 26;
    --bs-dark-text-emphasis: #e9ecef;
    --bs-dark-bg-subtle: rgba(26, 26, 26, 0.8);
    --bs-dark-border-subtle: rgba(26, 26, 26, 0.6);

    /* Body and Text Colors */
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
    --bs-body-color-rgb: 224, 224, 224;
    --bs-emphasis-color: #ffffff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: #adb5bd;
    --bs-secondary-color-rgb: 173, 181, 189;
    --bs-tertiary-color: #6c757d;
    --bs-tertiary-color-rgb: 108, 117, 125;
    --bs-text-muted: #6c757d;

    /* Link Colors */
    --bs-link-color: #17a2b8;
    --bs-link-hover-color: #007bff;
    --bs-link-color-rgb: 23, 162, 184;
    --bs-link-hover-color-rgb: 0, 123, 255;
    --bs-link-decoration: none;

    /* Component Background Colors */
    --bs-primary-bg: rgba(0, 123, 255, 0.1);
    --bs-secondary-bg: rgba(108, 117, 125, 0.1);
    --bs-success-bg: rgba(40, 167, 69, 0.1);
    --bs-info-bg: rgba(23, 162, 184, 0.1);
    --bs-warning-bg: rgba(255, 193, 7, 0.1);
    --bs-danger-bg: rgba(220, 53, 69, 0.1);
    --bs-light-bg: rgba(248, 249, 250, 0.1);
    --bs-dark-bg: rgba(26, 26, 26, 0.8);

    /* Border Colors */
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
    --bs-border-width: 1px;
    --bs-border-radius: 6px;
    --bs-border-radius-sm: 4px;
    --bs-border-radius-lg: 8px;
    --bs-border-radius-xl: 12px;
    --bs-border-radius-xxl: 16px;

    /* Component Variables */
    --bs-tertiary-bg: rgba(255, 255, 255, 0.05);
    --bs-quaternary-bg: rgba(0, 0, 0, 0.3);
    --bs-focus-ring-color: rgba(0, 123, 255, 0.25);
    --bs-focus-ring-width: 0.2rem;
    --bs-focus-ring-opacity: 0.25;

    /* Form Control Variables */
    --bs-form-control-bg: rgba(255, 255, 255, 0.05);
    --bs-form-control-border-color: rgba(255, 255, 255, 0.15);
    --bs-form-control-focus-border-color: #007bff;
    --bs-form-control-focus-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    --bs-form-control-color: #e0e0e0;

    /* Button Variables */
    --bs-btn-border-radius: 6px;
    --bs-btn-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --bs-btn-focus-box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);

    /* Card Variables */
    --bs-card-bg: rgba(255, 255, 255, 0.05);
    --bs-card-border-color: rgba(255, 255, 255, 0.1);
    --bs-card-border-radius: 8px;
    --bs-card-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Modal Variables */
    --bs-modal-bg: rgba(26, 26, 26, 0.95);
    --bs-modal-border-color: rgba(255, 255, 255, 0.15);
    --bs-modal-border-radius: 12px;

    /* Transition Variables */
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Global Professional Body Styling */
body {
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-weight: 400;
}

/* Enhanced scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-dark);
    border-radius: var(--bs-border-radius);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-primary);
    border-radius: var(--bs-border-radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-link-hover-color);
}

::-webkit-scrollbar-corner {
    background: var(--bs-dark);
}

/* Enhanced selection styling */
::selection {
    background: rgba(0, 123, 255, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(0, 123, 255, 0.3);
    color: #ffffff;
}

/* Focus states */
*:focus {
    outline: none;
    box-shadow: var(--bs-focus-ring-color) 0px 0px 0px var(--bs-focus-ring-width);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Watermark using banner.png */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-image: url('/static/banner.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
}

.container-fluid {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.row {
    flex: 1;
    overflow: hidden;
}

.chat-sidebar {
    border-right: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
    height: 100%;
    overflow-y: auto;
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.message-input {
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
    padding: 15px;
    position: relative;
    bottom: 0;
    width: 100%;
}

.chat-item {
    cursor: pointer;
    transition: background-color 0.2s;
    opacity: 0.8;
}
.chat-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    opacity: 1;
}
.chat-item.active {
    background-color: rgba(var(--bs-primary-rgb), 0.15);
    opacity: 1;
}
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    max-width: 80%;
    word-wrap: break-word;
}
.message.user {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    margin-left: auto;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}
.message.system {
    background: rgba(var(--bs-secondary-rgb), 0.05);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.15);
    position: relative;
}
.message.system::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bs-secondary);
    border-radius: 0 2px 2px 0;
}
.title-edit-form {
    display: none;
}
.archived-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}
.archived-divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
}
.archived-divider span {
    background-color: var(--bs-body-bg);
    padding: 0 15px;
    position: relative;
    color: var(--bs-secondary);
}
.message-content img, .message-content video {
    max-width: 100%;
}
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bs-secondary);
}
.chat-date {
    font-size: 0.8em;
    color: var(--bs-secondary);
}
.btn-icon {
    padding: 0.25rem 0.5rem;
}
.chat-tabs {
    margin-bottom: 15px;
}

/* Enhanced References Styling */
.message-references {
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.15);
    padding-top: 12px;
    margin-top: 12px;
}

.references-toggle {
    background: rgba(var(--bs-info-rgb), 0.08);
    border: 1px solid rgba(var(--bs-info-rgb), 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.references-toggle:hover {
    background: rgba(var(--bs-info-rgb), 0.12);
    border-color: rgba(var(--bs-info-rgb), 0.2);
}

.references-toggle .toggle-icon {
    transition: transform 0.2s ease;
}

.references-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.references-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.references-content.expanded {
    max-height: 100%;
    transition: max-height 0.3s ease-in;
}

.reference-bubble {
    background: rgba(var(--bs-info-rgb), 0.05);
    border: 1px solid rgba(var(--bs-info-rgb), 0.15);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
    position: relative;
}

.reference-bubble:hover {
    border-color: rgba(var(--bs-info-rgb), 0.25);
}

.reference-bubble::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bs-info);
}

.reference-title {
    font-weight: 600;
    color: var(--bs-info);
    margin-bottom: 6px;
    font-size: 0.95em;
}

.reference-source {
    margin-bottom: 4px;
}

.reference-source a {
    color: var(--bs-link-color);
    text-decoration: none;
    font-size: 0.85em;
    word-break: break-all;
}

.reference-source a:hover {
    text-decoration: underline;
    color: var(--bs-link-hover-color);
}

.reference-thoughts {
    font-style: italic;
    color: var(--bs-text-muted);
    font-size: 0.9em;
    margin-top: 6px;
}

.references-header {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--bs-info);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.references-header::before {
    content: "📚";
    font-size: 1em;
}

.reference-count {
    background: rgba(var(--bs-info-rgb), 0.15);
    color: var(--bs-info);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 500;
}

.message-rating {
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.1);
    padding-top: 8px;
}

.message-rating .stars {
    display: inline-flex;
    gap: 5px;
}

.star-rating {
    cursor: pointer;
    font-size: 1.2em;
    transition: transform 0.1s ease, color 0.1s ease;
}

.star-rating:hover {
    transform: scale(1.2);
}

.text-warning-hover {
    color: #ffc107 !important;
}

/* Simplified Chain of Thought Styling */
.chain-of-thought {
    font-size: 0.9rem;
    border-radius: 6px;
    margin-top: 8px;
    background: rgba(var(--bs-primary-rgb), 0.05);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
    transition: border-color 0.3s ease;
}

.cot-toggle {
    background: rgba(var(--bs-primary-rgb), 0.08);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.cot-toggle:hover {
    background: rgba(var(--bs-primary-rgb), 0.12);
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

.cot-toggle .toggle-icon {
    transition: transform 0.2s ease;
}

.cot-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.cot-content-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(var(--bs-primary-rgb), 0.05);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.15);
    border-top: none;
    border-radius: 0 0 6px 6px;
    position: relative;
}

.cot-content-wrapper.expanded {
    max-height: 400px;
    transition: max-height 0.3s ease-in;
}

.cot-content-wrapper::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--bs-primary);
}

.cot-content-wrapper .cot-content {
    padding: 12px;
    padding-left: 18px;
}

.chain-of-thought .small {
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 4px;
    color: var(--bs-primary);
}

.cot-content {
    font-style: italic;
    color: var(--bs-body-color);
    opacity: 0.9;
}

.cot-step {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 4px;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

/* Simple continuous animations */
.cot-step {
    animation: thoughtPulse 2s ease-in-out infinite;
}

/* Simple staggered delays */
.cot-step:nth-child(odd) { animation-delay: 0s; }
.cot-step:nth-child(even) { animation-delay: 0.5s; }

/* Simple hover effect */
.cot-step:hover {
    background: rgba(var(--bs-primary-rgb), 0.15);
}

/* Last child gets a simple faster animation */
.cot-step:last-child {
    animation: thoughtFast 1s ease-in-out infinite;
}

.cot-arrow {
    color: var(--bs-primary);
    margin: 0 4px;
    font-weight: bold;
}

.message-header {
    cursor: pointer;
}

/* Enhanced System Message Status Styling */
.system-message-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.system-message-status.status-new {
    background: rgba(var(--bs-info-rgb), 0.2);
    color: var(--bs-info);
    border: 1px solid rgba(var(--bs-info-rgb), 0.3);
}

.system-message-status.status-queued {
    background: rgba(var(--bs-warning-rgb), 0.2);
    color: var(--bs-warning);
    border: 1px solid rgba(var(--bs-warning-rgb), 0.3);
}

.system-message-status.status-researching {
    background: rgba(var(--bs-primary-rgb), 0.2);
    color: var(--bs-primary);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.3);
}

.system-message-status.status-refining {
    background: rgba(var(--bs-info-rgb), 0.2);
    color: var(--bs-info);
    border: 1px solid rgba(var(--bs-info-rgb), 0.3);
}

.system-message-status.status-done {
    background: rgba(var(--bs-success-rgb), 0.2);
    color: var(--bs-success);
    border: 1px solid rgba(var(--bs-success-rgb), 0.3);
}

.system-message-status i {
    font-size: 0.9em;
}

.system-message-status.status-queued i,
.system-message-status.status-researching i,
.system-message-status.status-refining i {
    animation: pulse 1.5s ease-in-out infinite alternate;
}

/* Enhanced Message Content Styling */
.message-content {
    word-wrap: break-word;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--bs-body-color);
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child,
.message-content h5:first-child,
.message-content h6:first-child {
    margin-top: 0;
}

.message-content pre {
    background: rgba(var(--bs-dark-rgb), 0.1);
    border: 1px solid rgba(var(--bs-secondary-rgb), 0.2);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    font-size: 0.9em;
}

.message-content code {
    background: rgba(var(--bs-secondary-rgb), 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.message-content pre code {
    background: none;
    padding: 0;
}

.message-content blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 12px;
    margin: 12px 0;
    font-style: italic;
    color: var(--bs-text-muted);
}

.message-content ul,
.message-content ol {
    padding-left: 20px;
    margin-bottom: 1rem;
}

.message-content li {
    margin-bottom: 4px;
}

/* Animation for new messages */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: slideIn 0.3s ease-out;
}

/* Enhanced status indicators */
.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Improved rating section */
.message-rating {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--bs-secondary-rgb), 0.15);
}

.message-rating .stars {
    display: inline-flex;
    gap: 6px;
    margin-top: 4px;
}

/* Hover effects for better interactivity */
.reference-bubble:hover .reference-source a {
    color: var(--bs-info);
}

.system-message-status:hover {
    transform: scale(1.05);
}

/* Simple animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Simple pulse animation */
@keyframes thoughtPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Faster pulse for last child */
@keyframes thoughtFast {
    0%, 100% {
        opacity: 0.6;
        scale: 1.01;
    }
    50% {
        opacity: 1;
        scale: 1;
    }
}

.message {
    animation: fadeIn 0.3s ease-out;
}

.system-message-status.status-queued i,
.system-message-status.status-researching i,
.system-message-status.status-refining i {
    animation: pulse 1.5s ease-in-out infinite alternate;
}

/* Hover effects */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

/* Loading spinner */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 123, 255, 0.1);
    border-top: 2px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Professional Bootstrap Component Overrides */

/* Button Styling */
.btn {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-btn-border-radius);
    color: var(--bs-body-color);
    font-family: inherit;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all var(--transition-medium);
    box-shadow: var(--bs-btn-box-shadow);
}

.btn:hover {
    border-color: var(--bs-primary);
    color: var(--bs-emphasis-color);
    transform: translateY(-1px);
}

.btn:focus {
    box-shadow: var(--bs-btn-focus-box-shadow);
    border-color: var(--bs-primary);
}

.btn-primary {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--bs-link-hover-color);
    border-color: var(--bs-link-hover-color);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.btn-outline-primary:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* Form Controls */
.form-control {
    background: var(--bs-form-control-bg);
    border: 1px solid var(--bs-form-control-border-color);
    border-radius: var(--bs-border-radius);
    color: var(--bs-form-control-color);
    padding: 0.75rem 1rem;
    transition: all var(--transition-medium);
}

.form-control:focus {
    background: var(--bs-form-control-bg);
    border-color: var(--bs-form-control-focus-border-color);
    box-shadow: var(--bs-form-control-focus-box-shadow);
    color: var(--bs-emphasis-color);
}

.form-control::placeholder {
    color: var(--bs-tertiary-color);
    opacity: 0.7;
}

/* Card Components */
.card {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-card-border-color);
    border-radius: var(--bs-card-border-radius);
    box-shadow: var(--bs-card-box-shadow);
    backdrop-filter: blur(10px);
    transition: all var(--transition-medium);
}

.card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
}

.card-header {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-bottom: 1px solid var(--bs-card-border-color);
    color: var(--bs-primary);
    font-weight: 600;
}

/* Modal Components */
.modal-content {
    background: var(--bs-modal-bg);
    border: 1px solid var(--bs-modal-border-color);
    border-radius: var(--bs-modal-border-radius);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid var(--bs-modal-border-color);
    background: rgba(var(--bs-primary-rgb), 0.1);
}

.modal-title {
    color: var(--bs-primary);
    font-weight: 600;
}

.modal-footer {
    border-top: 1px solid var(--bs-modal-border-color);
    background: rgba(0, 0, 0, 0.1);
}

/* Navigation */
.navbar {
    background: var(--bs-dark-bg) !important;
    border-bottom: 1px solid var(--bs-border-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    color: var(--bs-primary) !important;
    font-weight: 700;
}

.nav-link {
    color: var(--bs-body-color) !important;
    transition: color var(--transition-medium);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--bs-primary) !important;
}

.nav-link.active {
    color: var(--bs-primary) !important;
}

/* Alerts */
.alert {
    border: 1px solid;
    border-radius: var(--bs-border-radius-lg);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.alert-primary {
    background: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
    color: var(--bs-primary);
}

.alert-success {
    background: var(--bs-success-bg-subtle);
    border-color: var(--bs-success-border-subtle);
    color: var(--bs-success);
}

.alert-danger {
    background: var(--bs-danger-bg-subtle);
    border-color: var(--bs-danger-border-subtle);
    color: var(--bs-danger);
}

.alert-warning {
    background: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
    color: var(--bs-warning);
}

.alert-info {
    background: var(--bs-info-bg-subtle);
    border-color: var(--bs-info-border-subtle);
    color: var(--bs-info);
}

/* Tables */
.table {
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

.table-dark {
    background: var(--bs-dark-bg);
    border-color: var(--bs-border-color);
}

.table-dark th,
.table-dark td {
    border-color: var(--bs-border-color);
}

.table-dark thead th {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    font-weight: 600;
}

/* Dropdowns */
.dropdown-menu {
    background: var(--bs-dark-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    backdrop-filter: blur(20px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    color: var(--bs-body-color);
    transition: background-color var(--transition-fast);
    padding: 0.75rem 1rem;
}

.dropdown-item:hover {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.dropdown-item.active {
    background: var(--bs-primary);
    color: white;
}

/* Professional Typography and Text Styling */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--bs-emphasis-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    color: var(--bs-primary);
}

h2 {
    color: var(--bs-primary);
}

h3 {
    color: var(--bs-info);
}

/* Links */
a {
    color: var(--bs-link-color);
    text-decoration: var(--bs-link-decoration);
    transition: color var(--transition-medium);
}

a:hover {
    color: var(--bs-link-hover-color);
    text-decoration: underline;
}

/* Code styling */
code {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--bs-border-radius-sm);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    border: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}

pre {
    background: var(--bs-dark-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    padding: 1rem;
    overflow-x: auto;
    backdrop-filter: blur(10px);
}

pre code {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.05);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: var(--bs-border-radius);
    color: var(--bs-body-color);
    font-style: italic;
    backdrop-filter: blur(10px);
}

/* Utility classes */
.text-primary {
    color: var(--bs-primary) !important;
}

.text-muted {
    color: var(--bs-text-muted) !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .message {
        max-width: 95%;
        padding: 8px 12px;
    }
    
    .reference-bubble {
        padding: 8px;
    }
    
    .system-message-status {
        font-size: 0.7em;
        padding: 2px 6px;
    }
    
    .references-header {
        font-size: 0.8em;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


