/**
 * Post Tag Input and Tag Filter Styles
 * Provides consistent chip input, autocomplete dropdown, and tag filter styles
 * for posts index, show, create, and edit-metadata views across light and dark themes.
 */

/* ─── Tag Input Container & Wrapper ─────────────────────────────────────── */
.pti-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    z-index: 50;
}

.pti-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    min-height: 42px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    cursor: text;
}

.pti-input-wrapper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.pti-chips {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pti-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    padding: 2px 9px 2px 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    animation: ptiPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

@keyframes ptiPopIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.pti-chip.pti-chip-pulse {
    animation: ptiPulse 0.4s ease-out;
}

@keyframes ptiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); background: #e0e7ff; }
}

.pti-chip-hash {
    color: #818cf8;
    font-size: 0.75rem;
    font-weight: 700;
}

.pti-chip-text {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pti-chip-remove {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, transform 0.15s;
}

.pti-chip-remove:hover {
    color: #dc2626;
    transform: scale(1.2);
}

.pti-input {
    flex: 1 1 120px;
    min-width: 90px;
    border: none !important;
    outline: none !important;
    padding: 4px 6px !important;
    background: transparent !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    color: #1e293b !important;
    box-shadow: none !important;
}

.pti-clear-btn {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: #64748b;
    font-size: 0.75rem;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.pti-clear-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ─── Autocomplete Dropdown ─────────────────────────────────────────────── */
.pti-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 10000;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    box-sizing: border-box;
}

.pti-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.14s;
}

.pti-option:hover,
.pti-option.pti-highlighted {
    background: #f1f5f9;
}

.pti-option-selected {
    background: #f8fafc;
    color: #64748b;
}

.pti-option-create {
    color: #6366f1;
    font-weight: 600;
    background: #f5f3ff;
    border: 1px dashed #c7d2fe;
    margin-bottom: 4px;
}

.pti-option-create:hover,
.pti-option-create.pti-highlighted {
    background: #ede9fe;
}

.pti-create-icon {
    font-size: 1rem;
    font-weight: 700;
    margin-right: 6px;
}

.pti-option-tag {
    font-weight: 500;
}

.pti-option-count {
    font-size: 0.72rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 600;
}

.pti-mark {
    background: #fef08a;
    color: #854d0e;
    border-radius: 2px;
    padding: 0 2px;
}

