/* =====================================================
   TAMIL BIBLE READER
   Professional UI
===================================================== */

:root {

    --primary: #8b5e34;
    --primary-dark: #6f4726;

    --bg: #f7f5f1;
    --surface: #ffffff;
    --surface-soft: #f1eee8;

    --text: #252525;
    --text-secondary: #777;

    --border: #e6e1d8;

    --shadow:
        0 8px 30px rgba(0, 0, 0, 0.06);

    --radius: 14px;

    --reader-size: 22px;
}


/* =====================================================
   RESET
===================================================== */

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

html {
    scroll-behavior: auto;
}

body {

    font-family:
        "Noto Sans Tamil",
        "Latha",
        "Nirmala UI",
        Arial,
        sans-serif;

    background: var(--bg);

    color: var(--text);

    min-height: 100vh;
}


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

.topbar {

    height: 72px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 28px;

    position: sticky;

    top: 0;

    z-index: 100;
}


.brand {

    display: flex;

    align-items: center;

    gap: 12px;
}


.brand-icon {

    width: 42px;

    height: 42px;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #a97843,
            #70451f
        );

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 23px;

    box-shadow:
        0 5px 15px rgba(112, 69, 31, 0.22);
}


.brand-title {

    font-size: 17px;

    font-weight: 700;
}


.brand-subtitle {

    font-size: 11px;

    color: var(--text-secondary);

    margin-top: 2px;
}


.header-actions {

    display: flex;

    gap: 7px;
}


.icon-btn {

    width: 40px;

    height: 40px;

    border: none;

    border-radius: 10px;

    background: transparent;

    cursor: pointer;

    font-size: 17px;

    transition: 0.2s;
}


.icon-btn:hover {

    background: var(--surface-soft);

    transform: translateY(-1px);
}


/* =====================================================
   SEARCH
===================================================== */

.search-panel {

    display: none;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    padding: 12px 28px;
}


.search-panel.show {
    display: block;
}


.search-box {

    max-width: 850px;

    margin: auto;

    display: flex;

    align-items: center;

    gap: 10px;

    background: var(--surface-soft);

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 0 14px;
}


.search-box input {

    flex: 1;

    height: 46px;

    border: none;

    outline: none;

    background: transparent;

    font-family: inherit;

    font-size: 15px;
}


.search-box button {

    border: none;

    background: transparent;

    cursor: pointer;

    font-size: 18px;
}


/* =====================================================
   MAIN LAYOUT
===================================================== */

.app-layout {

    display: flex;

    max-width: 1500px;

    margin: auto;

    min-height: calc(100vh - 72px);
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {

    width: 310px;

    background: var(--surface);

    border-right: 1px solid var(--border);

    flex-shrink: 0;

    height: calc(100vh - 72px);

    position: sticky;

    top: 72px;

    overflow-y: auto;
}


.sidebar-header {

    padding: 25px 22px 18px;

    display: flex;

    justify-content: space-between;
}


.sidebar-title {

    display: block;

    font-size: 20px;

    font-weight: 800;
}


.sidebar-count {

    display: block;

    margin-top: 3px;

    font-size: 12px;

    color: var(--text-secondary);
}


/* =====================================================
   TESTAMENT
===================================================== */

.testament-tabs {

    display: flex;

    margin: 0 16px 15px;

    background: var(--surface-soft);

    border-radius: 10px;

    padding: 4px;
}


.testament-tab {

    flex: 1;

    border: none;

    background: transparent;

    padding: 9px 4px;

    border-radius: 8px;

    cursor: pointer;

    font-family: inherit;

    font-size: 12px;

    color: var(--text-secondary);
}


.testament-tab.active {

    background: var(--surface);

    color: var(--primary);

    font-weight: 700;

    box-shadow:
        0 2px 7px rgba(0,0,0,0.07);
}


/* =====================================================
   BOOK LIST
===================================================== */

.books-container {

    padding: 0 10px 30px;
}


.book-item {

    width: 100%;

    border: none;

    background: transparent;

    padding: 11px 13px;

    border-radius: 9px;

    display: flex;

    align-items: center;

    gap: 10px;

    cursor: pointer;

    font-family: inherit;

    font-size: 14px;

    color: var(--text);

    text-align: left;

    transition: 0.15s;
}


.book-item:hover {

    background: var(--surface-soft);
}


.book-item.active {

    background:
        rgba(139, 94, 52, 0.10);

    color: var(--primary);

    font-weight: 700;
}


.book-number {

    width: 24px;

    color: #aaa;

    font-size: 11px;
}


/* =====================================================
   READER
===================================================== */

.reader {

    flex: 1;

    min-width: 0;

    padding: 35px 45px 80px;
}


.reader-header {

    max-width: 1100px;

    margin: 0 auto;

    position: sticky;

    top: 68px;

    z-index: 40;

    padding: 14px 0 12px;

    background: rgba(247, 245, 241, 0.96);

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);

    border-bottom: 1px solid var(--border);
}


