/**
 * Gill Commentary Styles
 *
 * Styles for displaying John Gill's Exposition of the Bible
 * in the Bible lookup modal.
 *
 * @package PristineGrace
 * @since 4.4
 */

/* ==========================================================================
   GILL COMMENTARY CONTAINER
   ========================================================================== */

.gill-commentary-section {
    margin-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.gill-commentary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.gill-commentary-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gill-commentary-title i {
    color: #6c757d;
}

button.gill-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #395ba9;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #395ba9;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
}

button.gill-toggle-btn:hover {
    background: #395ba9;
    color: white;
}

button.gill-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(57, 91, 169, 0.25);
}

button.gill-toggle-btn.active {
    background: #395ba9;
    color: white;
}

button.gill-toggle-btn.active:hover {
    background: #2e4a8a;
    border-color: #2e4a8a;
}

button.gill-toggle-btn i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

button.gill-toggle-btn.active i {
    transform: rotate(180deg);
}

#gillCommentaryContent,
.gill-commentary-content {
    display: none !important;
    padding: 1rem;
    background: #fdfcfa;
    border: 1px solid #e9e5df;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    margin-top: 0.75rem;
}

#gillCommentaryContent.show,
.gill-commentary-content.show {
    display: block !important;
}

/* Loading state */
.gill-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.gill-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
}

/* Error state */
.gill-error {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 0.9rem;
}

/* Info state (no commentary available) */
.gill-info {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #6c757d;
    font-size: 0.9rem;
    font-style: italic;
}

/* ==========================================================================
   MULTI-VERSE COMMENTARY DISPLAY
   ========================================================================== */

.gill-verse-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    background: #f1f3f4;
    padding: 0.4rem 0.75rem;
    margin: 1rem -1rem 0.75rem -1rem;
    border-top: 1px solid #e9e5df;
    border-bottom: 1px solid #e9e5df;
}

.gill-verse-header:first-child {
    margin-top: 0;
    border-top: none;
}

.gill-verse-content {
    margin-bottom: 1rem;
}

.gill-verse-content:last-child {
    margin-bottom: 0;
}

.gill-verse-content.gill-no-content {
    color: #6c757d;
    font-style: italic;
    padding: 0.5rem 0;
}

.gill-chapter-divider {
    margin: 1.5rem 0;
    border-top: 2px solid #dee2e6;
}

/* ==========================================================================
   COMMENTARY TEXT ELEMENTS
   ========================================================================== */

/* Paragraphs */
.gill-para {
    margin-bottom: 1em;
    text-align: justify;
}

.gill-para:first-child {
    margin-top: 0;
}

.gill-para:last-child {
    margin-bottom: 0;
}

/* Scripture quotations - styled distinctly */
.gill-scripture {
    color: #1a4a7a;
    font-weight: 500;
}

/* Hebrew text */
.gill-hebrew {
    font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
    direction: rtl;
    unicode-bidi: isolate;
    font-size: 1.1em;
    color: #5c4033;
    background: #f9f7f4;
    padding: 0 0.25em;
    border-radius: 2px;
}

/* Show transliteration after Hebrew */
.gill-hebrew::after {
    content: " (" attr(data-translit) ")";
    direction: ltr;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 0.85em;
    color: #777;
}

/* Greek text */
.gill-greek {
    font-family: "SBL Greek", "Gentium Plus", "Times New Roman", serif;
    font-style: italic;
    color: #5c4033;
    background: #f9f7f4;
    padding: 0 0.25em;
    border-radius: 2px;
}

/* Show transliteration after Greek */
.gill-greek::after {
    content: " (" attr(data-translit) ")";
    font-style: normal;
    font-size: 0.85em;
    color: #777;
}

/* Bible reference links */
.gill-ref {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px dotted #0066cc;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gill-ref:hover {
    color: #004499;
    border-bottom-style: solid;
}

