/* ============================================================
   The Living Word — Base Styles
   A unique Bible study interface with warm, scholarly aesthetics
   ============================================================ */

/* --- CSS Variables / Theme --- */
:root {
    /* Light theme */
    --bg-primary: #faf8f4;
    --bg-secondary: #f3efe8;
    --bg-tertiary: #ebe6db;
    --bg-panel: #ffffff;
    --bg-hover: rgba(139, 90, 43, 0.06);
    --bg-active: rgba(139, 90, 43, 0.1);
    --bg-verse-hover: rgba(139, 90, 43, 0.04);
    --bg-verse-selected: rgba(139, 90, 43, 0.08);

    --text-primary: #2c1810;
    --text-secondary: #5a4535;
    --text-tertiary: #8a7565;
    --text-muted: #b0a090;
    --text-scripture: #1a0f08;

    --accent: #8b5a2b;
    --accent-light: #c4956a;
    --accent-dark: #5a3518;
    --accent-bg: rgba(139, 90, 43, 0.08);

    --border: rgba(139, 90, 43, 0.12);
    --border-light: rgba(139, 90, 43, 0.06);
    --border-strong: rgba(139, 90, 43, 0.2);

    --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.06);
    --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.08);
    --shadow-lg: 0 8px 32px rgba(44, 24, 16, 0.12);

    --verse-number: #b07840;
    --cross-ref: #6b8e4e;
    --cross-ref-bg: rgba(107, 142, 78, 0.08);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --font-serif: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Menlo', monospace;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #1a1412;
    --bg-secondary: #221c18;
    --bg-tertiary: #2a231e;
    --bg-panel: #1e1814;
    --bg-hover: rgba(196, 149, 106, 0.08);
    --bg-active: rgba(196, 149, 106, 0.12);
    --bg-verse-hover: rgba(196, 149, 106, 0.05);
    --bg-verse-selected: rgba(196, 149, 106, 0.1);

    --text-primary: #e8ddd0;
    --text-secondary: #bfb0a0;
    --text-tertiary: #8a7a6a;
    --text-muted: #5a4a3a;
    --text-scripture: #f0e6d8;

    --accent: #c4956a;
    --accent-light: #dab895;
    --accent-dark: #a07040;
    --accent-bg: rgba(196, 149, 106, 0.1);

    --border: rgba(196, 149, 106, 0.12);
    --border-light: rgba(196, 149, 106, 0.06);
    --border-strong: rgba(196, 149, 106, 0.2);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);

    --verse-number: #c4956a;
    --cross-ref: #8aad6e;
    --cross-ref-bg: rgba(138, 173, 110, 0.1);
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.section-desc {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-panel);
    color: var(--text-secondary);
}

.btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-secondary {
    background: var(--bg-secondary);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    width: 28px;
    height: 28px;
}

/* --- Top Bar --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 1rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    gap: 1rem;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.site-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.top-bar-center {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition);
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--bg-panel);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
}

.search-result-item:hover {
    background: var(--bg-hover);
}

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

.search-result-ref {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
}

.search-result-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-text mark {
    background: rgba(139, 90, 43, 0.15);
    color: var(--text-primary);
    border-radius: 2px;
    padding: 0 2px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.trans-select {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.trans-select:focus {
    border-color: var(--accent);
}

.top-nav {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.2rem;
    border-radius: var(--radius-md);
}

.nav-tab {
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-secondary);
}

.nav-tab.active {
    background: var(--bg-panel);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* --- Theme Toggle --- */
[data-theme="light"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }

/* --- Panels --- */
.app-layout {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.panel-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-sans);
}

/* --- Left Panel: Navigation --- */
.panel-nav {
    width: 260px;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    transition: width var(--transition-slow), transform var(--transition-slow);
}

.testament-tabs {
    display: flex;
    padding: 0.5rem;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.testament-tab {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.testament-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.testament-tab.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.book-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
}

.book-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.85rem;
    color: var(--text-secondary);
    gap: 0.5rem;
}

.book-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.book-item.active {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 500;
}