.breadcrumb {

    display: flex;

    gap: 8px;

    color: var(--text-secondary);

    font-size: 12px;

    margin-bottom: 13px;
}


.title-row {

    display: flex;

    align-items: center;

    justify-content: space-between;
}


#bookTitle {
    font-family:
        "Noto Serif Tamil",
        "Nirmala UI",
        serif;

    font-size: 27px;
    line-height: 1.25;

    font-weight: 800;

    color: var(--text);

    letter-spacing: -0.01em;
}

#chapterTitle {
    margin-top: 4px;

    font-size: 13px;

    font-weight: 600;

    color: var(--primary);
}


#chapterTitle {

    color: var(--text-secondary);

    margin-top: 3px;

    font-size: 14px;
}


.reader-tools {

    display: flex;

    gap: 6px;
}


.tool-btn {

    height: 36px;

    min-width: 42px;

    padding: 0 10px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: var(--surface);

    cursor: pointer;

    font-weight: 600;

    color: var(--text);
}


.tool-btn:hover {

    border-color: var(--primary);

    color: var(--primary);
}


/* =====================================================
   CHAPTER SELECTOR
===================================================== */

.chapter-selector {

    max-width: 900px;

    margin: 30px auto 20px;

    display: flex;

    align-items: center;

    gap: 7px;
}


.chapter-scroll {

    flex: 1;

    display: flex;

    gap: 7px;

    overflow-x: auto;

    scrollbar-width: thin;

    padding: 2px;
}


.chapter-scroll::-webkit-scrollbar {
    height: 4px;
}


.chapter-button {

    flex-shrink: 0;

    min-width: 43px;

    height: 40px;

    border: 1px solid var(--border);

    background: var(--surface);

    border-radius: 9px;

    cursor: pointer;

    font-weight: 600;
}


.chapter-button:hover {

    border-color: var(--primary);

    color: var(--primary);
}


.chapter-button.active {

    background: var(--primary);

    color: white;

    border-color: var(--primary);
}


.chapter-arrow {

    width: 38px;

    height: 38px;

    border: 1px solid var(--border);

    background: var(--surface);

    border-radius: 9px;

    cursor: pointer;

    font-size: 21px;
}


/* =====================================================
   BIBLE CONTENT
===================================================== */

.bible-content {
    max-width: 920px;

    margin:
        10px auto
        0;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        16px;

    padding:
        38px 48px
        44px;

    box-shadow:
        0 4px 20px
        rgba(0, 0, 0, 0.045);
}


.verse {

    display: block;

    padding: 10px 12px;

    margin: 2px 0;

    border-radius: 8px;

    cursor: pointer;

    transition: 0.15s;
}


.verse:hover {

    background:
        rgba(139, 94, 52, 0.055);
}


.verse-number {
    color:
        var(--primary);

    font-family:
        Georgia,
        serif;

    font-size:
        12px;

    font-weight:
        700;

    margin-right:
        10px;

    vertical-align:
        top;

    opacity:
        0.85;
}


.verse-text {
    font-family:
        "Noto Serif Tamil",
        "Nirmala UI",
        serif;

    font-size:
        var(--reader-size);

    line-height:
        2.05;

    letter-spacing:
        0.005em;
}


.verse.selected {

    background:
        rgba(217, 170, 70, 0.17);
}


.verse.bookmarked {

    border-left: 3px solid var(--primary);

    background:
        rgba(139, 94, 52, 0.07);
}


/* =====================================================
   NAVIGATION
===================================================== */

.chapter-navigation {

    max-width: 900px;

    margin: 25px auto;

    display: flex;

    justify-content: space-between;

    gap: 15px;
}


.nav-button {

    min-width: 190px;

    border: 1px solid var(--border);

    background: var(--surface);

    border-radius: 12px;

    padding: 12px 16px;

    cursor: pointer;

    display: flex;

    align-items: center;

    gap: 12px;

    text-align: left;

    font-family: inherit;
}


.nav-button.next {

    text-align: right;

    justify-content: flex-end;
}


.nav-button:hover {

    border-color: var(--primary);

    color: var(--primary);
}


.nav-button span {

    font-size: 22px;
}


.nav-button small {

    display: block;

    color: var(--text-secondary);

    font-size: 11px;

    margin-bottom: 2px;
}


/* =====================================================
   VERSE MENU
===================================================== */

.verse-menu {

    display: none;

    position: fixed;

    z-index: 500;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 11px;

    box-shadow:
        0 12px 35px rgba(0,0,0,0.15);

    overflow: hidden;
}


.verse-menu.show {

    display: flex;
}


.verse-menu button {

    border: none;

    background: transparent;

    padding: 12px 15px;

    cursor: pointer;

    font-family: inherit;

    font-size: 13px;
}


.verse-menu button:hover {

    background: var(--surface-soft);
}


