/**
 * Scripture Tagger Styles - Pristine Grace
 *
 * Styles for scripture reference links and tooltips.
 * Designed to match the Blue Letter Bible look and feel.
 *
 * @package PristineGrace
 * @since 4.4
 */

/* ============================================================================
   SCRIPTURE REFERENCE LINKS
   ============================================================================ */

a.scripture-ref {
    color: #1a3c6e;
    text-decoration: underline;
    text-decoration-color: rgba(26, 60, 110, 0.4);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
    border: none !important;
    background: none !important;
}

a.scripture-ref:hover {
    color: #395ba9;
    text-decoration-color: rgba(57, 91, 169, 0.7);
}

a.scripture-ref:focus {
    outline: 2px solid rgba(57, 91, 169, 0.3);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Dark mode support */
[data-theme="dark"] a.scripture-ref {
    color: #7fa8e8;
    text-decoration-color: rgba(127, 168, 232, 0.4);
}

[data-theme="dark"] a.scripture-ref:hover {
    color: #a3c4f3;
    text-decoration-color: rgba(163, 196, 243, 0.7);
}

/* ============================================================================
   TOOLTIP CONTAINER
   ============================================================================ */

.scripture-tagger-tooltip {
    position: absolute;
    z-index: 10000;
    max-width: 420px;
    min-width: 280px;
    background: #fff;
    border: 1px solid #c0cfe0;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    animation: tooltipFadeIn 0.15s ease-out;
}

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

.scripture-tagger-tooltip.tooltip-above {
    animation: tooltipFadeInAbove 0.15s ease-out;
}

@keyframes tooltipFadeInAbove {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   TOOLTIP HEADER
   ============================================================================ */

.scripture-tooltip-header {
    background: linear-gradient(to bottom, #4a6fa5, #3d5d8f);
    color: #fff;
    padding: 10px 14px;
    border-radius: 5px 5px 0 0;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.scripture-tooltip-header:hover {
    background: linear-gradient(to bottom, #5a7fb5, #4d6d9f);
}

.scripture-tooltip-header:hover .scripture-tooltip-reference {
    text-decoration: underline;
}

.scripture-tooltip-reference {
    flex: 1;
}

.scripture-tooltip-translation {
    font-weight: 400;
    font-size: 13px;
    opacity: 0.9;
    margin-left: 8px;
}

/* ============================================================================
   TOOLTIP CONTENT
   ============================================================================ */

.scripture-tooltip-content {
    padding: 14px;
    color: #333;
    background: #f8fafc;
    max-height: 200px;
    overflow-y: auto;
}

.scripture-tooltip-loading {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

.scripture-tooltip-text {
    line-height: 1.65;
}

.scripture-tooltip-abbrev {
    font-weight: 600;
    color: #1a3c6e;
}

.scripture-tooltip-text sup {
    font-size: 0.7em;
    color: #4a6fa5;
    font-weight: 700;
    margin-right: 2px;
    vertical-align: super;
}

.scripture-tooltip-verse {
    margin-bottom: 6px;
}

.scripture-tooltip-verse:last-child {
    margin-bottom: 0;
}

.scripture-tooltip-inline-ref {
    font-weight: 700;
    color: #1a3c6e;
    font-size: 0.95em;
}

.scripture-tooltip-error {
    color: #c53030;
    font-style: italic;
}

/* Chapter headers for multi-chapter/multi-reference lookups */
.scripture-tooltip-chapter-header {
    font-weight: 700;
    color: #1a3c6e;
    font-size: 13px;
    margin-bottom: 4px;
}

.scripture-tooltip-chapter-break {
    height: 1px;
    background: #d0dce8;
    margin: 10px 0;
}

/* ============================================================================
   TOOLTIP FOOTER
   ============================================================================ */

.scripture-tooltip-footer {
    background: #e8f0f8;
    padding: 8px 14px;
    border-top: 1px solid #d0dce8;
    border-radius: 0 0 5px 5px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.scripture-tooltip-powered {
    color: #666;
}

.scripture-tooltip-brand {
    color: #1a3c6e;
    font-weight: 700;
}

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

[data-theme="dark"] .scripture-tagger-tooltip {
    background: #1e2a3a;
    border-color: #3a4a5e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .scripture-tooltip-header {
    background: linear-gradient(to bottom, #2d4a70, #243d5c);
}

[data-theme="dark"] .scripture-tooltip-content {
    background: #141e2a;
    color: #e0e6ed;
}

[data-theme="dark"] .scripture-tooltip-abbrev {
    color: #7fa8e8;
}

[data-theme="dark"] .scripture-tooltip-text sup {
    color: #7fa8e8;
}

[data-theme="dark"] .scripture-tooltip-inline-ref {
    color: #7fa8e8;
}

[data-theme="dark"] .scripture-tooltip-chapter-header {
    color: #7fa8e8;
}

[data-theme="dark"] .scripture-tooltip-chapter-break {
    background: #2a3a4e;
}

[data-theme="dark"] .scripture-tooltip-footer {
    background: #1a2636;
    border-color: #2a3a4e;
}

[data-theme="dark"] .scripture-tooltip-powered {
    color: #888;
}

[data-theme="dark"] .scripture-tooltip-brand {
    color: #7fa8e8;
}

/* ============================================================================
   SPECIAL CONTEXTS - Match existing BLB overrides
   ============================================================================ */

/* Broadcaster/Sermon topic hero sections - white links */
.broadcaster-hero a.scripture-ref,
.broadcaster-hero a[class*="scripture-ref"],
.broadcaster-description a.scripture-ref,
.broadcaster-description a[class*="scripture-ref"] {
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: underline !important;
    text-decoration-color: rgba(255, 255, 255, 0.5) !important;
    border: none !important;
    border-bottom: none !important;
    background: none !important;
}

.broadcaster-hero a.scripture-ref:hover,
.broadcaster-description a.scripture-ref:hover {
    color: #fff !important;
    text-decoration-color: rgba(255, 255, 255, 0.8) !important;
}

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

@media (max-width: 480px) {
    .scripture-tagger-tooltip {
        max-width: calc(100vw - 80px);
        min-width: 220px;
        left: 40px !important;
        right: 40px !important;
    }

    .scripture-tooltip-header {
        padding: 8px 12px;
        font-size: 14px;
    }

    .scripture-tooltip-content {
        padding: 12px;
        font-size: 13px;
        max-height: 160px;
    }

    .scripture-tooltip-footer {
        padding: 6px 12px;
        font-size: 10px;
    }
}

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

@media print {
    a.scripture-ref {
        color: inherit !important;
        text-decoration: none !important;
    }

    .scripture-tagger-tooltip {
        display: none !important;
    }
}