/* Cross-reference links (See commentary on...) */
.gill-crossref {
    color: #6c757d;
    text-decoration: none;
    font-style: italic;
    font-size: 0.9em;
    cursor: pointer;
    transition: color 0.15s ease;
}

.gill-crossref:hover {
    color: #495057;
    text-decoration: underline;
}

/* Footnote markers */
.gill-footnote {
    font-size: 0.8em;
    vertical-align: super;
    color: #6c757d;
    font-weight: 500;
}

/* Block quotes (Targum, etc.) */
.gill-quote {
    margin: 1em 1.5em;
    padding: 0.75em 1em;
    border-left: 3px solid #c9a959;
    background: #fdfbf5;
    font-style: italic;
    color: #555;
}

.gill-quote::before {
    content: none;
}

/* ==========================================================================
   CROSS-REFERENCE INDICATOR
   ========================================================================== */

.gill-crossref-notice {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    background: #f0f7ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.gill-crossref-notice i {
    color: #0066cc;
    margin-right: 0.5rem;
    margin-top: 0.15rem;
}

.gill-crossref-notice .gill-crossref-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
}

.gill-crossref-notice .gill-crossref-link:hover {
    color: #004499;
}

/* ==========================================================================
   SEARCH RESULTS
   ========================================================================== */

.gill-search-results {
    margin-top: 1rem;
}

.gill-search-result {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.15s ease;
}

.gill-search-result:hover {
    background: #f8f9fa;
}

.gill-search-result:last-child {
    border-bottom: none;
}

.gill-search-result-ref {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.gill-search-result-snippet {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
}

.gill-search-result-snippet mark {
    background: #fff3cd;
    padding: 0 0.15em;
    border-radius: 2px;
}

/* ==========================================================================
   SEARCH TAB ADDITION
   ========================================================================== */

.gill-search-tab {
    display: none;
    padding: 1rem;
}

.gill-search-tab.active {
    display: block;
}

.gill-search-input-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.gill-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.95rem;
}