/* =====================================================
   TOAST
===================================================== */

.toast {

    position: fixed;

    bottom: 25px;

    left: 50%;

    transform: translateX(-50%)
               translateY(20px);

    background: #222;

    color: white;

    padding: 11px 18px;

    border-radius: 9px;

    font-size: 13px;

    opacity: 0;

    pointer-events: none;

    transition: 0.25s;

    z-index: 999;
}


.toast.show {

    opacity: 1;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =====================================================
   LOADING
===================================================== */

.loading {

    min-height: 250px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 15px;

    color: var(--text-secondary);
}


.loader {

    width: 30px;

    height: 30px;

    border: 3px solid var(--border);

    border-top-color: var(--primary);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }
}


/* =====================================================
   MOBILE MENU
===================================================== */

.mobile-menu {

    display: none;

    border: none;

    background: var(--surface);

    font-size: 22px;

    cursor: pointer;
}


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

body.dark {

    --bg: #121212;

    --surface: #1c1c1c;

    --surface-soft: #262626;

    --text: #eeeeee;

    --text-secondary: #999999;

    --border: #333333;

    --shadow:
        0 8px 30px rgba(0,0,0,0.25);
}


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

@media (max-width: 900px) {

    .sidebar {

        position: fixed;

        left: -320px;

        top: 72px;

        z-index: 200;

        transition: 0.25s;

        box-shadow:
            10px 0 30px rgba(0,0,0,0.12);
    }


    .sidebar.open {
        left: 0;
    }


    .reader {

        padding:
            25px 18px 60px;
    }


    .mobile-menu {

        display: block;

        margin-bottom: 18px;
    }


    .bible-content {

        padding:
            30px 20px;
    }


    #bookTitle {

        font-size: 28px;
    }
}


@media (max-width: 600px) {

    .topbar {

        height: 62px;

        padding: 0 15px;
    }


    .brand-icon {

        width: 36px;

        height: 36px;

        font-size: 19px;
    }


    .brand-title {

        font-size: 14px;
    }


    .brand-subtitle {

        font-size: 9px;
    }


    .header-actions {

        gap: 2px;
    }


    .icon-btn {

        width: 34px;

        height: 34px;
    }


    .reader {

        padding:
            20px 12px 50px;
    }


    .title-row {

        align-items: flex-start;
    }


    #bookTitle {

        font-size: 25px;
    }


    .reader-tools {

        gap: 3px;
    }


    .tool-btn {

        min-width: 35px;

        padding: 0 7px;
    }


    .bible-content {

        border-radius: 12px;

        padding: 22px 12px;

        box-shadow: none;
    }


    .verse {

        padding: 8px 5px;
    }


    .verse-text {

        font-size: 19px;

        line-height: 2;
    }


    .chapter-navigation {

        gap: 8px;
    }


    .nav-button {

        min-width: 0;

        flex: 1;

        padding: 10px;
    }
}

/* =====================================================
   LANGUAGE SELECTOR
===================================================== */

.language-select {

    height: 38px;

    min-width: 105px;

    padding: 0 10px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);

    color: var(--text);

    font-family: inherit;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    outline: none;
}


.language-select:hover {

    border-color: var(--primary);

}


.language-select:focus {

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(139, 94, 52, 0.10);
}


body.dark .language-select {

    background: var(--surface);

    color: var(--text);

    border-color: var(--border);
}


@media (max-width: 600px) {

    .language-select {

        min-width: 80px;

        max-width: 90px;

        font-size: 11px;

        padding: 0 5px;
    }
}

/* =====================================================
   COMMON SITE FOOTER
===================================================== */

.site-footer {
    width: 100%;
    margin-top: 30px;

    background: var(--surface);
    border-top: 1px solid var(--border);
}


/* =====================================================
   FOOTER INNER
===================================================== */

.site-footer-inner {
    width: min(1500px, calc(100% - 48px));

    margin: 0 auto;
    padding: 28px 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;
}


/* =====================================================
   FOOTER BRAND
===================================================== */

.site-footer-brand {
    flex-shrink: 0;
}

.site-footer-logo {
    display: flex;
    align-items: center;

    gap: 10px;
}


.site-footer-logo-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #a97843,
            #70451f
        );

    color: #ffffff;

    font-size: 18px;

    box-shadow:
        0 4px 12px
        rgba(112, 69, 31, 0.18);
}


.site-footer-title {
    color: var(--text);

    font-size: 15px;
    font-weight: 800;

    line-height: 1.3;
}


.site-footer-subtitle {
    margin-top: 3px;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 500;

    line-height: 1.4;
}


/* =====================================================
   FOOTER NAVIGATION
===================================================== */

.site-footer-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 5px;

    flex-wrap: wrap;
}


.site-footer-navigation a {
    display: inline-flex;
    align-items: center;

    padding: 7px 10px;

    border-radius: 8px;

    color: var(--text-secondary);

    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    white-space: nowrap;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}


