﻿/* ==========================================
   BIBLE READER FULL MERGED CSS
   Original + All Fixes + Responsive
   ========================================== */

@import url("https://fonts.googleapis.com/css?family=Poppins:100,200,300,400,500,600,700,800,900");

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

body {
    background-color: black;
/*    color: white;*/
}

.dark-mode .table {
    --bs-table-color: #e0e0e0;
    --bs-table-bg: #2d2d2d;
    --bs-table-border-color: #444;
    --bs-table-hover-color: #fff;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

/* ====================== BASE LAYOUT ====================== */
.bible-reader-wrapper {
    position: relative;
    height: calc(100vh - 100px);
    background-color: #f8f9fa;
    color: #333 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dark-mode .bible-reader-wrapper {
    background-color: #121212;
    color: #e0e0e0 !important;
}

.reader-nav-bar {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px 15px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    flex-shrink: 0;
}

.dark-mode .reader-nav-bar {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
}

.reader-select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: #fff;
    min-width: 20px;
    font-weight: 500;
}

.footer-font {
    font-size: 0.85rem;
}

.dark-mode .reader-select {
    background: #2d2d2d;
    color: #fff;
    border-color: #444;
}

/* ====================== PANELS & RESIZERS ====================== */
#readerPanelsContainer {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.reader-pane {
    flex-grow: 1;
    flex-shrink: 1;
}

.reader-pane {
    flex: 1 1 0% !important;
    height: 100% !important;
    overflow-y: auto !important;
    padding: 20px;
    background-color: #ffffff;
    min-width: 0;
    scroll-behavior: smooth;
    transition: width 0.3s ease;
    font-size: 18px; /* Base for sizers */
}

    .reader-pane.hidden {
        display: none !important;
    }

.dark-mode .reader-pane {
    background-color: #121212;
}

.pane-divider, .pane-divider-v, .pane-divider-h {
    background-color: #ccc;
    transition: background 0.2s;
}

.pane-divider-v {
    width: 6px;
    cursor: col-resize;
}

.pane-divider-h {
    height: 6px;
    width: 100%;
    cursor: row-resize;
}

    .pane-divider:hover,
    .pane-divider-v:hover,
    .pane-divider-h:hover {
        background-color: #007bff;
    }

.dark-mode .pane-divider,
.dark-mode .pane-divider-v,
.dark-mode .pane-divider-h {
    background-color: #444;
}

/* ====================== MENUS & FLOATING ====================== */
/* ====================== VERSE ACTION MENU ====================== */
.verse-action-menu {
    position: absolute;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 4px;
    z-index: 9999;
    display: none;
    min-width: 200px;
    border: 1px solid #ddd;
}

.dark-mode .verse-action-menu {
    background: #2d2d2d;
    border-color: #444;
}

.action-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 4px;
    color: #333;
}

    .action-item:hover {
        background: #f0f0f0;
    }

.dark-mode .action-item {
    color: #eee;
}

    .dark-mode .action-item:hover {
        background: #3d3d3d;
    }

.floating-tools {
    position: absolute;
    bottom: 30px;
    left: 50%;
/*    transform: translateX(-50%)!important;*/
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    padding: 5px 15px;
    gap: 15px;
    z-index: 50;
    transition: transform 0.3s ease, bottom 0.3s ease, opacity 0.3s ease;
}

    .floating-tools.minimized {
        transform: translateX(-50%) translateY(50%)!important;
        opacity: 0.2;
    }

        .floating-tools.minimized:hover {
            opacity: 0.9;
        }

.floating-minimize-toggle {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    margin-left: -5px;
    border-right: 1px solid #dee2e6;
    padding-right: 10px;
}

    .floating-minimize-toggle:hover {
        color: #212529;
    }

.dark-mode .floating-minimize-toggle {
    color: #a0a6b0;
    border-color: #495057;
}

    .dark-mode .floating-minimize-toggle:hover {
        color: #fff;
    }

.pane-content {
    padding-bottom: 95px !important;
}

#btnSyncScroll.active {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

.dark-mode .floating-tools {
    background: #1e1e1e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.tool-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #555;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s;
}

    .tool-btn:hover {
        background: #f0f0f0;
        color: #007bff;
    }