.gill-search-input:focus {
    border-color: #80bdff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {
    .gill-commentary-content {
        max-height: 300px;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .gill-quote {
        margin: 0.75em 0.5em;
        padding: 0.5em 0.75em;
    }

    .gill-hebrew::after,
    .gill-greek::after {
        display: block;
        margin-top: 0.25em;
    }
}

/* Mobile-only inline header inside commentary content */
.gill-mobile-header {
    display: none;
}

@media (max-width: 576px) {
    /* On mobile, commentary auto-shows — no toggle needed */
    .gill-commentary-section {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
        border-top: 1px solid #dee2e6;
    }

    /* Hide header entirely — commentary loads automatically */
    .gill-commentary-header {
        display: none;
    }

    .gill-commentary-content {
        max-height: none;
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    /* Small inline header visible on mobile */
    .gill-mobile-header {
        display: block;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        font-size: 0.7rem;
        font-weight: 600;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        margin-bottom: 0.5rem;
        padding-bottom: 0.35rem;
        border-bottom: 1px solid #eee;
    }

    .gill-mobile-header i {
        margin-right: 0.3em;
        font-size: 0.65rem;
    }

    [data-theme="dark"] .gill-mobile-header {
        color: #8a9ab0;
        border-bottom-color: #3d4450;
    }

    /* Search bar still needs to be visible */
    .gill-search-bar {
        margin-bottom: 0.5rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .gill-commentary-content {
        max-height: none;
        overflow: visible;
        border: none;
        background: white;
    }

    .gill-toggle-btn {
        display: none;
    }

    .gill-ref,
    .gill-crossref {
        color: inherit;
        border: none;
        text-decoration: none;
    }

    .gill-hebrew::after,
    .gill-greek::after {
        color: #666;
    }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] .gill-commentary-section {
    border-top-color: #3d4450;
}

[data-theme="dark"] .gill-commentary-title {
    color: #c8ccd0;
}

[data-theme="dark"] .gill-commentary-title i {
    color: #8a9199;
}

[data-theme="dark"] button.gill-toggle-btn {
    background: #252530;
    border-color: #7fa8e8;
    color: #7fa8e8;
}

[data-theme="dark"] button.gill-toggle-btn:hover {
    background: #2a4080;
    border-color: #2a4080;
    color: white;
}

[data-theme="dark"] button.gill-toggle-btn.active {
    background: #2a4080;
    border-color: #2a4080;
    color: white;
}

[data-theme="dark"] button.gill-toggle-btn.active:hover {
    background: #335099;
    border-color: #335099;
}

[data-theme="dark"] #gillCommentaryContent,
[data-theme="dark"] .gill-commentary-content {
    background: #1e2328;
    border-color: #3d4450;
    color: #c8ccd0;
}

[data-theme="dark"] .gill-loading {
    color: #8a9199;
}

[data-theme="dark"] .gill-error {
    background: #3b2020;
    border-color: #5c3333;
    color: #f5a5a5;
}

[data-theme="dark"] .gill-info {
    background: #252a30;
    border-color: #3d4450;
    color: #8a9199;
}

/* Commentary text elements - dark mode */
[data-theme="dark"] .gill-scripture {
    color: #6db3f2;
}

[data-theme="dark"] .gill-hebrew {
    color: #d4a574;
    background: #2a2520;
}

[data-theme="dark"] .gill-hebrew::after {
    color: #8a9199;
}

[data-theme="dark"] .gill-greek {
    color: #d4a574;
    background: #2a2520;
}

[data-theme="dark"] .gill-greek::after {
    color: #8a9199;
}

[data-theme="dark"] .gill-ref {
    color: #6db3f2;
    border-bottom-color: #6db3f2;
}

[data-theme="dark"] .gill-ref:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

[data-theme="dark"] .gill-crossref {
    color: #8a9199;
}

[data-theme="dark"] .gill-crossref:hover {
    color: #c8ccd0;
}

[data-theme="dark"] .gill-footnote {
    color: #8a9199;
}

[data-theme="dark"] .gill-quote {
    background: #252218;
    border-left-color: #b8942e;
    color: #b0b5bb;
}

[data-theme="dark"] .gill-crossref-notice {
    background: #1a2533;
    border-color: #2d4a6d;
}

[data-theme="dark"] .gill-crossref-notice i {
    color: #6db3f2;
}

[data-theme="dark"] .gill-crossref-notice .gill-crossref-link {
    color: #6db3f2;
}

[data-theme="dark"] .gill-crossref-notice .gill-crossref-link:hover {
    color: #93c5fd;
}

/* Search results - dark mode */
[data-theme="dark"] .gill-search-result {
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .gill-search-result:hover {
    background: #252a30;
}

[data-theme="dark"] .gill-search-result-ref {
    color: #c8ccd0;
}

[data-theme="dark"] .gill-search-result-snippet {
    color: #8a9199;
}

[data-theme="dark"] .gill-search-result-snippet mark {
    background: #5c4d1a;
    color: #f5e6a3;
}

[data-theme="dark"] .gill-search-input {
    background: #1e2328;
    border-color: #3d4450;
    color: #c8ccd0;
}

[data-theme="dark"] .gill-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Multi-verse display - dark mode */
[data-theme="dark"] .gill-verse-header {
    color: #c8ccd0;
    background: #252a30;
    border-top-color: #3d4450;
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .gill-verse-content.gill-no-content {
    color: #8a9199;
}

[data-theme="dark"] .gill-chapter-divider {
    border-top-color: #4b5563;
}

/* ==========================================================================
   GILL COMMENTARY IN-CONTENT SEARCH
   ========================================================================== */

.gill-search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.gill-search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.gill-search-icon {
    position: absolute;
    left: 0.75rem;
    color: #6c757d;
    font-size: 0.875rem;
    pointer-events: none;
}

.gill-search-bar .gill-search-input {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    font-size: 16px; /* Prevent iOS zoom */
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
}

.gill-search-bar .gill-search-input:focus {
    outline: none;
    border-color: #395ba9;
    box-shadow: 0 0 0 2px rgba(57, 91, 169, 0.1);
}

.gill-search-bar .gill-search-input::placeholder {
    color: #adb5bd;
}

.gill-search-clear {
    position: absolute;
    right: 0.5rem;
    padding: 0.25rem;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    font-size: 1rem;
}

.gill-search-clear:hover {
    color: #495057;
}

.gill-search-bar .gill-search-results {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    min-width: 60px;
    text-align: center;
}

.gill-search-nav {
    display: flex;
    gap: 0.25rem;
}

.gill-search-nav-btn {
    padding: 0.25rem 0.5rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
}

.gill-search-nav-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* Search highlight styling */
.gill-search-highlight {
    background: #fff3cd;
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

.gill-search-highlight.current {
    background: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5);
}

/* Dark mode - in-content search */
[data-theme="dark"] .gill-search-bar {
    background: #252a30;
    border-color: #3d4450;
}

[data-theme="dark"] .gill-search-bar .gill-search-input {
    background: #1e2328;
    border-color: #3d4450;
    color: #c8ccd0;
}

[data-theme="dark"] .gill-search-bar .gill-search-input:focus {
    border-color: #7fa8e8;
    box-shadow: 0 0 0 2px rgba(127, 168, 232, 0.15);
}

[data-theme="dark"] .gill-search-bar .gill-search-input::placeholder {
    color: #6c757d;
}

[data-theme="dark"] .gill-search-icon {
    color: #8a9199;
}

[data-theme="dark"] .gill-search-clear {
    color: #8a9199;
}

[data-theme="dark"] .gill-search-clear:hover {
    color: #c8ccd0;
}

[data-theme="dark"] .gill-search-bar .gill-search-results {
    color: #8a9199;
}

[data-theme="dark"] .gill-search-nav-btn {
    background: #1e2328;
    border-color: #3d4450;
    color: #c8ccd0;
}

[data-theme="dark"] .gill-search-nav-btn:hover {
    background: #2d333b;
    border-color: #4b5563;
}

[data-theme="dark"] .gill-search-highlight {
    background: rgba(255, 193, 7, 0.3);
    color: #e8e0c8;
}

[data-theme="dark"] .gill-search-highlight.current {
    background: rgba(255, 193, 7, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

/* Dark mode scrollbar for Gill commentary content */
[data-theme="dark"] #gillCommentaryContent {
    scrollbar-color: #555 #2a2a35;
}

[data-theme="dark"] #gillCommentaryContent::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] #gillCommentaryContent::-webkit-scrollbar-track {
    background: #2a2a35;
    border-radius: 4px;
}

[data-theme="dark"] #gillCommentaryContent::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

[data-theme="dark"] #gillCommentaryContent::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ==========================================================================
   CROSS REFERENCES (Treasury of Scripture Knowledge)
   ========================================================================== */

.crossref-section {
    margin-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.crossref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.crossref-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crossref-title i {
    color: #6c757d;
}

button.crossref-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #395ba9;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #395ba9;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: normal;
}

button.crossref-toggle-btn:hover {
    background: #395ba9;
    color: white;
}

button.crossref-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(57, 91, 169, 0.25);
}

button.crossref-toggle-btn.active {
    background: #395ba9;
    color: white;
}

button.crossref-toggle-btn.active:hover {
    background: #2e4a8a;
    border-color: #2e4a8a;
}

button.crossref-toggle-btn i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

#crossrefContent,
.crossref-content {
    display: none !important;
    padding: 0.75rem;
    background: #fdfcfa;
    border: 1px solid #e9e5df;
    border-radius: 8px;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 0.75rem;
}

#crossrefContent.show,
.crossref-content.show {
    display: block !important;
}

/* Loading and info states */
.crossref-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    color: #6c757d;
}

.crossref-loading .spinner-border {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

.crossref-error {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 0.85rem;
}

.crossref-info {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

/* Scope note for multi-verse lookups */
.crossref-scope-note {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* Reference count */
.crossref-count {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #eee;
}

/* Per-verse headers (multi-verse lookups) */
.crossref-verse-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    background: #f1f3f4;
    padding: 0.4rem 0.75rem;
    margin: 1rem -1rem 0.5rem -1rem;
    border-top: 1px solid #e9e5df;
    border-bottom: 1px solid #e9e5df;
}

.crossref-verse-header.first {
    margin-top: 0;
    border-top: none;
}

.crossref-verse-count {
    font-weight: 400;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Reference list */
.crossref-list {
    display: flex;
    flex-direction: column;
}

.crossref-item {
    border-bottom: 1px solid #f0ede8;
}

.crossref-item:last-child {
    border-bottom: none;
}

.crossref-item-row {
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
    gap: 0.375rem;
}

/* Expand/collapse button */
.crossref-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    color: #6c757d;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    font-size: 0.7rem;
}

.crossref-expand-btn:hover {
    background: #f0f0f0;
    border-color: #adb5bd;
    color: #333;
}

/* Reference link */
.crossref-ref-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.crossref-ref-link:hover {
    color: #004499;
    text-decoration: underline;
}

/* Inline verse preview */
.crossref-preview {
    padding: 0.4rem 0.5rem 0.5rem 2rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #555;
    font-family: Georgia, "Times New Roman", serif;
}

.crossref-preview-loading {
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    font-size: 0.85rem;
}

.crossref-preview-loading .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* ==========================================================================
   CROSS REFERENCES - RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .crossref-content {
        max-height: 280px;
        padding: 0.5rem;
    }
}

@media (max-width: 576px) {
    .crossref-section {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
    }

    .crossref-content {
        max-height: 250px;
        padding: 0.4rem;
    }

    .crossref-ref-link {
        font-size: 0.85rem;
    }

    .crossref-preview {
        padding-left: 1.5rem;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   CROSS REFERENCES - DARK MODE
   ========================================================================== */

[data-theme="dark"] .crossref-section {
    border-top-color: #3d4450;
}

[data-theme="dark"] .crossref-title {
    color: #c8ccd0;
}

[data-theme="dark"] .crossref-title i {
    color: #8a9199;
}

[data-theme="dark"] button.crossref-toggle-btn {
    background: #252530;
    border-color: #7fa8e8;
    color: #7fa8e8;
}

[data-theme="dark"] button.crossref-toggle-btn:hover {
    background: #2a4080;
    border-color: #2a4080;
    color: white;
}

[data-theme="dark"] button.crossref-toggle-btn.active {
    background: #2a4080;
    border-color: #2a4080;
    color: white;
}

[data-theme="dark"] button.crossref-toggle-btn.active:hover {
    background: #335099;
    border-color: #335099;
}

[data-theme="dark"] #crossrefContent,
[data-theme="dark"] .crossref-content {
    background: #1e2328;
    border-color: #3d4450;
}

[data-theme="dark"] .crossref-loading {
    color: #8a9199;
}

[data-theme="dark"] .crossref-error {
    background: #3b2020;
    border-color: #5c3333;
    color: #f5a5a5;
}

[data-theme="dark"] .crossref-info {
    background: #252a30;
    border-color: #3d4450;
    color: #8a9199;
}

[data-theme="dark"] .crossref-scope-note {
    color: #8a9199;
}

[data-theme="dark"] .crossref-count {
    color: #8a9199;
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .crossref-verse-header {
    color: #c8ccd0;
    background: #252a30;
    border-top-color: #3d4450;
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .crossref-verse-count {
    color: #8a9199;
}

[data-theme="dark"] .crossref-item {
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .crossref-expand-btn {
    border-color: #3d4450;
    color: #8a9199;
}

[data-theme="dark"] .crossref-expand-btn:hover {
    background: #2d333b;
    border-color: #4b5563;
    color: #c8ccd0;
}

[data-theme="dark"] .crossref-ref-link {
    color: #6db3f2;
}

[data-theme="dark"] .crossref-ref-link:hover {
    color: #93c5fd;
}

[data-theme="dark"] .crossref-preview {
    color: #b0b5bb;
}

/* Dark mode scrollbar for cross-ref content */
[data-theme="dark"] #crossrefContent {
    scrollbar-color: #555 #2a2a35;
}

[data-theme="dark"] #crossrefContent::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] #crossrefContent::-webkit-scrollbar-track {
    background: #2a2a35;
    border-radius: 4px;
}

[data-theme="dark"] #crossrefContent::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

[data-theme="dark"] #crossrefContent::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ==========================================================================
   CROSS REFERENCES - PRINT
   ========================================================================== */

@media print {
    .crossref-content {
        max-height: none;
        overflow: visible;
        border: none;
        background: white;
    }

    .crossref-toggle-btn {
        display: none;
    }

    .crossref-ref-link {
        color: inherit;
        text-decoration: none;
    }

    .crossref-expand-btn {
        display: none;
    }
}

/* ==========================================================================
   STRONG'S CONCORDANCE WORD STUDY
   ========================================================================== */

/* ---------- Clickable word styles ---------- */

.strongs-word {
    border-bottom: 1px dotted #999;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 1px;
}

.strongs-word:hover {
    border-bottom-color: #395ba9;
    color: #395ba9;
    background: rgba(57, 91, 169, 0.05);
}

.strongs-word-active {
    background: rgba(57, 91, 169, 0.12);
    border-bottom: 2px solid #395ba9;
    color: #395ba9;
}

/* ---------- Popover container ---------- */

.strongs-popover {
    position: fixed;
    z-index: 1060;
    max-width: 340px;
    min-width: 240px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    max-height: 380px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Arrow pointing at the word */
.strongs-popover-arrow {
    position: absolute;
    top: -7px;
    left: var(--strongs-arrow-left, 50%);
    transform: translateX(-50%);
    width: 14px;
    height: 7px;
    overflow: hidden;
}

.strongs-popover-arrow::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1px solid #dee2e6;
}

/* When popover is above the word, arrow points down */
.strongs-popover-above .strongs-popover-arrow {
    top: auto;
    bottom: -7px;
}

.strongs-popover-above .strongs-popover-arrow::before {
    top: auto;
    bottom: 1px;
}

.strongs-popover-content {
    padding: 0.75rem;
}

/* ---------- Popover inner elements ---------- */

.strongs-popover-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #6c757d;
}

.strongs-popover-empty {
    padding: 0.5rem;
    color: #6c757d;
    font-style: italic;
}

.strongs-entry-divider {
    border-top: 1px solid #e9ecef;
    margin: 0.75rem 0;
}

.strongs-entry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.strongs-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: #333;
}

.strongs-lang-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.strongs-lang-badge.strongs-hebrew {
    background: #f5efe6;
    color: #8b6914;
}

.strongs-lang-badge.strongs-greek {
    background: #e8f0fe;
    color: #1a5fb4;
}

.strongs-lemma {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.strongs-lemma.strongs-hebrew {
    font-family: "SBL Hebrew", "Ezra SIL", "Times New Roman", serif;
    color: #5c4033;
}

.strongs-lemma.strongs-greek {
    font-family: "SBL Greek", "Gentium Plus", "Times New Roman", serif;
    color: #1a4a7a;
}

.strongs-translit {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.25rem;
}

.strongs-pronun {
    color: #777;
    font-size: 0.8rem;
}

.strongs-pos {
    font-size: 0.8rem;
    font-style: italic;
    color: #6c757d;
    margin-bottom: 0.375rem;
}

.strongs-definition {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.375rem;
    line-height: 1.55;
}

.strongs-usage {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.25rem;
    line-height: 1.45;
}

.strongs-occurrences-summary {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.375rem;
    line-height: 1.45;
}

.strongs-study-link-container {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.strongs-study-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #395ba9;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.strongs-study-link:hover {
    color: #2e4a8a;
    text-decoration: underline;
}

/* ---------- Occurrences panel ---------- */

.strongs-occurrences-section {
    margin-top: 1.5rem;
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

.strongs-occ-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.strongs-occ-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strongs-occ-title i {
    color: #6c757d;
}

.strongs-occ-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.15s ease;
}

.strongs-occ-close:hover {
    background: #f0f0f0;
    border-color: #adb5bd;
    color: #333;
}

.strongs-occ-content {
    padding: 0.75rem;
    background: #fdfcfa;
    border: 1px solid #e9e5df;
    border-radius: 8px;
    max-height: 350px;
    overflow-y: auto;
}

.strongs-occ-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: #6c757d;
}

.strongs-occ-error {
    padding: 0.75rem;
    color: #721c24;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 0.85rem;
}

.strongs-occ-count {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #eee;
}

.strongs-occ-list {
    display: flex;
    flex-direction: column;
}

.strongs-occ-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0ede8;
}

.strongs-occ-item:last-child {
    border-bottom: none;
}

.strongs-occ-ref {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease;
}

.strongs-occ-ref:hover {
    color: #004499;
    text-decoration: underline;
}

.strongs-occ-text {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin-top: 0.15rem;
}

.strongs-occ-text mark {
    background: #fff3cd;
    padding: 0 0.15em;
    border-radius: 2px;
}

.strongs-occ-more-container {
    text-align: center;
    padding-top: 0.75rem;
}

.strongs-occ-load-more {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: #fff;
    border: 1px solid #395ba9;
    border-radius: 6px;
    color: #395ba9;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strongs-occ-load-more:hover {
    background: #395ba9;
    color: #fff;
}

/* ==========================================================================
   STRONG'S - RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .strongs-popover {
        max-width: 300px;
        max-height: 320px;
    }

    .strongs-occ-content {
        max-height: 280px;
    }
}

@media (max-width: 576px) {
    .strongs-popover {
        position: fixed;
        left: 8px !important;
        right: 8px;
        max-width: none;
        width: auto;
        bottom: auto;
        max-height: 50vh;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .strongs-popover-arrow {
        display: none;
    }

    .strongs-occurrences-section {
        margin-top: 0.75rem;
        padding-top: 0.5rem;
    }

    .strongs-occ-content {
        max-height: 250px;
        padding: 0.5rem;
    }
}

/* ==========================================================================
   STRONG'S - PRINT
   ========================================================================== */

@media print {
    .strongs-word {
        border-bottom: none;
        cursor: default;
    }

    .strongs-popover {
        display: none !important;
    }

    .strongs-occurrences-section {
        display: none !important;
    }
}

/* ==========================================================================
   STRONG'S - DARK MODE
   ========================================================================== */

/* Word styles */
[data-theme="dark"] .strongs-word {
    border-bottom-color: #6c757d;
}

[data-theme="dark"] .strongs-word:hover {
    border-bottom-color: #7fa8e8;
    color: #7fa8e8;
    background: rgba(127, 168, 232, 0.08);
}

[data-theme="dark"] .strongs-word-active {
    background: rgba(127, 168, 232, 0.15);
    border-bottom-color: #7fa8e8;
    color: #7fa8e8;
}

/* Popover */
[data-theme="dark"] .strongs-popover {
    background: #1e2328;
    border-color: #3d4450;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .strongs-popover-arrow::before {
    background: #1e2328;
    border-color: #3d4450;
}

[data-theme="dark"] .strongs-popover-loading {
    color: #8a9199;
}

[data-theme="dark"] .strongs-popover-empty {
    color: #8a9199;
}

[data-theme="dark"] .strongs-entry-divider {
    border-top-color: #3d4450;
}

[data-theme="dark"] .strongs-number {
    color: #c8ccd0;
}

[data-theme="dark"] .strongs-lang-badge.strongs-hebrew {
    background: #2a2520;
    color: #d4a574;
}

[data-theme="dark"] .strongs-lang-badge.strongs-greek {
    background: #1a2533;
    color: #6db3f2;
}

[data-theme="dark"] .strongs-lemma.strongs-hebrew {
    color: #d4a574;
}

[data-theme="dark"] .strongs-lemma.strongs-greek {
    color: #6db3f2;
}

[data-theme="dark"] .strongs-translit {
    color: #b0b5bb;
}

[data-theme="dark"] .strongs-pronun {
    color: #8a9199;
}

[data-theme="dark"] .strongs-pos {
    color: #8a9199;
}

[data-theme="dark"] .strongs-definition {
    color: #c8ccd0;
}

[data-theme="dark"] .strongs-usage {
    color: #b0b5bb;
}

[data-theme="dark"] .strongs-occurrences-summary {
    color: #b0b5bb;
}

[data-theme="dark"] .strongs-study-link-container {
    border-top-color: #3d4450;
}

[data-theme="dark"] .strongs-study-link {
    color: #7fa8e8;
}

[data-theme="dark"] .strongs-study-link:hover {
    color: #93c5fd;
}

/* Occurrences panel - dark mode */
[data-theme="dark"] .strongs-occurrences-section {
    border-top-color: #3d4450;
}

[data-theme="dark"] .strongs-occ-title {
    color: #c8ccd0;
}

[data-theme="dark"] .strongs-occ-title i {
    color: #8a9199;
}

[data-theme="dark"] .strongs-occ-close {
    border-color: #3d4450;
    color: #8a9199;
}

[data-theme="dark"] .strongs-occ-close:hover {
    background: #2d333b;
    border-color: #4b5563;
    color: #c8ccd0;
}

[data-theme="dark"] .strongs-occ-content {
    background: #1e2328;
    border-color: #3d4450;
}

[data-theme="dark"] .strongs-occ-loading {
    color: #8a9199;
}

[data-theme="dark"] .strongs-occ-error {
    background: #3b2020;
    border-color: #5c3333;
    color: #f5a5a5;
}

[data-theme="dark"] .strongs-occ-count {
    color: #8a9199;
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .strongs-occ-item {
    border-bottom-color: #3d4450;
}

[data-theme="dark"] .strongs-occ-ref {
    color: #6db3f2;
}

[data-theme="dark"] .strongs-occ-ref:hover {
    color: #93c5fd;
}

[data-theme="dark"] .strongs-occ-text {
    color: #8a9199;
}

[data-theme="dark"] .strongs-occ-text mark {
    background: #5c4d1a;
    color: #f5e6a3;
}

[data-theme="dark"] .strongs-occ-load-more {
    background: #252530;
    border-color: #7fa8e8;
    color: #7fa8e8;
}

[data-theme="dark"] .strongs-occ-load-more:hover {
    background: #2a4080;
    color: #fff;
}

/* Dark mode scrollbar for Strong's content */
[data-theme="dark"] .strongs-popover {
    scrollbar-color: #555 #2a2a35;
}

[data-theme="dark"] .strongs-popover::-webkit-scrollbar {
    width: 6px;
}

[data-theme="dark"] .strongs-popover::-webkit-scrollbar-track {
    background: #2a2a35;
    border-radius: 3px;
}

[data-theme="dark"] .strongs-popover::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

[data-theme="dark"] .strongs-occ-content {
    scrollbar-color: #555 #2a2a35;
}

[data-theme="dark"] .strongs-occ-content::-webkit-scrollbar {
    width: 8px;
}

[data-theme="dark"] .strongs-occ-content::-webkit-scrollbar-track {
    background: #2a2a35;
    border-radius: 4px;
}

[data-theme="dark"] .strongs-occ-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

[data-theme="dark"] .strongs-occ-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}