.book-item-number {
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 20px;
    text-align: right;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.book-item-name {
    flex: 1;
}

.book-item-chapters {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Chapter list */
.chapter-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.chapter-list.hidden {
    display: none;
}

.back-to-books {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    width: 100%;
    text-align: left;
}

.back-to-books:hover {
    background: var(--bg-hover);
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    padding: 0.25rem;
}

.chapter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.chapter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.chapter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* --- Center Panel: Reading --- */
.panel-read {
    flex: 1;
    min-width: 0;
    border-right: 1px solid var(--border);
    background: var(--bg-primary);
}

.view-content {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.view-content.active {
    display: flex;
}

.reading-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.crumb {
    color: var(--text-tertiary);
    font-weight: 500;
}

.crumb:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.crumb-sep {
    color: var(--text-muted);
}

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

/* Scripture content */
.scripture-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.verse-block {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

.verse-block:hover {
    background: var(--bg-verse-hover);
}

.verse-block.selected {
    background: var(--bg-verse-selected);
}

.verse-block.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.verse-number {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--verse-number);
    min-width: 28px;
    text-align: right;
    padding-top: 0.35rem;
    flex-shrink: 0;
    user-select: none;
}

.verse-text {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-scripture);
    flex: 1;
}

.verse-xref-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--cross-ref-bg);
    color: var(--cross-ref);
    font-size: 0.6rem;
    font-family: var(--font-sans);
    font-weight: 700;
    cursor: pointer;
    vertical-align: super;
    margin-left: 2px;
    transition: all var(--transition);
}

.verse-xref-indicator:hover {
    background: var(--cross-ref);
    color: #fff;
    transform: scale(1.1);
}

/* Comparison view */
.comparison-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.comparison-content.hidden {
    display: none;
}

.comparison-verse {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.comparison-verse-ref {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.comparison-translations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.comparison-trans-card {
    padding: 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.comparison-trans-name {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.comparison-trans-text {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-scripture);
}

/* --- Right Panel: Study Tools --- */
.panel-study {
    width: 340px;
    flex-shrink: 0;
    transition: width var(--transition-slow);
}

.study-tools-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.study-section {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all var(--transition);
}

.study-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    background: var(--bg-secondary);
}

.study-section-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}

.study-section-header.collapsible:hover {
    background: var(--bg-tertiary);
}

.study-section-header h3 {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.collapse-icon {
    transition: transform var(--transition);
    color: var(--text-tertiary);
}

.study-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.study-section.collapsed .study-section-body {
    display: none;
}

.study-section-body {
    padding: 0.75rem;
}

.placeholder-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 1rem 0.5rem;
}

/* Selected verse display */
.selected-verse-display.hidden {
    display: none;
}

.verse-ref {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.verse-text-display {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-scripture);
    padding: 0.75rem;
    border-left: 3px solid var(--accent);
    background: var(--accent-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 0;
}

/* Cross references list */
.cross-refs-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cross-ref-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    border: 1px solid transparent;
}

.cross-ref-item:hover {
    background: var(--cross-ref-bg);
    border-color: var(--border-light);
}

.cross-ref-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--cross-ref-bg);
    color: var(--cross-ref);
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    padding: 0 4px;
}

.cross-ref-reference {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cross-ref);
}

.cross-ref-preview {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin-top: 0.15rem;
}

/* Commentary */
.commentary-text {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.commentary-text p {
    margin-bottom: 0.75rem;
}

.commentary-text p:last-child {
    margin-bottom: 0;
}

.commentary-insight {
    padding: 0.75rem;
    background: rgba(196, 149, 106, 0.06);
    border-left: 3px solid var(--accent-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 0.5rem 0;
    font-style: italic;
}

.context-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

/* --- Loading --- */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-muted);
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Chapter bottom nav --- */
.chapter-bottom-nav {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-panel);
    flex-shrink: 0;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Maps --- */
.maps-container {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}

.maps-header {
    margin-bottom: 1rem;
}

.maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.map-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}

.map-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.map-card-preview {
    background: var(--bg-tertiary);
    padding: 0;
    line-height: 0;
}