.dark-mode .tool-btn {
    color: #aaa;
}

    .dark-mode .tool-btn:hover {
        background: #333;
        color: #4fc3f7;
    }

.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.custom-alert-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dark-mode .custom-alert-box {
    background: #2d2d2d;
    color: #fff;
}

.pane-loading-overlay {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(33, 37, 41, 0.7);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease;
}

    .pane-loading-overlay span {
        font-size: 0.95rem;
        font-weight: 500;
        letter-spacing: 0.5px;
    }

.bible-pane, .pane-content {
    position: relative;
}

.theme-adaptive-bg {
    background-color: #ffffff !important;
}

.theme-adaptive-text {
    color: #333333 !important;
}

.theme-adaptive-border {
    border-color: #dddddd !important;
}

.dark-mode .theme-adaptive-bg {
    background-color: #212529 !important;
}

.dark-mode .theme-adaptive-text {
    color: #f8f9fa !important;
}

.dark-mode .theme-adaptive-border {
    border-color: #444444 !important;
}

/* ====================== ACTION SIDEBAR ====================== */

#actionSidebarColumn {
    display: flex;
    flex-direction: column;
    width: 350px;
    min-width: 250px;
    max-width: 600px;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

.dark-mode #actionSidebarColumn {
    background: #1a1a1a;
}

/* CROSS REF */

#crossRefSidebarContainer {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    border-bottom: 1px solid #ddd;
}

#sidebarCrossRefList {
    flex: 1;
    overflow: auto;
}

/* NOTE */

#noteModal.note-sidebar-active {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 !important;
    border-radius: 0;
}

    #noteModal.note-sidebar-active .modal-dialog {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        margin: 0;
        max-width: none;
    }

    #noteModal.note-sidebar-active .modal-content {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }

#noteModal .modal-body {
    flex: 1;
    overflow: auto;
}

/* RESIZER */

#actionSidebarRowResizer {
    display: none;
    height: 6px;
    background: #cfcfcf;
    cursor: row-resize;
    flex: 0 0 6px;
}

.dark-mode #actionSidebarRowResizer {
    background: #444;
}

/* STATES */

#actionSidebarColumn.cross-only
#crossRefSidebarContainer {
    flex: 1;
}

#actionSidebarColumn.note-only
#noteModal {
    flex: 1;
}

#actionSidebarColumn.split-mode
#crossRefSidebarContainer {
    flex: 1;
}

#actionSidebarColumn.split-mode
#noteModal {
    flex: 1;
}

#actionSidebarColumn.split-mode
#actionSidebarRowResizer {
    display: block;
}

/* Right Sidebar (Study Items) */
.right-sidebar {
    width: 300px;
    min-width: 300px;
    background: #fff;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    z-index: 10;
}

.dark-mode .right-sidebar {
    background: #1e1e1e;
    border-color: #444;
}

.show-mobile {
    display: none !important;
}
/* ====================== VERSES ====================== */
.verse-container {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent;
    cursor: pointer;
    line-height: 1.6;
}

    .verse-container:hover {
        background-color: rgba(0, 123, 255, 0.05);
    }

.dark-mode .verse-container:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.verse-container.selected-verse {
    border-left: 4px solid #0056b3 !important;
    background-color: rgba(0, 86, 179, 0.15) !important;
}

.dark-mode .verse-container.selected-verse {
    border-left: 4px solid #00d2ff !important;
    background-color: rgba(0, 210, 255, 0.15) !important;
}