.site-footer-navigation a:hover {
    background: var(--surface-soft);

    color: var(--primary);

    transform: translateY(-1px);
}


.site-footer-navigation a:last-child {
    color: var(--primary);

    font-weight: 700;
}


/* =====================================================
   FOOTER BOTTOM
===================================================== */

.site-footer-bottom {
    width: min(1500px, calc(100% - 48px));

    margin: 0 auto;

    padding: 13px 0 17px;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    color: var(--text-secondary);

    font-size: 11px;
    font-weight: 500;

    text-align: center;
}


.site-footer-divider {
    opacity: 0.45;
}


/* =====================================================
   FOOTER MOBILE
===================================================== */

@media (max-width: 800px) {

    .site-footer-inner {
        width: min(100% - 30px, 600px);

        flex-direction: column;

        align-items: center;
        justify-content: center;

        gap: 18px;

        padding: 26px 0 22px;

        text-align: center;
    }


    .site-footer-logo {
        justify-content: center;
    }


    .site-footer-navigation {
        justify-content: center;
    }

}


@media (max-width: 520px) {

    .site-footer-inner {
        width: calc(100% - 24px);

        padding: 23px 0 19px;

        gap: 16px;
    }


    .site-footer-logo-icon {
        width: 36px;
        height: 36px;

        font-size: 17px;
    }


    .site-footer-title {
        font-size: 14px;
    }


    .site-footer-subtitle {
        font-size: 10px;
    }


    .site-footer-navigation {
        gap: 3px;
    }


    .site-footer-navigation a {
        padding: 6px 8px;

        font-size: 11px;
    }


    .site-footer-bottom {
        width: calc(100% - 24px);

        padding: 12px 0 15px;

        font-size: 10px;
    }

}

/* =====================================================
   BOOKMARK PANEL
===================================================== */

.bookmark-overlay {

    position: fixed;

    inset: 0;

    background: rgba(
        0,
        0,
        0,
        0.18
    );

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.2s ease;

    z-index: 999;
}


.bookmark-overlay.show {

    opacity: 1;

    visibility: visible;
}


/* =====================================================
   PANEL
===================================================== */

.bookmark-panel {

    position: fixed;

    top: 0;

    right: 0;

    width: 390px;

    max-width: 92vw;

    height: 100vh;

    background: var(--surface);

    border-left:
        1px solid var(--border);

    box-shadow:
        -10px 0 30px
        rgba(0, 0, 0, 0.12);

    transform:
        translateX(100%);

    transition:
        transform 0.25s ease;

    z-index: 1000;

    display: flex;

    flex-direction: column;
}


.bookmark-panel.open {

    transform:
        translateX(0);
}


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