.map-card-preview svg {
    width: 100%;
    height: auto;
    display: block;
}

.map-card-body {
    padding: 1rem 1.25rem;
}

.map-card-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.map-card-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.map-card-period {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-card-stats {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.map-display {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Leaflet Map Header */
.leaflet-map-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.leaflet-map-info {
    flex: 1;
    min-width: 200px;
}

.leaflet-map-title {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.leaflet-map-period {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.leaflet-map-desc {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.leaflet-map-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    flex-shrink: 0;
}

/* Map Tile Toggle */
.map-view-toggle {
    display: flex;
    gap: 0.2rem;
    background: var(--bg-secondary);
    padding: 0.2rem;
    border-radius: var(--radius-md);
}

.map-toggle-btn {
    padding: 0.3rem 0.65rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.map-toggle-btn:hover {
    color: var(--text-secondary);
}

.map-toggle-btn.active {
    background: var(--bg-panel);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Compare Button */
.map-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-panel);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.map-compare-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.map-compare-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Leaflet Map Container */
.leaflet-map-wrapper {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.leaflet-map-wrapper.hidden,
.leaflet-map-comparison.hidden {
    display: none;
}

.leaflet-map-container {
    width: 100%;
    height: 480px;
    background: var(--bg-tertiary);
    z-index: 1;
}

/* Comparison Side-by-Side */
.leaflet-map-comparison {
    display: flex;
    gap: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.leaflet-map-comparison-panel {
    flex: 1;
    min-width: 0;
    position: relative;
}

.comparison-panel-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--bg-panel);
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    pointer-events: none;
}

.leaflet-map-comparison-divider {
    width: 3px;
    background: var(--accent);
    flex-shrink: 0;
}

.leaflet-map-comparison .leaflet-map-container {
    height: 480px;
}

/* Leaflet Map Legend */
.leaflet-map-legend {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.legend-title {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.75rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.legend-item:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-name {
    white-space: nowrap;
}

/* Leaflet Popup Custom Styles */
.bible-map-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.bible-map-popup .leaflet-popup-tip {
    box-shadow: none;
}

.route-tooltip {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-secondary) !important;
    font-family: var(--font-sans) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    padding: 0.25rem 0.5rem !important;
    box-shadow: var(--shadow-sm) !important;
}

.route-tooltip::before {
    border-top-color: var(--border) !important;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--accent);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.back-btn:hover {
    background: var(--bg-hover);
}

/* --- Timeline --- */
.timeline-container {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-era {
    margin-bottom: 2rem;
}

.timeline-era-header {
    position: relative;
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin-bottom: 0.75rem;
}

.timeline-era-header::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-panel);
}

.timeline-era-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-era-period {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.timeline-event {
    position: relative;
    padding: 0.75rem 1rem;
    margin-left: 1.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition);
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-light);
}

.timeline-event:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.timeline-event-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.timeline-event-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.timeline-event-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
    line-height: 1.5;
}

.timeline-event-ref {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
    margin-top: 0.35rem;
}

/* --- Quiz --- */
.quiz-container {
    padding: 2rem;
    max-width: 700px;
    margin: 0 auto;
    overflow-y: auto;
    height: 100%;
}

.quiz-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.quiz-category-card {
    padding: 1.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.quiz-category-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quiz-category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.quiz-category-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.quiz-category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.quiz-active.hidden {
    display: none;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.quiz-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition);
}

.quiz-question {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quiz-option {
    padding: 0.85rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-align: left;
    color: var(--text-secondary);
}

.quiz-option:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.quiz-option.correct {
    border-color: #4a8c3f;
    background: rgba(74, 140, 63, 0.08);
    color: #3a7030;
}

.quiz-option.incorrect {
    border-color: #c04040;
    background: rgba(192, 64, 64, 0.08);
    color: #a03030;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.quiz-feedback {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.quiz-feedback.hidden {
    display: none;
}

.quiz-feedback.correct {
    background: rgba(74, 140, 63, 0.08);
    border: 1px solid rgba(74, 140, 63, 0.2);
    color: var(--text-secondary);
}

.quiz-feedback.incorrect {
    background: rgba(192, 64, 64, 0.08);
    border: 1px solid rgba(192, 64, 64, 0.2);
    color: var(--text-secondary);
}

.quiz-feedback strong {
    color: var(--text-primary);
}

.quiz-results {
    text-align: center;
    padding: 2rem 0;
}

.quiz-results.hidden {
    display: none;
}

.quiz-score {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.quiz-score-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

/* --- Mobile Bottom Nav --- */
.mobile-bottom-nav {
    display: none;
}

/* ============================================================
   PRO Translation Picker & Paywall
   ============================================================ */

/* --- Custom Translation Dropdown --- */
.translation-selector {
    position: relative;
}

.trans-select-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.trans-select-btn:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.trans-select-btn:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.trans-select-btn .pro-badge {
    margin-left: 0.15rem;
}

.trans-select-arrow {
    display: inline-flex;
    transition: transform var(--transition);
}

.trans-select-btn.open .trans-select-arrow {
    transform: rotate(180deg);
}

.trans-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 0.3rem;
    display: none;
}

.trans-dropdown.open {
    display: block;
}

.trans-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.3rem 0.5rem;
}

.trans-dropdown-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.35rem 0.6rem 0.2rem;
    user-select: none;
}

.trans-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.trans-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.trans-option.active {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

.trans-option-name {
    flex: 1;
}

/* --- PRO Badge --- */
.pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem 0.4rem;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
    flex-shrink: 0;
}

/* --- Paywall Overlay & Modal --- */
.paywall-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.paywall-overlay.open {
    display: flex;
}

.paywall-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 90%;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.paywall-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: all var(--transition);
}

.paywall-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.paywall-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.paywall-subtitle {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.paywall-features {
    list-style: none;
    margin-bottom: 1.25rem;
}

.paywall-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.3rem 0;
    line-height: 1.5;
}

.paywall-features li::before {
    content: '\2713';
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.paywall-plan {
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.paywall-plan-price {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.paywall-plan-period {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.paywall-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.paywall-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition);
}

.paywall-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
    background: var(--bg-panel);
}

.paywall-input::placeholder {
    color: var(--text-muted);
}

.paywall-submit {
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.paywall-submit:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

.paywall-login-link {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.paywall-login-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.paywall-login-link a:hover {
    text-decoration: underline;
}

.paywall-error {
    color: #c04040;
    font-size: 0.8rem;
    text-align: center;
    display: none;
}

.paywall-error.visible {
    display: block;
}

/* --- Locked Verse Blocks (Freemium Preview) --- */
.verse-block.locked {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.verse-block.locked .verse-text {
    filter: blur(4px);
    pointer-events: none;
}

.verse-lock-indicator {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.verse-lock-indicator svg {
    width: 14px;
    height: 14px;
}

/* --- Inline Paywall Banner --- */
.verse-paywall-banner {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border: 2px solid var(--accent-light);
    border-radius: var(--radius-lg);
    background: var(--accent-bg);
    text-align: center;
}

.verse-paywall-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    margin-bottom: 0.75rem;
}

.verse-paywall-banner-icon svg {
    width: 20px;
    height: 20px;
}

.verse-paywall-banner-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.verse-paywall-banner-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    justify-content: center;
}

.verse-paywall-banner-features li {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.verse-paywall-banner-features li::before {
    content: '\2713 ';
    color: var(--accent);
    font-weight: 700;
}

.verse-paywall-banner-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.verse-paywall-banner-btn:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-md);
}

/* --- Locked More Teaser --- */
.verse-locked-more {
    padding: 0.75rem 2.5rem;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Locked Comparison Cards --- */
.comparison-trans-card.locked {
    position: relative;
    user-select: none;
    cursor: pointer;
}

.comparison-trans-card.locked .comparison-trans-text {
    filter: blur(4px);
    pointer-events: none;
}

.comparison-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    z-index: 1;
}

[data-theme="dark"] .comparison-lock-overlay {
    background: rgba(0, 0, 0, 0.15);
}

.comparison-lock-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
    opacity: 0.8;
}

.comparison-lock-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