/* ====================== RESPONSIVE MOBILE ====================== */
@media (max-width: 768px) {

    main {margin-top:0px!important;}

    .bible-reader-wrapper {
        height: calc(100vh - 35px) !important;
        top:0px!important;
    }

    .reader-nav-bar {
        padding: 8px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .reader-pane {
        padding: 12px;
        font-size: 17px;
    }

    .floating-tools {
        position: fixed;
        bottom: 40px !important;
        left: 0;
        right: 0;
        transform: none;
        border-radius: 0;
        justify-content: space-around;
        padding: 8px 5px;
        z-index: 1050;
    }

    .verse-action-menu {
        padding: 2px;
    }
        .right-sidebar, #actionSidebarColumn {
        position: fixed;
        top: 60px;
        right: 0;
        width: 90vw !important;
        box-shadow: -5px 0 20px rgba(0,0,0,0.4);
        height: calc(100vh - 100px) !important;
    }

    .show-mobile {
        display:block!important;
    }
    .hide600, .hide-mobile {
        display: none !important;
    }

    .footer-nav-bar, .reader-nav-bar {
        padding: 4px;
        font-size: 10px;
    }

    .floating-minimize-toggle, .floating-tools {
        font-size: 0.75rem;
        padding: 6px;
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        border-radius: 0 !important;
        justify-content: space-around;
        z-index: 1050;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .reader-pane {
        padding: 10px;
        font-size: 16px;
    }

    .hide480 {
        display: none !important;
    }

    .ico {
        font-size: 14px;
    }


    .floating-tools, .floating-tools.minimized {
        padding: 3px 2px!important;
    }
 }

/* ====================== UTILITIES ====================== */
.custom-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-alert-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dark-mode .custom-alert-box {
    background: #2d2d2d;
    color: #fff;
}

/* ====================== LEXICON POPUP ====================== */
.lexicon-interactive-word {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted rgba(23, 162, 184, 0.4);
    padding: 0 1px;
    transition: background-color 0.2s ease;
}

    .lexicon-interactive-word:hover {
        background-color: rgba(27, 110, 194, 0.08);
    }

.dark-mode .lexicon-interactive-word:hover {
    background-color: rgba(255, 193, 7, 0.15);
}

.lexicon-tooltip-card,
.lexicon-popup-container {
    pointer-events: none;
    position: absolute;
    z-index: 1060;
    background-color: #ffffff !important;
    color: #212529 !important;
    border-radius: 6px;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: 'Poppins', sans-serif;
    line-height: 1.4;
    padding: 12px;
    min-width: 280px;
    max-width: 380px;
}

.dark-mode .lexicon-tooltip-card,
.dark-mode .lexicon-popup-container {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

.lexicon-badge-code {
    font-size: 0.725rem !important;
    vertical-align: sub;
    opacity: 0.85;
}

/* ====================== BOTTOM ACTION PANEL ====================== */
.bottom-action-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 8px 12px;
    display: flex;
    gap: 8px;
    z-index: 1000;
}

.dark-mode .bottom-action-panel {
    background: #2d2d2d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.bottom-action-panel .btn {
    border-radius: 50px;
    padding: 8px 16px;
}

/* ====================== STUDY ITEMS SIDEBAR ====================== */
.right-sidebar-section {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.study-list-item {
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.2s;
}

    .study-list-item:hover {
        background: rgba(0, 123, 255, 0.2);
    }

.dark-mode .study-list-item {
    background: rgba(255,255,255,0.05);
}

    .dark-mode .study-list-item:hover {
        background: rgba(0, 123, 255, 0.25);
    }

.sidebar-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #dc3545;
    opacity: 0.5;
    padding: 0;
    font-size: 0.95rem;
    cursor: pointer;
}

    .sidebar-delete-btn:hover {
        opacity: 1;
        transform: scale(1.15);
    }

/* ====================== SETTINGS MODAL ====================== */
#customSettingsModal .modal-content {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

.dark-mode #customSettingsModal .modal-content {
    background-color: #2d2d2d;
    border-color: #444;
}

#customSettingsModal .form-range {
    accent-color: #ffc107;
}

/* ====================== NOTE MODAL ====================== */
#noteModal .modal-content {
    border-radius: 8px;
    border: none;
}

#noteModal .modal-header {
    border-bottom: 1px solid #dee2e6;
}

#noteModal .modal-footer {
    border-top: 1px solid #dee2e6;
}

.dark-mode #noteModal .modal-content {
    background-color: #2d2d2d;
}

.dark-mode #noteModal .modal-header,
.dark-mode #noteModal .modal-footer {
    border-color: #444;
}