.pti-empty-hint {
    padding: 12px;
    text-align: center;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* ─── Tag Filter Bar on /posts Feed ─────────────────────────────────────── */
.posts-filter-section {
    position: relative;
    z-index: 30;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.posts-filter-section:focus-within {
    z-index: 60;
}

.posts-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.posts-filter-bar .filter-input-wrapper {
    position: relative;
    z-index: 50;
    flex: 1 1 320px;
    min-width: 240px;
}

/* Dark theme overrides for pti-container inside posts-filter-section */
.posts-filter-section .pti-input-wrapper {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(255, 255, 255, 0.14);
}

.posts-filter-section .pti-input-wrapper:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.posts-filter-section .pti-chip {
    background: rgba(99, 102, 241, 0.25);
    color: #e0e7ff;
    border-color: rgba(129, 140, 248, 0.35);
}

.posts-filter-section .pti-chip-hash {
    color: #a5b4fc;
}

.posts-filter-section .pti-chip-remove {
    color: #c7d2fe;
}

.posts-filter-section .pti-chip-remove:hover {
    color: #f87171;
}

.posts-filter-section .pti-input {
    color: #f8fafc !important;
}

.posts-filter-section .pti-input::placeholder {
    color: #94a3b8;
}

.posts-filter-section .pti-clear-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
}

.posts-filter-section .pti-clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.posts-filter-section .pti-dropdown {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}

.posts-filter-section .pti-option {
    color: #f1f5f9;
}

.posts-filter-section .pti-option:hover,
.posts-filter-section .pti-option.pti-highlighted {
    background: rgba(99, 102, 241, 0.2);
}

.posts-filter-section .pti-option-count {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.posts-filter-section .pti-option-create {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(129, 140, 248, 0.3);
}

.posts-filter-section .pti-option-create:hover,
.posts-filter-section .pti-option-create.pti-highlighted {
    background: rgba(99, 102, 241, 0.25);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-match-toggles {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.tag-match-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-match-btn:hover {
    color: #ffffff;
}

.tag-match-btn.active {
    background: #6366f1;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.filter-submit-btn {
    padding: 0.5rem 1.25rem !important;
    font-size: 0.875rem !important;
    cursor: pointer;
}

.filter-clear-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    text-decoration: none;
}

/* ─── Popular Tags Row ──────────────────────────────────────────────────── */
.popular-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.popular-tags-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.popular-tags-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.popular-tag-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.5);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    padding: 3px 10px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.popular-tag-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
    border-color: rgba(129, 140, 248, 0.4);
    transform: translateY(-1px);
}

.popular-tag-btn.is-active {
    background: #6366f1;
    color: #ffffff;
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.popular-tag-btn .pop-count {
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 1px 5px;
    border-radius: 9999px;
    opacity: 0.85;
}

/* ─── Active Filter Status Banner ───────────────────────────────────────── */
.active-filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #e0e7ff;
}

.active-filter-info strong {
    color: #ffffff;
}

.active-filter-count {
    font-weight: 600;
    color: #a5b4fc;
}

.active-filter-reset {
    color: #fca5a5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    transition: color 0.15s;
}

.active-filter-reset:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* ─── Post Card Tag Chips ───────────────────────────────────────────────── */
.post-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.post-card-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(129, 140, 248, 0.25);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.post-card-tag-chip:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #ffffff;
    border-color: #818cf8;
    transform: translateY(-1px);
}

.post-card-tag-chip.is-active {
    background: #6366f1;
    color: #ffffff;
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.post-card-tag-chip .hash {
    opacity: 0.75;
    font-size: 0.7rem;
}

/* ─── Single Post View Tag Chips ────────────────────────────────────────── */
.post-tags-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 1.25rem;
}

.post-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 12px;
    border-radius: 9999px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-tag-badge:hover {
    background: #e0e7ff;
    color: #312e81;
    border-color: #a5b4fc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.15);
}

.post-tag-badge .tag-hash {
    color: #6366f1;
    font-weight: 700;
}

