/* ==========================================================================
   Minimal Tailwind Overrides - Only what's absolutely necessary
   ========================================================================== */

/* Override Tailwind font sizes for sermon filter labels */
#sermonList .sermon-item label,
#sermonList .sermon-item label.flex-1,
#sermonList .sermon-item label.cursor-pointer {
    font-size: 11px !important;
    line-height: 1.3 !important;
}

/* Ensure our theme variables work */
body {
    font-family: var(--font-family-primary, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background-color: var(--bg-primary, #ffffff);
    color: var(--text-primary, #333333);
}

/* Fix mobile sidebar behavior */
@media (max-width: 768px) {
    nav.w-64 {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    nav.w-64.mobile-sidebar-open {
        transform: translateX(0);
    }
}

/* Chat message specific styles */
#chatMessages .assistant-message {
    background-color: white;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
    max-width: 95%;
}

#chatMessages .user-message {
    background-color: #f3f4f6;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
    max-width: 95%;
    margin-left: auto;
}

/* Ensure proper scrolling */
#chatMessages {
    overflow-y: auto;
}

/* Ensure chat messages use maximum available width */
#chatMessages .message,
#chatMessages .message-content {
    width: 100%;
    max-width: 98% !important;
}

/* Constrain AI-generated images so they don't dominate the message */
#chatMessages img,
.tab-content img,
#chatMessages .message-text img {
    max-width: min(100%, 480px);
    max-height: 360px;
    height: auto;
    display: block;
    margin: 0.75rem 0;
    border-radius: 0.5rem;
    object-fit: contain;
}

/* Ensure quote verification sections maintain proper styling */
#chatMessages .quote-verification-section {
    max-width: 100% !important;
    margin: 1rem 0;
}

#chatMessages .quote-verified,
#chatMessages .quote-unverified {
    max-width: none !important;
    display: inline;
}

/* Input area styles */
#userInput {
    resize: none;
}

/* Theme transition */
body, nav, main, div {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Bible verse text cursor pointer */
.verse-text {
    cursor: pointer;
}

/* Search result row and preview cursor pointer */
.search-result-row {
    cursor: pointer;
}

.result-preview {
    cursor: pointer;
}

/* Fix help icon visibility in dark mode */
[data-theme="dark"] #studyInfoToggle,
[data-theme="dark"] button#studyInfoToggle {
    color: #d1d5db !important;
    background-color: transparent !important;
}

[data-theme="dark"] #studyInfoToggle svg,
[data-theme="dark"] button#studyInfoToggle svg {
    stroke: #d1d5db !important;
}

[data-theme="dark"] #studyInfoToggle:hover,
[data-theme="dark"] button#studyInfoToggle:hover {
    color: #f3f4f6 !important;
    background-color: #374151 !important;
}

[data-theme="dark"] #studyInfoToggle:hover svg,
[data-theme="dark"] button#studyInfoToggle:hover svg {
    stroke: #f3f4f6 !important;
}

/* Fix Search page icon visibility in dark mode */
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] i.text-gray-400 {
    color: #9ca3af !important;
}

[data-theme="dark"] .text-gray-500,
[data-theme="dark"] i.text-gray-500 {
    color: #9ca3af !important;
}

[data-theme="dark"] #searchButton,
[data-theme="dark"] #searchHelpButton {
    background-color: transparent !important;
}

[data-theme="dark"] #searchButton:hover,
[data-theme="dark"] #searchHelpButton:hover {
    background-color: #374151 !important;
}

[data-theme="dark"] .result-action-btn {
    color: #9ca3af !important;
}

[data-theme="dark"] .result-action-btn:hover {
    color: #d1d5db !important;
}