/* ====================== VERSE NUMBER ====================== */
.verse-num {
    font-weight: bold;
    font-size: 0.8em;
    color: #6c757d;
    margin-right: 8px;
    vertical-align: top;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

    .verse-num:hover {
        background-color: rgba(0, 123, 255, 0.2);
        color: #0056b3;
    }

.dark-mode .verse-num {
    color: #aaa;
}

    .dark-mode .verse-num:hover {
        background-color: rgba(0, 210, 255, 0.2);
        color: #00d2ff;
    }

/* ====================== DIVIDERS & RESIZERS (Improved) ====================== */
.pane-divider,
.pane-divider-v,
.pane-divider-h {
    background-color: #dee2e6;
    transition: all 0.2s ease;
    z-index: 50;
}

.pane-divider-v {
    width: 6px;
    cursor: col-resize;
}

.pane-divider-h {
    height: 6px;
    width: 100%;
    cursor: row-resize;
}

    .pane-divider:hover,
    .pane-divider-v:hover,
    .pane-divider-h:hover {
        background-color: #007bff;
        box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
    }

.dark-mode .pane-divider,
.dark-mode .pane-divider-v,
.dark-mode .pane-divider-h {
    background-color: #495057;
}

    .dark-mode .pane-divider:hover,
    .dark-mode .pane-divider-v:hover,
    .dark-mode .pane-divider-h:hover {
        background-color: #0d6efd;
    }

/* Make sure resizers are visible and functional in action sidebar */
#actionSidebarRowResizer {
    height: 6px;
    background-color: #dee2e6;
    cursor: row-resize;
    flex-shrink: 0;
    z-index: 10;
}

.dark-mode #actionSidebarRowResizer {
    background-color: #495057;
}

#sidebarColumnResizer {
    width: 6px;
    background-color: #dee2e6;
    cursor: col-resize;
}

.dark-mode #sidebarColumnResizer {
    background-color: #495057;
}

/* ====================== NOTE DOCKING - FINAL FIX ====================== */

/* Force note to dock properly in action sidebar */
#noteModal.right-sidebar-capable.show,
.note-sidebar-active {
    position: relative !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    margin: 0 !important;
    border: none;
    border-radius: 0 !important;
}

    #noteModal.right-sidebar-capable.show .modal-dialog,
    .note-sidebar-active .modal-dialog {
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none;
    }

    #noteModal.right-sidebar-capable.show .modal-content,
    .note-sidebar-active .modal-content {
        height: 100% !important;
        display: flex;
        flex-direction: column;
        border: none;
        border-radius: 0;
    }

#noteModalHeader {
    flex-shrink: 0;
}

#noteModalBody {
    flex: 1 1 auto !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#noteContentTextarea {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 300px;
    resize: none;
}

/* When only Note is open (no CrossRef) */
#actionSidebarColumn:has(#noteModal:not(.d-none)) .modal-content {
    height: 100% !important;
}

/* When both CrossRef and Note are visible */
#crossRefSidebarContainer + #actionSidebarRowResizer + #noteModal {
    height: 50%!important;
    flex: none;
}

/* When both CrossRef and Note are visible */
 #actionSidebarRowResizer + #noteModal {
    height: 100% !important;
    flex: none;
}

/* Resizer visibility */
#actionSidebarRowResizer {
    display: block !important;
    background: #dee2e6;
    height: 8px;
    cursor: row-resize;
    flex-shrink: 0;
    z-index: 20;
}

.dark-mode #actionSidebarRowResizer {
    background: #495057;
}