/* ─── Post Card Snippet (HTML rendered safely in feed) ───────────────────── */
.post-card-snippet {
    color: var(--text-muted, #94a3b8);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.post-card-snippet p,
.post-card-snippet div {
    margin: 0 0 0.35rem 0;
    display: inline;
}

.post-card-snippet br {
    content: "";
    margin: 0.2rem 0;
    display: block;
}

.post-card-snippet a {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}

.post-card-snippet strong,
.post-card-snippet b {
    color: inherit;
    font-weight: 600;
}

.post-card-snippet em,
.post-card-snippet i {
    font-style: italic;
}

/* ─── Post Rich HTML (Full post view in show.ejs) ────────────────────────── */
.post-rich-html {
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--text-main, #1e293b);
    word-break: break-word;
}

.post-rich-html p {
    margin: 0 0 1.25rem 0;
}

.post-rich-html div {
    margin: 0 0 0.5rem 0;
}

.post-rich-html h1,
.post-rich-html h2,
.post-rich-html h3,
.post-rich-html h4,
.post-rich-html h5,
.post-rich-html h6 {
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-rich-html h1 { font-size: 2rem; }
.post-rich-html h2 { font-size: 1.625rem; }
.post-rich-html h3 { font-size: 1.35rem; }

.post-rich-html ul,
.post-rich-html ol {
    margin: 0 0 1.25rem 1.75rem;
    padding-left: 0.5rem;
}

.post-rich-html li {
    margin-bottom: 0.35rem;
}

.post-rich-html blockquote {
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    border-left: 4px solid var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.05);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.post-rich-html code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}

.post-rich-html pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-rich-html img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-rich-html a {
    color: var(--primary, #6366f1);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.post-rich-html a:hover {
    color: #4338ca;
}

.post-rich-html a[onclick*="popVerse"],
.post-rich-html a[id^="verseLink"] {
    cursor: pointer;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    text-decoration: none;
    border-bottom: 1px dotted var(--primary, #6366f1);
    transition: all 0.15s ease-in-out;
}

.post-rich-html a[onclick*="popVerse"]:hover,
.post-rich-html a[id^="verseLink"]:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #312e81;
}

/* ─── Verse Popup Styling (for scripture popups in posts) ────────────────── */
#verse-popup.verse-popup,
.verse-popup {
    position: fixed !important;
    width: auto !important;
    max-width: min(440px, calc(100vw - 24px)) !important;
    max-height: 360px !important;
    background: #ffffff !important;
    color: #1e293b !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    z-index: 999999999 !important;
}

#verse-popup .verse-popup__title,
.verse-popup .verse-popup__title {
    background: #4f46e5 !important;
    color: #ffffff !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

#verse-popup .verse-popup__body,
.verse-popup .verse-popup__body {
    padding: 12px 14px !important;
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    color: #1e293b !important;
    overflow-y: auto !important;
    max-height: 220px !important;
    cursor: default !important;
    -webkit-overflow-scrolling: touch !important;
}

#verse-popup .verse-popup__more,
.verse-popup .verse-popup__more {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

#verse-popup .verse-popup__more div[onclick*="viewChapter"],
.verse-popup .verse-popup__more div[onclick*="viewChapter"] {
    cursor: pointer !important;
    color: #4f46e5 !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

#verse-popup .verse-popup__more div[onclick*="copy"],
.verse-popup .verse-popup__more div[onclick*="copy"] {
    cursor: pointer !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 2px 7px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

/* ─── Linkified Scripture references in Posts ─────────────────────── */
a[id^="verseLink_"],
.cpp-verse-link,
a[onclick*="popVerse"],
a[href="//"] {
    color: #2563eb !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: inline !important;
    margin: 0 !important;
    font-weight: 600 !important;
    font-size: inherit !important;
    box-shadow: none !important;
    transform: none !important;
    transition: color 0.15s ease !important;
}

a[id^="verseLink_"]:hover,
.cpp-verse-link:hover,
a[onclick*="popVerse"]:hover,
a[href="//"]:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

/* ─── Bible Buttons (Inline & Floating Action) ─────────────────────── */
.btn-bible {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.btn-bible:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35) !important;
}

.post-floating-bible-btn {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 0.75rem 1.25rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4) !important;
    z-index: 999 !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.post-floating-bible-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.5);
}

/* ─── #biblia Bible Panel Modal ─────────────────────────────────────── */
#biblia.search-window-cover {
    position: fixed !important;
    display: none;
    flex-direction: column !important;
    overflow: hidden !important;
    z-index: 250000 !important;
    background-color: #FAF8FF !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

#biblia.search-window-cover:not([style*="display: none"]):not([style*="display:none"]) {
    display: flex !important;
}

#biblia.search-window-cover[style*="display: none"],
#biblia.search-window-cover[style*="display:none"] {
    display: none !important;
}

@media (min-width: 641px) {
    #biblia.search-window-cover {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        width: min(94vw, 820px) !important;
        max-width: 820px !important;
        height: min(88vh, 800px) !important;
        max-height: 88vh !important;
        border-radius: 12px !important;
        border: 1px solid rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35) !important;
    }
}

@media (max-width: 640px) {
    #biblia.search-window-cover {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
}

/* Sticky Search Input Bar */
#biblia #search_content {
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 42px !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #cbd5e1 !important;
    border-bottom: 2px solid #94a3b8 !important;
    padding: 8px 14px !important;
    font-size: 16px !important;
    outline: none !important;
    border-radius: 0 !important;
}

#biblia #search_content::placeholder {
    color: #64748b !important;
}

/* Sub-window container */
#biblia .search-window {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: calc(100% - 42px) !important;
    max-height: calc(100% - 42px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background-color: #FAF8FF !important;
    color: #000000 !important;
}

