@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Crimson+Pro:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: #f5f0e6;
    font-family: 'Crimson Pro', Georgia, serif;
    margin: 0;
    padding: 0;
}

/* Gematria Bible App Layout */
.gematria-app {
    min-height: 100vh;
    font-family: 'Crimson Pro', Georgia, serif;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toc-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid;
    padding: 8px 14px;
    font-family: 'Crimson Pro', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.toc-btn:hover { opacity: 0.8; }

.current-location { display: flex; flex-direction: column; }
.location-book { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 500; }
.location-original { font-size: 0.85rem; }

.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-mark { width: 36px; height: 36px; }
.logo-icon { width: 100%; height: 100%; }

.logo-text { display: flex; flex-direction: column; align-items: center; }
.logo-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 500; }
.logo-subtitle { font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; }

.header-right { display: flex; align-items: center; gap: 12px; }

.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.mode-toggle:hover { opacity: 0.8; }

/* Chapter Navigation Bar */
.chapter-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid;
}

.chapter-arrow {
    background: transparent;
    border: 1px solid;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    border-radius: 4px;
}

.chapter-arrow:disabled { cursor: not-allowed; opacity: 0.5; }

.chapter-selector-wrapper { position: relative; }

.chapter-current {
    background: transparent;
    border: 1px solid;
    padding: 8px 16px;
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
}

.chapter-dropdown-arrow { font-size: 0.7rem; }

.chapter-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    border: 1px solid;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    border-radius: 4px;
}

.chapter-option {
    background: transparent;
    border: none;
    padding: 6px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 2px;
}

.chapter-option:hover { opacity: 0.7; }
.chapter-count { font-size: 0.85rem; margin-left: 8px; }

/* Main Content */
.main-content {
    padding: 24px;
    padding-bottom: 80px; /* Space for fixed filter bar */
    max-width: 1200px;
    margin: 0 auto;
}

.verses-container {
    border: 1px solid;
    padding: 24px;
    border-radius: 4px;
}

.verse-block {
    padding: 20px 0;
    border-bottom: 1px solid;
    display: flex;
    gap: 20px;
}

.verse-block:last-child { border-bottom: none; }

.verse-separator {
    position: relative;
    margin: 16px 0 8px 0;
}

.verse-num {
    user-select: none;
}

.verse-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 30px;
    padding-top: 4px;
}

.verse-content { flex: 1; }

.words-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.words-container.rtl { direction: rtl; }
.words-container.ltr { direction: ltr; }

.word-card {
    padding: 12px 16px;
    min-width: 100px;
    text-align: center;
    direction: ltr;
    transition: all 0.2s;
    border-radius: 4px;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.word-card:hover {
    z-index: 100;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Tooltip - must be fully opaque */
.word-tooltip {
    position: absolute;
    z-index: 1000 !important;
    opacity: 1 !important;
    isolation: isolate;
}

.word-original { font-size: 1.5rem; margin-bottom: 4px; line-height: 1.3; }
.word-transliteration { font-style: italic; font-size: 0.75rem; margin-bottom: 3px; }
.word-translation { font-size: 0.85rem; margin-bottom: 6px; font-weight: 500; }
.word-strongs {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    margin-bottom: 8px;
    padding: 2px 5px;
    display: inline-block;
    border-radius: 2px;
}

.gematria-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid;
}

.gematria-value { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.gematria-label { font-family: 'JetBrains Mono', monospace; font-size: 0.5rem; text-transform: uppercase; }
.gematria-number { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; font-weight: 500; }

/* Clickable gematria values */
.gematria-clickable {
    transition: all 0.15s ease;
    padding: 2px 4px;
    border-radius: 4px;
    margin: -2px -4px;
}
.gematria-clickable:hover {
    background: rgba(139, 41, 66, 0.15);
    transform: scale(1.1);
}
.gematria-clickable:hover .gematria-number {
    text-decoration: underline;
}

/* Verse Footer */
.verse-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid;
    flex-wrap: wrap;
    gap: 12px;
}

.verse-english {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    flex: 1;
    min-width: 200px;
}

.verse-english-container {
    flex: 1;
    min-width: 200px;
}

.kjv-interlinear {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
}

.kjv-word {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.kjv-word-text {
    font-style: italic;
}

.kjv-word-strongs {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    opacity: 0.8;
    margin-top: 1px;
}

.verse-totals {
    display: flex;
    align-items: center;
    gap: 12px;
}

.verse-total-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.verse-total-values {
    display: flex;
    gap: 12px;
}

.verse-total-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verse-total-clickable {
    transition: all 0.15s ease;
    padding: 2px 6px;
    border-radius: 4px;
    margin: -2px -6px;
}

.verse-total-clickable:hover {
    background: rgba(139, 41, 66, 0.15);
    transform: scale(1.05);
    text-decoration: underline;
}

.total-type {
    font-size: 0.6rem;
    text-transform: uppercase;
}

/* Placeholder */
.placeholder {
    border: 1px solid;
    padding: 60px;
    text-align: center;
    border-radius: 4px;
}

.placeholder-icon { font-size: 3rem; margin-bottom: 16px; }
.placeholder-text { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; margin-bottom: 8px; }
.placeholder-subtext { font-size: 0.95rem; line-height: 1.6; }

/* Legend */
.legend {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 24px;
    border-top: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 100;
}

.legend-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.legend-items {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
}

.legend-item b {
    font-family: 'JetBrains Mono', monospace;
    margin-right: 4px;
}

/* TOC Overlay */
.toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.toc-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    overflow-y: auto;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid;
    position: sticky;
    top: 0;
}

.toc-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 500;
}

.toc-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