/* Ensure action column expands correctly */
#actionSidebarColumn {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ====================== VERSE-NUM → ACTION MENU ====================== */
.verse-num {
    font-weight: bold;
    font-size: 0.85em;
    color: #6c757d;
    margin-right: 8px;
    vertical-align: top;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

    .verse-num:hover {
        background-color: rgba(0, 123, 255, 0.15);
        color: #0056b3;
    }

.dark-mode .verse-num:hover {
    background-color: rgba(0, 210, 255, 0.2);
    color: #00d2ff;
}

/* ====================== NOTIFICATION / TOAST CSS ====================== */
.custom-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.custom-toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
    background-color: #2b3035;
    color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dark-mode .custom-toast {
    background-color: #1e2125;
}

.toast-body-content {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close-btn {
    background: none;
    border: none;
    color: #a0a6b0;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

    .toast-close-btn:hover {
        color: #ffffff;
    }

/* Toast Animations */
.slide-in {
    animation: toastSlideIn 0.3s ease forwards;
}

.slide-out {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* ====================== NOTE HEIGHT (Half / Full) ====================== */

/* Default: Note takes full remaining space when alone */
/*#actionSidebarColumn #noteModal {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}*/

/* When CrossRef is open → Note becomes ~50% */
/*#crossRefSidebarContainer + #actionSidebarRowResizer + #noteModal {
    height: 50% !important;
    flex: none !important;
    min-height: 30% !important;
}*/

/* Ensure resizer works between them */
/*#actionSidebarRowResizer {
    height: 8px;
    background: #dee2e6;
    cursor: row-resize;
    flex-shrink: 0;
    z-index: 15;
    display: block;
}

.dark-mode #actionSidebarRowResizer {
    background: #495057;
}*/

/* Make sure note modal stretches correctly when docked */
/*.note-sidebar-active #noteModalBody,
#noteModal.show .modal-body {
    flex: 1 1 auto !important;
    display: flex;
    flex-direction: column;
}

#noteContentTextarea {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 250px;
}*/

/* ====================== FLOATING ACTION MENU FIX ====================== */

/*.floating-tools {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    padding: 5px 15px;
    gap: 15px;
    z-index: 50;
    transition: transform 0.3s ease, bottom 0.3s ease, opacity 0.3s ease;
}

    .floating-tools.minimized {
        transform: translateX(-50%) translateY(85%);
        opacity: 0.4;
    }

        .floating-tools.minimized:hover {
            opacity: 0.9;
        }

.floating-minimize-toggle {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    margin-left: -5px;
    border-right: 1px solid #dee2e6;
    padding-right: 10px;
}

    .floating-minimize-toggle:hover {
        color: #212529;
    }

.dark-mode .floating-minimize-toggle {
    color: #a0a6b0;
    border-color: #495057;
}

    .dark-mode .floating-minimize-toggle:hover {
        color: #fff;
    }

.pane-content {
    padding-bottom: 95px !important;
}

#btnSyncScroll.active {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

.dark-mode .floating-tools {
    background: #1e1e1e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.tool-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #555;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.2s;
}

    .tool-btn:hover {
        background: #f0f0f0;
        color: #007bff;
    }

.dark-mode .tool-btn {
    color: #aaa;
}

    .dark-mode .tool-btn:hover {
        background: #333;
        color: #4fc3f7;
    }

.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.custom-alert-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dark-mode .custom-alert-box {
    background: #2d2d2d;
    color: #fff;
}

.pane-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(33, 37, 41, 0.7);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease;
}

    .pane-loading-overlay span {
        font-size: 0.95rem;
        font-weight: 500;
        letter-spacing: 0.5px;
    }

.bible-pane, .pane-content {
    position: relative;
}

.theme-adaptive-bg {
    background-color: #ffffff !important;
}

.theme-adaptive-text {
    color: #333333 !important;
}

.theme-adaptive-border {
    border-color: #dddddd !important;
}

.dark-mode .theme-adaptive-bg {
    background-color: #212529 !important;
}

.dark-mode .theme-adaptive-text {
    color: #f8f9fa !important;
}

.dark-mode .theme-adaptive-border {
    border-color: #444444 !important;
}*/

/* ====================== VERSE ACTION MENU - FORCE SHOW ====================== */
    /*#verseActionMenu.verse-action-menu {
    position: absolute;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.18);
    padding: 6px 0;
    z-index: 99999 !important;
    min-width: 210px;
    display: none;
}

.dark-mode #verseActionMenu.verse-action-menu {
    background: #2d2d2d;
    border-color: #444;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.action-item {
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    font-size: 0.95rem;
}

    .action-item:hover {
        background-color: #f8f9fa;
    }

.dark-mode .action-item {
    color: #e9ecef;
}

    .dark-mode .action-item:hover {
        background-color: #3d3d3d;
    }*/

/* Make sure verse-num triggers menu */
/*.verse-num {
    cursor: pointer !important;
    user-select: none;
}*/

/* ====================== NOTE & CROSSREF SIDEBAR DOCKING (UPDATED) ====================== */

/* Ensure the column is a proper flex container */
/*#actionSidebarColumn {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}*/

    /* 1. STATE: ONLY NOTE IS VISIBLE (CrossRef is closed/d-none) */
    /* !important is required here to override any lingering inline styles set by the JS drag resizer */
    /*#actionSidebarColumn:has(#crossRefSidebarContainer.d-none) #noteModal {
        flex: 1 1 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column;
    }*/

    /* 2. STATE: ONLY CROSSREF IS VISIBLE (Note is undocked and missing from column) */
    /* When the Note is undocked, it leaves the DOM of this column entirely */
    /*#actionSidebarColumn:not(:has(#noteModal)) #crossRefSidebarContainer {
        flex: 1 1 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column;
    }*/

    /* 3. STATE: BOTH ARE VISIBLE (Dual Split) */
    /*#actionSidebarColumn:has(#crossRefSidebarContainer:not(.d-none)):has(#noteModal) #crossRefSidebarContainer {
        flex: 1 1 auto;*/ /* Top panel takes the remaining flexible space above the Note */
        /*height: auto;
        display: flex;
        flex-direction: column;
    }

    #actionSidebarColumn:has(#crossRefSidebarContainer:not(.d-none)):has(#noteModal) #noteModal {
        height: 50%;*/ /* Initial 50/50 split */
        /*flex: none !important;*/ /* Prevents flex from fighting the JS drag resizer */
        /*min-height: 120px;*/ /* Minimum height threshold matching your JS engine */
        /*display: flex !important;
        flex-direction: column;
    }*/

    /* 4. RESIZER VISIBILITY */
    /* Hide the horizontal resizer row when either panel is alone */
    /*#actionSidebarColumn:has(#crossRefSidebarContainer.d-none) #actionSidebarRowResizer,
    #actionSidebarColumn:not(:has(#noteModal)) #actionSidebarRowResizer {
        display: none !important;
    }*/

/* 5. MODAL INNER WRAPPERS */
/* Ensure inner modal wrappers expand cleanly inside the custom column layout */
/*#noteModal.right-sidebar-capable.show,
.note-sidebar-active {
    position: relative !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column;
    margin: 0 !important;
    border: none;
    border-radius: 0 !important;
}*/

/* ====================== NOTE & CROSSREF SIDEBAR DOCKING (CONSOLIDATED & FIXED) ====================== */

/* Ensure the action column is a proper flex container */
#actionSidebarColumn {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width:350px;
}

    /* 
   CRITICAL FIX: Completely hide the Note Modal inside the column 
   when it is NEITHER active in the sidebar nor open as a floating popup.
*/
    #actionSidebarColumn #noteModal:not(.note-sidebar-active):not(.show) {
        display: none !important;
    }

    /* ---------------------------------------------------
   1. STATE: ONLY CROSSREF IS VISIBLE
   (CrossRef is open, Note is NOT active/docked)
   --------------------------------------------------- */
    #actionSidebarColumn:has(#crossRefSidebarContainer:not(.d-none)):not(:has(#noteModal.note-sidebar-active)) #crossRefSidebarContainer {
        flex: 1 1 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column;
    }

    /* ---------------------------------------------------
   2. STATE: ONLY NOTE IS VISIBLE
   (CrossRef is hidden, Note is active/docked)
   --------------------------------------------------- */
    #actionSidebarColumn:has(#crossRefSidebarContainer.d-none) #noteModal.note-sidebar-active {
        flex: 1 1 100% !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        display: flex !important;
        flex-direction: column;
    }

    /* ---------------------------------------------------
   3. STATE: BOTH ARE VISIBLE (DUAL SPLIT)
   (CrossRef is visible AND Note is active/docked)
   --------------------------------------------------- */
    #actionSidebarColumn:has(#crossRefSidebarContainer:not(.d-none)):has(#noteModal.note-sidebar-active) #crossRefSidebarContainer {
        flex: 1 1 auto !important;
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column;
    }

    #actionSidebarColumn:has(#crossRefSidebarContainer:not(.d-none)):has(#noteModal.note-sidebar-active) #noteModal.note-sidebar-active {
        /* NO !IMPORTANT ON HEIGHT: Allows your JS drag resizer to modify inline height heights */
        height: 50%;
        flex: none !important; /* Prevents flexbox alignment from fighting JS resize adjustments */
        min-height: 120px;
        max-height: none !important;
        display: flex !important;
        flex-direction: column;
    }

    /* ---------------------------------------------------
   4. RESIZER VISIBILITY
   --------------------------------------------------- */
    /* Show horizontal splitter only when both components are active/visible */
    #actionSidebarColumn:has(#crossRefSidebarContainer:not(.d-none)):has(#noteModal.note-sidebar-active) #actionSidebarRowResizer {
        display: block !important;
        height: 6px;
        cursor: row-resize;
        flex-shrink: 0;
        background-color: #ccc;
        z-index: 10;
    }

    /* Hide horizontal splitter in all other layout states */
    #actionSidebarColumn:has(#crossRefSidebarContainer.d-none) #actionSidebarRowResizer,
    #actionSidebarColumn:not(:has(#noteModal.note-sidebar-active)) #actionSidebarRowResizer {
        display: none !important;
    }