#biblia .search-window[style*="display: none"],
#biblia .search-window[style*="display:none"] {
    display: none !important;
}

/* Header & Tabs */
#biblia .search-window {
    position: relative !important;
}

#biblia .search-window__header,
#biblia .search-window__header.versions,
.search-window__header.versions {
    position: static !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: #232946 !important;
    color: #ffffff !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding: 2px 54px 2px 8px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}

#biblia .search-window__header::-webkit-scrollbar,
#biblia .search-window__header.versions::-webkit-scrollbar,
.search-window__header.versions::-webkit-scrollbar {
    display: none !important;
}

#biblia .search-window__header > div:not(:last-child),
#biblia .search-window__header.versions > div:not(:last-child),
.search-window__header.versions > div:not(:last-child) {
    flex-shrink: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px 7px !important;
    margin: 0 !important;
    height: 44px !important;
    max-height: 44px !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    color: #e2e8f0 !important;
    user-select: none !important;
    font-size: 0.85rem !important;
    transition: background-color 0.15s ease, transform 0.15s ease !important;
}

#biblia .search-window__header > div:not(:last-child):hover,
#biblia .search-window__header.versions > div:not(:last-child):hover,
.search-window__header.versions > div:not(:last-child):hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

#biblia .search-window__header > div svg,
#biblia .search-window__header.versions > div svg,
.search-window__header.versions > div svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    flex-shrink: 0 !important;
    color: inherit !important;
    fill: currentColor !important;
}

#biblia .search-window__header .tools-icon-text,
#biblia .search-window__header.versions .tools-icon-text,
.search-window__header.versions .tools-icon-text,
.tools-icon-text {
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    font-size: 0.65rem !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    color: inherit !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
    letter-spacing: 0.02em !important;
    display: block !important;
}

/* Close button in header (Stationary, always visible at top-right without scrolling) */
#biblia .search-window__header > div:last-child,
#biblia .search-window__header.versions > div:last-child,
.search-window__header.versions > div:last-child {
    position: absolute !important;
    top: 7px !important;
    right: 8px !important;
    z-index: 1000 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    min-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    background: rgba(239, 68, 68, 0.22) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
    transition: background-color 0.15s ease, transform 0.15s ease !important;
}

#biblia .search-window__header > div:last-child:hover,
#biblia .search-window__header.versions > div:last-child:hover,
.search-window__header.versions > div:last-child:hover {
    background-color: rgba(239, 68, 68, 0.45) !important;
    transform: scale(1.08) !important;
}

#biblia .search-window__header > div:last-child svg,
#biblia .search-window__header.versions > div:last-child svg,
.search-window__header.versions > div:last-child svg {
    color: #ef4444 !important;
    fill: #ef4444 !important;
    width: 18px !important;
    height: 18px !important;
}

/* Scrollable Body */
#biblia .search-window__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 12px 14px 32px 14px !important;
    box-sizing: border-box !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Scripture Chapter & Verse Content */
#biblia .bible-chapter > div,
#biblia .verse-content > div {
    color: #000000 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 8px !important;
    font-size: 1.05rem !important;
    line-height: 1.65 !important;
    cursor: pointer !important;
}

#biblia .bible-chapter > div:hover,
#biblia .verse-content > div:hover {
    background-color: #f8fafc !important;
}

/* Highlighted Target Verse in Chapter */
#biblia .context,
#biblia .bible-chapter > div.context,
#biblia .verse-content > div.context {
    background-color: #ede9fe !important;
    color: #1e1b4b !important;
    border-left: 4px solid #6366f1 !important;
    padding-left: 12px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
}

#biblia .context *,
#biblia .bible-chapter > div.context *,
#biblia .verse-content > div.context * {
    color: #1e1b4b !important;
}

#biblia a.context,
#biblia .context a {
    color: #4f46e5 !important;
    font-weight: bold !important;
    text-decoration: underline !important;
}

#biblia .search-window__body .panel {
    color: #000000 !important;
}