.bookmark-panel-header {

    min-height: 72px;

    padding: 18px 20px;

    border-bottom:
        1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.bookmark-panel-header h2 {

    margin: 0;

    font-size: 20px;

    font-weight: 700;
}


.bookmark-panel-header span {

    display: inline-flex;

    margin-top: 4px;

    font-size: 12px;

    color: var(--text-secondary);
}


.bookmark-close {

    width: 36px;

    height: 36px;

    border: 0;

    border-radius: 10px;

    background: transparent;

    color: var(--text-primary);

    font-size: 25px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;
}


.bookmark-close:hover {

    background:
        var(--surface-secondary);
}


/* =====================================================
   LIST
===================================================== */

.bookmark-list {

    flex: 1;

    overflow-y: auto;

    padding: 14px;
}


/* =====================================================
   BOOKMARK ITEM
===================================================== */

.bookmark-item {

    width: 100%;

    border: 1px solid
        var(--border);

    border-radius: 12px;

    background:
        var(--surface);

    padding: 14px;

    margin-bottom: 10px;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}


.bookmark-item:hover {

    background:
        var(--surface-secondary);

    border-color:
        var(--primary);

    transform:
        translateY(-1px);
}


/* =====================================================
   REFERENCE
===================================================== */

.bookmark-item-top {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 8px;
}


.bookmark-reference {

    color:
        var(--primary);

    font-size: 13px;

    font-weight: 700;
}


.bookmark-remove {

    width: 26px;

    height: 26px;

    border-radius: 7px;

    display: flex;

    align-items: center;

    justify-content: center;

    color:
        var(--text-secondary);

    font-size: 18px;

    flex-shrink: 0;
}


.bookmark-remove:hover {

    background:
        var(--surface-secondary);

    color:
        var(--primary);
}


/* =====================================================
   VERSE TEXT
===================================================== */

.bookmark-item-text {

    color:
        var(--text-primary);

    font-size: 14px;

    line-height: 1.65;

    display:
        -webkit-box;

    -webkit-line-clamp: 3;
    
    line-clamp: 3;

    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =====================================================
   EMPTY STATE
===================================================== */

.bookmark-empty {

    min-height: 300px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding: 30px;
}


.bookmark-empty-icon {

    font-size: 38px;

    margin-bottom: 12px;
}


.bookmark-empty h3 {

    margin: 0 0 6px;

    font-size: 17px;
}


.bookmark-empty p {

    margin: 0;

    color:
        var(--text-secondary);

    font-size: 13px;

    line-height: 1.6;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {

    .bookmark-panel {

        width: 100%;

        max-width: 100%;
    }

}

/* =====================================================
   CONTINUE READING
===================================================== */

.continue-reading {
    display: flex;
    align-items: center;
    gap: 14px;

    margin: 18px 0;
    padding: 14px 16px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.continue-reading[hidden] {
    display: none;
}

.continue-reading:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.07);
}


/* Icon */

.continue-reading-icon {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 12px;

    background: var(--surface-secondary);

    font-size: 22px;
}


/* Text */

.continue-reading-info {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;
    gap: 2px;
}

.continue-reading-label {
    font-size: 12px;
    font-weight: 600;

    color: var(--text-secondary);
}

.continue-reading-info strong {
    font-size: 16px;
    font-weight: 700;

    color: var(--text-primary);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.continue-reading-info span:last-child {
    font-size: 13px;
    color: var(--text-secondary);
}


/* Continue Button */

.continue-reading-btn {
    flex-shrink: 0;

    border: none;
    border-radius: 10px;

    padding: 9px 14px;

    background: var(--primary);
    color: white;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.continue-reading-btn:hover {
    opacity: 0.9;
    transform: translateX(2px);
}

.continue-reading-btn:active {
    transform: translateX(0);
}


/* =====================================================
   CONTINUE READING - MOBILE
===================================================== */

@media (max-width: 600px) {

    .continue-reading {
        gap: 10px;

        margin: 14px 0;
        padding: 12px;
    }

    .continue-reading-icon {
        width: 40px;
        height: 40px;

        border-radius: 10px;

        font-size: 20px;
    }

    .continue-reading-info strong {
        font-size: 15px;
    }

    .continue-reading-btn {
        padding: 8px 10px;

        font-size: 12px;
    }
}

/* =====================================================
   FINAL PROFESSIONAL UI POLISH
===================================================== */

:root {
    --text-primary: var(--text);
    --surface-secondary: var(--surface-soft);
}


/* =====================================================
   READER AREA
===================================================== */

.reader {
    padding: 32px 40px 70px;
}

.reader-header,
.chapter-selector,
.bible-content,
.chapter-navigation {
    max-width: 1100px;
}


/* =====================================================
   BREADCRUMB
===================================================== */

.breadcrumb {
    display: flex;
    gap: 7px;

    margin-bottom: 5px;

    font-size: 11px;

    color: var(--text-secondary);

    opacity: 0.75;
}


/* =====================================================
   BOOK / CHAPTER TITLE
===================================================== */

#bookTitle {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#chapterTitle {
    margin-top: 5px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}


/* =====================================================
   TITLE DIVIDER
===================================================== */

.title-row {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}


/* =====================================================
   CHAPTER SELECTOR
===================================================== */

.chapter-selector {
    max-width: 920px;

    margin:
        16px auto
        14px;

    display: flex;
    align-items: center;

    gap: 7px;
}

.chapter-scroll {
    display: flex;
    gap: 6px;

    overflow-x: auto;

    padding:
        3px 2px;

    scrollbar-width: none;
}

.chapter-scroll::-webkit-scrollbar {
    display: none;
}

.chapter-button {
    flex-shrink: 0;

    min-width: 40px;
    height: 36px;

    border:
        1px solid var(--border);

    border-radius: 9px;

    background:
        var(--surface);

    color:
        var(--text);

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        all 0.18s ease;
}

.chapter-button:hover {
    border-color: var(--primary);

    color: var(--primary);

    transform:
        translateY(-1px);
}

.chapter-button.active {
    background:
        var(--primary);

    color:
        #fff;

    border-color:
        var(--primary);

    box-shadow:
        0 4px 10px
        rgba(139, 94, 52, 0.20);
}

/* =====================================================
   BIBLE READER CARD
===================================================== */

.bible-content {
    margin-top: 16px;

    padding:
        38px 48px
        42px;

    border-radius: 16px;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.045);

    background: var(--surface);
}


/* =====================================================
   VERSE
===================================================== */

.verse {
    padding: 9px 12px;
    margin: 1px 0;

    border-radius: 8px;

    transition:
        background 0.15s ease,
        transform 0.15s ease;
}

.verse:hover {
    background:
        rgba(139, 94, 52, 0.045);
}

.verse-number {
    min-width: 22px;

    display: inline-block;

    font-size: 13px;
    font-weight: 700;

    color: var(--primary);

    opacity: 0.9;
}

.verse-text {
    font-size: var(--reader-size);
    line-height: 2.05;
    letter-spacing: 0.005em;
}


/* =====================================================
   SELECTED VERSE
===================================================== */

.verse.selected {
    background:
        rgba(217, 170, 70, 0.13);

    box-shadow:
        inset 3px 0 0 var(--primary);
}


/* =====================================================
   BOOKMARKED VERSE
===================================================== */

.verse.bookmarked {
    border-left: 3px solid var(--primary);

    background:
        rgba(139, 94, 52, 0.055);
}


/* =====================================================
   NAVIGATION
===================================================== */

.chapter-navigation {
    margin-top: 22px;
}

.nav-button {
    min-width: 210px;

    padding: 13px 17px;

    border-radius: 11px;

    background: var(--surface);

    transition:
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.nav-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.06);
}


/* =====================================================
   SIDEBAR POLISH
===================================================== */

.sidebar {
    width: 280px;
}

.sidebar-header {
    padding:
        22px 20px
        16px;
}

.sidebar-title {
    font-size: 19px;
}

.books-container {
    padding:
        0 9px
        25px;
}

.book-item {
    padding: 10px 12px;
    font-size: 13.5px;
}

.book-item.active {
    box-shadow:
        inset 3px 0 0 var(--primary);
}


/* =====================================================
   TESTAMENT TABS
===================================================== */

.testament-tabs {
    margin:
        0 14px
        14px;
}

.testament-tab {
    padding: 8px 4px;
}


/* =====================================================
   CONTINUE READING
===================================================== */

.continue-reading {
    margin:
        14px auto
        20px;

    max-width: 920px;

    padding:
        12px 14px;

    border-radius: 12px;

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.035);
}