/* ---------------------------------------------------
   5. DOCKED NOTE MODAL STRUCTURAL CLEANUP
   --------------------------------------------------- */
/*#noteModal.note-sidebar-active {
    position: relative !important;
    width: 100% !important;
    min-width: 100% !important;
    display: flex !important;
    flex-direction: column;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;*/ /* Allow the column container to manage visual ordering */
/*}*/

    #noteModal.note-sidebar-active .modal-dialog,
    #noteModal.note-sidebar-active .modal-content {
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        background: transparent !important;
        border: none !important;
    }
/* ====================== FIX: DOCKED MODAL BACKDROP LOCKUPS ====================== */

/* 1. Vaporize the backdrop overlay completely when Search or Note sidebars are active */
body:has(.search-sidebar-active) .modal-backdrop,
body:has(.note-sidebar-active) .modal-backdrop {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 2. Prevent Bootstrap from locking page scrolling or adding bugged layout padding when docked */
body:has(.search-sidebar-active),
body:has(.note-sidebar-active) {
    overflow: auto !important;
    padding-right: 0 !important;
}

/* 3. Ensure the docked search modal behaves cleanly inside its flex layout container */
.search-sidebar-active .modal-content {
    box-shadow: none !important;
    border: none !important;
    height: 100% !important;
}

@media (max-width: 767px) {
    #actionSidebarColumn {
        position: fixed !important;
        top: 0;
        right: 0;
        height: 85vh !important;
        z-index: 1050 !important;
        box-shadow: -5px 0 25px rgba(0,0,0,0.5);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;

        }


        /* Class applied via JS to slide the menu into view */
        #actionSidebarColumn.mobile-open {
            transform: translateX(0);
        }


    .footer-font {
        font-size: 0.5rem;
    }
    /* Tighten typography and padding for elements in the header and footer */
    header, .app-header, .navbar, footer, .app-footer {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }

        /* Shrink the font sizes to keep text on a single line */
        header *,
        .app-header *,
        footer *,
        .app-footer * {
            font-size: 0.65rem !important; /* Force smaller size */
        }

    /* Eliminate text wrapping and provide safe horizontal scrolling if space is extremely tight */
    .header-nav-bar,
    .footer-nav-bar,
    .navbar-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        white-space: nowrap;
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }

        .header-nav-bar::-webkit-scrollbar,
        .footer-nav-bar::-webkit-scrollbar {
            display: none; /* Hide scrollbar for Chrome, Safari and Opera */
        }

    .floating-tools, .floating-tools.minimized {
        position: absolute; /* Lock inside the reader container boundaries */
        bottom: 40px !important;
        top: auto;
        left: 0;
        right: 0;
        transform: none !important;
        flex-direction: row; /* Horizontal alignment */
        justify-content: space-around;
        align-items: center;
        width: 100%;
        border-radius: 0;
        border-width: 1px 0 0 0; /* Top border only */
        padding: 3px 2px;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        gap: 0;
        opacity: 0.9;
    }

    .bible-reader-wrapper {
        height: calc(100vh - 30px) !important;
    }

    /* Prevent content in active reader panes from being hidden behind the bottom bar */
    /*.reader-pane-body,
    .bible-text-container {
        padding-bottom: 65px !important;
    }
}*/