/* style-votd-modal.css
 * Minimal modal-chrome rules needed on votd.php for the clickable Bible
 * references in the teaching sections (scripts-votd-bible-refs.js), reusing
 * the same createStrongIdModal() engine as the ROG reader.
 *
 * Deliberately NOT the full assets/style.css + assets/style-rog.css: those
 * are page-wide reader stylesheets with broad selectors (e.g. a mobile
 * "input, button { width:100%; margin:0.5em 0; }" rule) that leaked onto
 * VOTD's own unrelated buttons (.section-copy-btn/.section-share-btn) when
 * loaded wholesale. Only the rules the modal chain actually needs are
 * duplicated here.
 */

/* Prevent background scrolling when modal is open - CRITICAL for mobile */
body.modal-open,
html.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    touch-action: none !important;
    -webkit-overflow-scrolling: auto !important;
}
body.modal-open .main-content {
    pointer-events: none;
}

.modal-ro-note {
    display: none !important;
    position: fixed !important;
    z-index: 9999 !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.4) !important;
    pointer-events: auto !important;
}
.modal-ro-note.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Modal header: always show blue bottom border, even when scrolling */
.modal-caption-fixed {
    border-bottom: 2px solid #337ab7 !important;
    z-index: 2 !important;
    background: #f4f8fb !important;
}

#modalUnifiedModalContent {
    background: #fff;
    color: #222;
    padding: 0.75em 1em;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    max-width: 600px;
    margin: 0.5em auto 2em auto;
    line-height: 1.5;
}
#modalUnifiedModalContent h2 {
    margin: 0 0 0.5em 0;
    padding: 0;
    line-height: 1.2;
}

.modal-footer-fixed {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 3 !important;
    background: #fff !important;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.04) !important;
    padding: 12px 0 12px 0 !important;
}

/* Dimmed modal: fade previous modals when a new one opens on top */
.modal-dimmed {
    opacity: 0.3 !important;
    pointer-events: none !important;
    filter: blur(2px) grayscale(0.7) brightness(0);
}

/* ROG interlinear word-grid layout (Greek/Strong/Romanian columns per word) -
   needed because get_rendered_verse.php's interlinear rendering is built
   entirely around these classes; without them every word stacks in one
   column instead of laying out as a row per verse. */
.rog-flex-chapter {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-bottom: 1em;
}
.rog-flex-verse {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5em;
    background: #f8f8ff;
    border-radius: 6px;
    padding: 0.5em 0.5em 0.5em 0.7em;
    margin-bottom: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    text-align: left;
    flex-wrap: wrap;
}
.rog-flex-verse:not(:has(.rog-flex-greek)) {
    padding-left: 0.1em !important;
}
.rog-flex-ref {
    min-width: 60px;
    max-width: 90px;
    font-weight: bold;
    color: #336699;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.rog-flex-word {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0 4px;
    text-align: left;
}
.rog-flex-strong {
    color: #336699;
    font-weight: bold;
    text-align: left;
}
.rog-flex-greek {
    font-family: "Candara", Garamond, sans-serif;
    text-align: left;
}
.rog-flex-romanian {
    color: #d9463b;
    text-align: left;
    font-family: Arial, Verdana, sans-serif;
}
.rog-flex-title {
    background: #e0eaff;
    font-weight: bold;
    padding: 0.5em 0;
    text-align: left;
    border-radius: 4px;
    margin-bottom: 0.2em;
}
.rog-invert {
    background: #d9463b;
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

.strongid-modal-instance {
    display: flex !important;
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    width: 92vw !important;
    height: fit-content !important;
    max-height: 100vh !important;
    border: 3px solid #337ab7 !important;
    overflow-y: auto !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important;
    background: rgba(255,255,255,0.98) !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

@media (max-width: 600px) {
    #modalUnifiedModalContent {
        max-width: 95vw;
        padding: 0.6em 0.5em;
        margin: 0.4em auto 1em auto;
        word-break: break-word;
    }
    .modal-ro-note-content {
        max-width: 95vw;
        padding: 1em;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
        scrollbar-width: none; /* Firefox */
    }
    .modal-ro-note-content::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Edge */
    }
    /* Custom draggable scroll slider for mobile */
    .modal-scroll-slider {
        position: fixed;
        right: 8px;
        top: 15%;
        bottom: 15%;
        width: 60px;
        background: rgba(0,0,0,0.1);
        border-radius: 30px;
        z-index: 99999;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 0;
    }
    .modal-scroll-track {
        flex: 1;
        width: 4px;
        background: #ddd;
        border-radius: 2px;
        position: relative;
        margin: 8px 0;
    }
    .modal-scroll-thumb {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: 56px;
        height: 56px;
        background: #337ab7;
        border: 3px solid #fff;
        border-radius: 50%;
        box-shadow: 0 3px 12px rgba(0,0,0,0.4);
        cursor: grab;
        display: flex;
        align-items: center;
        justify-content: center;
        touch-action: none;
    }
    .modal-scroll-thumb:active {
        cursor: grabbing;
        background: #2563a8;
        box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    }
    .modal-scroll-thumb::before {
        content: '\22ee';
        color: #fff;
        font-size: 24px;
        font-weight: bold;
        line-height: 1;
    }
    .modal-scroll-arrow {
        width: 40px;
        height: 40px;
        background: #555;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
}