.continue-reading-icon {
    width: 42px;
    height: 42px;

    border-radius: 10px;

    background:
        rgba(139, 94, 52, 0.09);
}

.continue-reading-info strong {
    font-size: 15px;
}

.continue-reading-btn {
    padding:
        8px 13px;

    border-radius: 8px;
}


/* =====================================================
   HEADER POLISH
===================================================== */

.topbar {
    height: 68px;

    padding:
        0 24px;

    box-shadow:
        0 1px 0 rgba(0, 0, 0, 0.02);
}

.brand-icon {
    width: 40px;
    height: 40px;

    border-radius: 11px;
}

.brand-title {
    font-size: 16px;
}


/* =====================================================
   LANGUAGE SELECT
===================================================== */

.language-select {
    height: 36px;
    min-width: 100px;

    border-radius: 9px;
}


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

body.dark {
    --text-primary: var(--text);
    --surface-secondary: var(--surface-soft);
}


/* =====================================================
   DESKTOP LARGE SCREEN
===================================================== */

@media (min-width: 1400px) {

    .reader {
        padding-left: 55px;
        padding-right: 55px;
    }

    .bible-content {
        padding:
            42px 55px
            46px;
    }
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 900px) {

    .reader {
      padding: 30px 35px 70px;
    }

    .bible-content {
      padding: 40px 55px 45px;
    }

    .chapter-navigation {
        margin-top: 20px;
    }
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {

    .reader {
        padding:
            18px 10px
            45px;
    }

    .reader-header {
       top: 62px;
       padding: 12px 0 10px;
    }

    #bookTitle {
        font-size: 25px;
    }

    #chapterTitle {
        font-size: 13px;
    }

    .title-row {
        padding-bottom: 14px;
    }

    .chapter-selector {
        margin:
            16px 0
            12px;
    }

    .bible-content {
        margin-top: 10px;

        padding:
            20px 10px;

        border-radius: 12px;

        box-shadow: none;
    }

    .verse {
        padding:
            7px 5px;
    }

    .verse-text {
        font-size: 19px;
        line-height: 2;
    }

    .chapter-navigation {
        gap: 8px;
    }

    .nav-button {
        min-width: 0;
        padding: 10px;
    }

    .continue-reading {
        margin:
            12px 0
            15px;

        padding: 11px;
    }
}

/* =====================================================
   MAIN SITE NAVIGATION
===================================================== */

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 18px;
}

.main-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 8px 10px;

    border-radius: 8px;

    color: var(--text-secondary);
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.main-navigation a:hover {
    background: var(--surface-soft);
    color: var(--primary);
    transform: translateY(-1px);
}

.main-navigation a.active {
    background: rgba(139, 94, 52, 0.09);
    color: var(--primary);
    font-weight: 700;
}

/* =====================================================
   CHURCH BIBLE DISPLAY - SPECIAL NAVIGATION
===================================================== */

.main-navigation a.church-display-nav {
    background: linear-gradient(
        135deg,
        #8b5e34,
        #6f4726
    );

    color: #ffffff;

    font-weight: 700;

    padding:
        8px 12px;

    box-shadow:
        0 3px 10px
        rgba(111, 71, 38, 0.18);
}

