/* ═══════════════════════════════════════════════════════
   Lexicon Dictionary Browser — Sidebar Cards + Lexicon Tab
   ═══════════════════════════════════════════════════════ */

/* ─── Sidebar Header ─── */

.lexicon-sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 5;
}

.lexicon-search-bar {
    margin-bottom: 0.5rem;
}

.lexicon-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.lexicon-search-input:focus {
    border-color: var(--primary);
}

.lexicon-lang-toggle {
    display: flex;
    gap: 0.25rem;
}

.lexicon-lang-btn {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.lexicon-lang-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.lexicon-lang-btn:hover:not(.active) {
    background: var(--highlight);
}

/* ─── Word Cards ─── */

.lexicon-card-list {
    padding: 0.5rem;
}

.lexicon-card {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.lexicon-card:hover {
    background: var(--highlight);
    border-color: var(--primary);
}
.lexicon-card.expanded {
    border-color: var(--primary);
    background: var(--highlight);
}

.lexicon-card-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lexicon-card-num {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.8rem;
}

.lexicon-card-lemma {
    font-size: 1.25rem;
    font-family: 'Crimson Text', serif;
}

.lexicon-card-translit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.lexicon-card-tag-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: auto;
}

.lexicon-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.lexicon-note-indicator {
    font-size: 0.75rem;
}

.lexicon-card-def {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* ─── Expanded Card ─── */

.lexicon-expanded {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 8px;
}

.lexicon-expanded-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.lexicon-expanded-num {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.lexicon-expanded-lemma {
    font-size: 1.5rem;
    font-family: 'Crimson Text', serif;
}

.lexicon-expanded-translit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
}

.lexicon-expanded-source {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: var(--highlight);
    border-radius: 4px;
    color: var(--text-secondary);
}

.lexicon-expanded-tags {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.5rem;
}

/* Lexicon tag button uses .verse-action-btn from styles.css */

.lexicon-expanded-def {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    word-break: break-word;
}

/* Lexicon entry HTML classes (from build script) */
.lexicon-expanded-def .lex-entry { }
.lexicon-expanded-def .lex-hebrew,
.lexicon-tab-def .lex-hebrew {
    font-family: 'Crimson Text', 'SBL Hebrew', serif;
    font-size: 1.1em;
    direction: rtl;
    unicode-bidi: embed;
}
.lexicon-expanded-def .lex-hebrew-word,
.lexicon-tab-def .lex-hebrew-word {
    font-family: 'Crimson Text', 'SBL Hebrew', serif;
    font-size: 1.1em;
    color: var(--primary);
}
.lexicon-expanded-def .lex-greek,
.lexicon-tab-def .lex-greek {
    font-family: 'Crimson Text', serif;
    font-style: italic;
}
.lexicon-expanded-def .lex-gloss,
.lexicon-tab-def .lex-gloss {
    font-style: italic;
    color: var(--primary);
}
.lexicon-expanded-def .lex-ref,
.lexicon-tab-def .lex-ref {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline dotted;
}
.lexicon-expanded-def .lex-ref:hover,
.lexicon-tab-def .lex-ref:hover {
    text-decoration: underline solid;
}
.lexicon-expanded-def .lex-sense,
.lexicon-tab-def .lex-sense {
    margin: 0.5rem 0;
    padding-left: 1rem;
}
.lexicon-expanded-def .lex-etym,
.lexicon-tab-def .lex-etym {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.lexicon-expanded-def .lex-sub1,
.lexicon-tab-def .lex-sub1 {
    padding-left: 1rem;
}
.lexicon-expanded-def .lex-sub2,
.lexicon-tab-def .lex-sub2 {
    padding-left: 2rem;
}
.lexicon-expanded-def .lex-bdb p,
.lexicon-tab-def .lex-bdb p {
    margin: 0.3rem 0;
}

/* Cross-references */
.lexicon-cross-refs {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--highlight);
    border-radius: 6px;
}

.lexicon-xref {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    margin: 0.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--primary);
    transition: all 0.2s;
}
.lexicon-xref:hover {
    background: var(--primary);
    color: white;
}

/* Cross-refs that open WordStudyModal — consistent with Deeper Study button */
.lexicon-xref-study {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border-color: #667eea;
    font-weight: 600;
}
.lexicon-xref-study:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

/* ─── Notes Section ─── */

.lexicon-notes-section {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

.lexicon-notes-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.lexicon-notes-textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--background);
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.lexicon-notes-textarea:focus {
    border-color: var(--primary);
}

.lexicon-notes-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.lexicon-notes-saved {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ─── Lexicon Tab in Strong's Display ─── */

.lexicon-tab-content {
    font-size: 0.85rem;
    line-height: 1.6;
}

.lexicon-tab-source {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    background: var(--highlight);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lexicon-tab-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
/* Lexicon tab tag button uses .verse-action-btn from styles.css */
.lexicon-tab-actions .lexicon-tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.lexicon-tab-def {
    font-size: 0.85rem;
    line-height: 1.6;
}

.lexicon-tab-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
}

.lexicon-tab-hint {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ─── Loading + Empty States ─── */

.lexicon-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.lexicon-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* ─── Scroll sentinel for infinite loading ─── */

.lexicon-scroll-sentinel {
    height: 1px;
    width: 100%;
}