.toc-body { padding: 16px; }
.toc-section { margin-bottom: 24px; }

.toc-section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-language {
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.toc-books {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-book {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    text-align: left;
    cursor: pointer;
    font-family: 'Crimson Pro', serif;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.toc-book:hover { border-color: currentColor; opacity: 0.8; }
.toc-book.active { border-color: currentColor; }

.book-name { flex: 1; }
.book-original { font-size: 0.85rem; flex: 1; }
.book-chapters { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; }

/* Hebrew and Greek text styling */
@font-face {
    font-family: 'SBL Greek';
    src: url('/static/fonts/SBLGreek.ttf') format('truetype');
}

@font-face {
    font-family: 'SBL Hebrew';
    src: url('/static/fonts/SBLHebrew.ttf') format('truetype');
}

.greek-text {
    font-family: 'SBL Greek', 'Times New Roman', serif;
    font-size: 18px;
    text-align: center;
    margin-bottom: 5px;
}

.hebrew-text {
    font-family: 'SBL Hebrew', 'Times New Roman', serif;
    font-size: 18px;
    direction: rtl;
    text-align: center;
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .header-center {
        position: static;
        transform: none;
        order: -1;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }

    .current-location {
        display: none;
    }

    .guide-btn-label {
        display: none;
    }

    .chapter-nav-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }

    .chapter-dropdown {
        grid-template-columns: repeat(5, 1fr);
    }

    .main-content {
        padding: 12px;
    }

    .verses-container {
        padding: 12px;
    }

    .verse-block {
        flex-direction: column;
        gap: 12px;
    }

    .verse-num {
        min-width: auto;
    }

    .words-container {
        gap: 8px;
    }

    .word-card {
        padding: 8px 12px;
        min-width: 80px;
    }

    .verse-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .legend {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }

    .legend-title {
        font-size: 0.7rem;
    }

    .legend-items {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }

    .legend-items button {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }

    /* Hide the separator pipe on mobile */
    .legend-items > span {
        display: none;
    }

    .main-content {
        padding-bottom: 120px; /* More space on mobile for wrapped filter buttons */
    }

    .toc-panel {
        width: 100%;
        max-width: 100vw;
    }

    /* Navigation bar mobile adjustments */
    .nav-bar {
        gap: 8px !important;
        padding: 10px 12px !important;
    }

    .nav-separator {
        display: none;
    }

    /* Header bar mobile adjustments */
    .header-bar {
        padding: 10px 12px !important;
        gap: 10px;
    }

    .header-bar img {
        width: 48px !important;
    }

    .header-bar > div:first-child span {
        font-size: 1.1rem !important;
    }

    /* Book selector mobile adjustments */
    .book-selector-btn {
        padding: 6px 10px !important;
        gap: 6px !important;
    }

    .book-original-name {
        display: none;
    }

    /* Ensure dropdowns don't overflow screen */
    .chapter-dropdown {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
        max-width: calc(100vw - 24px);
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .header-bar img {
        width: 40px !important;
    }

    .header-bar > div:first-child span {
        font-size: 1rem !important;
    }

    .legend-items button {
        padding: 3px 6px !important;
        font-size: 0.7rem !important;
    }

    .word-card {
        padding: 6px 8px;
        min-width: 70px;
    }

    .word-original {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 8px;
        padding-bottom: 130px;
    }

    .verses-container {
        padding: 10px;
    }
}

/* Legacy styles for backwards compatibility */
.navbar {
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar-logo {
    height: 40px;
    margin-right: 10px;
}

.homepage-logo {
    height: 100px;
    margin-bottom: 20px;
}

.interlinear-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: block;
}

.verse-header {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.full-verse-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
}

.strongs-number {
    font-size: 10px;
    color: #666;
    text-align: center;
    display: block;
    margin-bottom: 2px;
}

.english-text {
    font-size: 14px;
    text-align: center;
    display: block;
}

.highlight {
    background-color: #d1ecf1;
}

/* Strong's word highlighting on hover */
.word-card.strongs-highlight {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.2);
}

.word-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    padding: 5px;
    margin: 5px;
}

.verse {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
}

.footer {
    position: relative;
    bottom: 0;
    width: 100%;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.footer a {
    text-decoration: none;
    color: #6c757d;
}

.footer a:hover {
    color: #343a40;
}

/* Coming Soon Homepage Styles */
.coming-soon-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Crimson Pro', Georgia, serif;
}

.coming-soon-header {
    padding: 12px 24px;
}

.coming-soon-header .header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.coming-soon-header .logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coming-soon-header .logo-mark {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.coming-soon-header .logo-icon {
    width: 100%;
    height: 100%;
}

.coming-soon-header .logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.coming-soon-header .logo-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 500;
}

.coming-soon-header .logo-subtitle {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.coming-soon-header .theme-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.coming-soon-header .theme-toggle:hover {
    opacity: 0.8;
}

.coming-soon-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.coming-soon-card {
    max-width: 520px;
    width: 100%;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

.large-logo {
    margin-bottom: 24px;
}

.large-logo-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: block;
}

.coming-soon-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.coming-soon-description {
    font-size: 1.05rem;
    line-height: 1.7;
}

.coming-soon-footer {
    padding: 24px;
    text-align: center;
}

/* Site footer - needs extra bottom padding to clear fixed legend bar */
.site-footer {
    padding-bottom: 80px !important;
}

@media (max-width: 600px) {
    .coming-soon-card {
        padding: 24px;
    }

    .large-logo-icon {
        width: 80px;
        height: 80px;
    }

    .coming-soon-title {
        font-size: 1.6rem;
    }
}

/* Number Database search input - hide spinners */
.number-search-input::-webkit-outer-spin-button,
.number-search-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