.main-navigation a.church-display-nav:hover {
    background: linear-gradient(
        135deg,
        #9a693c,
        #7a512b
    );

    color: #ffffff;

    transform:
        translateY(-1px);

    box-shadow:
        0 5px 14px
        rgba(111, 71, 38, 0.24);
}



/* =====================================================
   FOOTER NAVIGATION
===================================================== */

.footer-navigation {
    max-width: 1500px;

    margin: 18px auto 0;

    padding-top: 16px;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    flex-wrap: wrap;
}

.footer-navigation a {
    color: var(--text-secondary);

    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    padding: 5px 8px;

    border-radius: 7px;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.footer-navigation a:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.footer-navigation a:last-child {
    color: #8b5e34;
    font-weight: 700;
}


/* =====================================================
   NAVIGATION - TABLET
===================================================== */

@media (max-width: 1100px) {

    .main-navigation {
        gap: 2px;
        margin-right: 10px;
    }

    .main-navigation a {
        padding: 7px 7px;
        font-size: 12px;
    }

    .main-navigation a.church-display-nav {
        padding: 7px 9px;
    }

}


/* =====================================================
   NAVIGATION - MOBILE
===================================================== */

@media (max-width: 900px) {

    .main-navigation {
        display: none;
    }

}

/* =====================================================
   STICKY FOOTER LAYOUT
===================================================== */

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-layout {
    flex: 1;
}

.site-footer {
    margin-top: auto;
}

/* =====================================================
   FINAL MOBILE HEADER / NAVIGATION POLISH
===================================================== */

@media (max-width: 900px) {

    .topbar {
        height: 64px;
        padding: 0 10px;
        gap: 7px;
        overflow: hidden;
    }

    .mobile-menu {
        display: flex;
        width: 36px;
        height: 36px;
        min-width: 36px;
        flex: 0 0 36px;
        border: 1px solid var(--border);
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        background: var(--surface);
        color: var(--text);
        padding: 0;
        margin: 0;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        gap: 7px;
        overflow: hidden;
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 9px;
        font-size: 18px;
    }

    .brand-text {
        min-width: 0;
        overflow: hidden;
    }

    .brand-title {
        font-size: 14px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-subtitle {
        font-size: 8px;
        margin-top: 2px;
        white-space: nowrap;
    }

    .header-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        flex: 0 0 auto;
    }

    .header-actions .icon-btn {
        width: 32px;
        height: 34px;
        min-width: 32px;
        padding: 0;
        font-size: 16px;
        border-radius: 8px;
    }

    .language-select {
        width: 62px;
        min-width: 62px;
        max-width: 62px;
        height: 34px;
        padding: 0 3px;
        font-size: 10px;
        border-radius: 8px;
    }

    .main-navigation {
        display: none;
    }

    .books-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 36px;
        padding: 0 13px;
        margin: 10px 0 2px;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface);
        color: var(--text);
        font-family: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }

    .books-toggle:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .reader {
        padding-top: 8px;
    }

    .reader-header {
        top: 64px;
        padding-top: 10px;
    }

    .title-row {
        align-items: flex-start;
    }

    .reader-tools {
        display: flex;
        gap: 4px;
        margin-top: 4px;
        flex-shrink: 0;
    }

    .tool-btn {
        min-width: 40px;
        height: 34px;
        padding: 0 8px;
        font-size: 13px;
    }

    /* The old Bible sidebar remains the Books drawer. */
    .sidebar {
        top: 64px;
        height: calc(100vh - 64px);
    }

    /* Mobile website navigation drawer */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.28);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 900;
        transition: .2s ease;
    }

    .mobile-nav-overlay.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-nav-panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: min(82vw, 310px);
        height: 100vh;
        background: var(--surface);
        z-index: 901;
        box-shadow: 12px 0 35px rgba(0,0,0,.16);
        transform: translateX(-105%);
        transition: transform .22s ease;
        padding: 14px;
        gap: 5px;
    }

    .mobile-nav-panel.open {
        transform: translateX(0);
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 4px 14px;
        margin-bottom: 5px;
        border-bottom: 1px solid var(--border);
        color: var(--text);
    }

    .mobile-nav-header button {
        width: 34px;
        height: 34px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        color: var(--text);
        font-size: 22px;
        cursor: pointer;
    }

    .mobile-nav-panel a {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 46px;
        padding: 0 12px;
        border-radius: 9px;
        color: var(--text);
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
    }

    .mobile-nav-panel a:hover {
        background: var(--surface-soft);
        color: var(--primary);
    }
}

@media (min-width: 901px) {
    .books-toggle,
    .mobile-nav-overlay,
    .mobile-nav-panel {
        display: none !important;
    }
}

@media (max-width: 600px) {

    .topbar {
        height: 64px;
        padding: 0 8px;
        gap: 5px;
    }

    .mobile-menu {
        width: 34px;
        height: 34px;
        min-width: 34px;
        flex-basis: 34px;
        font-size: 19px;
    }

    .brand-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 17px;
    }

    .brand-title {
        font-size: 13px;
    }

    .brand-subtitle {
        font-size: 7px;
    }

    .header-actions .icon-btn {
        width: 30px;
        min-width: 30px;
        height: 32px;
        font-size: 15px;
    }

    .language-select {
        width: 58px;
        min-width: 58px;
        max-width: 58px;
        height: 32px;
        font-size: 9px;
    }

    .books-toggle {
        margin-top: 10px;
    }
}

/* Prevent Tamil verse from escaping the mobile reader. */
@media (max-width: 600px) {
    .bible-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        padding-left: 10px;
        padding-right: 10px;
    }

    .verse {
        width: 100%;
        max-width: 100%;
        display: grid;
        grid-template-columns: 24px minmax(0, 1fr);
        column-gap: 8px;
        align-items: start;
    }

    .verse-number {
        margin-right: 0;
    }

    .verse-text {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal;
    }
}


/* =====================================================
   FINAL MOBILE READING MODE V3
===================================================== */

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

@media (max-width: 600px) {

    .topbar {
        position: sticky;
        top: 0;
        z-index: 200;
        width: 100%;
        height: 64px;
        padding: 0 8px;
        display: flex;
        align-items: center;
        gap: 6px;
        overflow: hidden;
    }

    .mobile-menu {
        display: flex !important;
        flex: 0 0 36px;
        width: 36px;
        min-width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text);
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 7px;
        overflow: hidden;
    }

    .brand-icon {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
    }

    .brand-text {
        min-width: 0;
        overflow: hidden;
    }

    .brand-title {
        font-size: 14px !important;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .brand-subtitle {
        font-size: 8px !important;
        line-height: 1.1;
        white-space: nowrap;
    }

    .main-navigation {
        display: none !important;
    }

    .header-actions {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 2px;
        min-width: 0;
    }

    .header-actions .icon-btn {
        display: inline-flex;
        flex: 0 0 31px;
        width: 31px;
        min-width: 31px;
        height: 34px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 8px;
        font-size: 16px;
    }

    .language-select {
        flex: 0 0 61px;
        width: 61px;
        min-width: 61px;
        max-width: 61px;
        height: 34px;
        padding: 0 2px;
        border-radius: 8px;
        font-size: 10px;
    }

    .app-layout {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: block;
        overflow-x: hidden;
    }

    .reader {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 8px 8px 50px;
        overflow-x: hidden;
    }

    /* Bible books button */
    .books-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: auto;
        min-width: 88px;
        height: 38px;
        margin: 4px 0 6px;
        padding: 0 12px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text);
        font-family: inherit;
        font-size: 12px;
        font-weight: 700;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
    }

    .reader-header {
        position: relative;
        top: auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        padding: 8px 4px 10px;
        overflow: hidden;
    }

    .breadcrumb {
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .title-row {
        width: 100%;
        min-width: 0;
        align-items: flex-start;
        gap: 8px;
    }

    #bookTitle {
        min-width: 0;
        font-size: 25px !important;
        line-height: 1.25;
        overflow-wrap: break-word;
    }

    .reader-tools {
        flex: 0 0 auto;
        display: flex;
        gap: 4px;
    }

    .tool-btn {
        min-width: 40px;
        height: 36px;
        padding: 0 8px;
        font-size: 13px;
    }

    .chapter-selector {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 10px 0 12px;
    }

    .chapter-scroll {
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .continue-reading {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 10px 0 12px;
        overflow: hidden;
    }

    .bible-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 8px 0 0;
        padding: 14px 10px 22px !important;
        border-radius: 12px;
        overflow: hidden !important;
    }

    .verse {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: 22px minmax(0, 1fr);
        column-gap: 8px;
        align-items: start;
        padding: 8px 2px !important;
        margin: 0;
        overflow: hidden;
    }

    .verse-number {
        width: 22px;
        min-width: 22px;
        margin: 3px 0 0;
        font-size: 11px;
        line-height: 1.5;
    }

    .verse-text {
        width: 100%;
        min-width: 0 !important;
        max-width: 100%;
        font-size: var(--reader-size) !important;
        line-height: 1.9 !important;
        letter-spacing: 0;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal;
        hyphens: none;
    }

    .chapter-navigation {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .sidebar {
        position: fixed !important;
        z-index: 1000 !important;
        top: 64px !important;
        left: -320px;
        width: min(310px, 88vw);
        height: calc(100vh - 64px);
        overflow-y: auto;
        transition: left .22s ease;
    }

    .sidebar.open {
        left: 0 !important;
    }

    /* Website navigation */
    .mobile-nav-overlay {
        z-index: 1100 !important;
    }

    .mobile-nav-panel {
        z-index: 1101 !important;
        width: min(82vw, 320px);
    }
}

@media (min-width: 601px) {
    .books-toggle {
        display: none !important;
    }
}
