/* 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;
}

/* Compact h2 styling for Strong-ID title - minimal vertical spacing */
#modalUnifiedModalContent h2 {
    margin: 0 0 0.5em 0;
    padding: 0;
    line-height: 1.2;
}

/* Strong-ID modal action buttons - Search and Copy */
.strong-search-btn:hover {
    background: #2868a0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.strong-copy-btn:hover {
    background: #218838 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.strong-search-btn:active,
.strong-copy-btn:active {
    transform: translateY(1px);
}

/* Note modal action buttons - Search and Copy */
.note-search-btn:disabled {
    cursor: not-allowed !important;
}

.note-copy-btn:hover {
    background: #218838 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.note-copy-btn:active {
    transform: translateY(1px);
}

@media (max-width: 600px) {
    #modalUnifiedModalContent {
        max-width: 95vw;
        padding: 0.6em 0.5em;
        margin: 0.4em auto 1em auto;
        word-break: break-word;
    }
}
body.modal-open {
    overflow: hidden !important;
    width: 100vw !important;
}
/* Block background content clicks when modal is open */
body.modal-open .main-content {
    pointer-events: none;
}
.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: hide or fade previous modals when a new one opens */
.modal-dimmed {
    opacity: 0.3 !important;
    pointer-events: none !important;
    filter: blur(2px) grayscale(0.7) brightness(0);
}
/*  strongid-modal-instance modals to be visible and obvious */
.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; /* Allow up to full viewport height */
    border: 3px solid #337ab7 !important; /* Blue border for modal */
    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;
}
/* --- Sticky Header Mobile UX: Hamburger always visible, header scrollable (touch only) --- */
@media (pointer: coarse), (hover: none) {
    #sticky-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        z-index: 1000;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        padding: 0;
        background: #336699;
    }
    .sticky-hamburger-container {
        position: sticky;
        left: 0;
        top: 0;
        z-index: 1010;
        background: #336699;
        flex: 0 0 auto;
        box-shadow: 2px 0 6px rgba(0,0,0,0.07);
    }
    .sticky-header-content {
        flex: 1 1 0%;
        min-width: 0;
        overflow-x: auto;
        display: flex;
        align-items: center;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 0.5em;
    }
    .hamburger-btn {
        min-width: 44px;
        min-height: 44px;
        background: none;
        border: none;
        padding: 0.5em 0.75em;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* Desktop: let header behave as before */
@media (pointer: fine) and (hover: hover) {
    .sticky-hamburger-container {
        position: static;
        box-shadow: none;
    }
    .sticky-header-content {
        overflow-x: visible;
        gap: 0.5em;
    }
}
/* Reduce vertical space above and below plain verses */
.rog-flex-verse:not(:has(.rog-flex-greek)) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    gap: 0 !important;
}
.rog-flex-verse:not(:has(.rog-flex-greek)) > span,
.rog-flex-verse:not(:has(.rog-flex-greek)) > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
}
/* Use the same font-family as .rog-flex-romanian for Romanian text in plain verses */
/* Use Garamond for Romanian text in plain verses to match interlinear */
.rog-flex-verse:not(:has(.rog-flex-greek)) span > span:last-child {
    font-family: Arial, Verdana, sans-serif !important;
}
/* Increase font size for plain verse text (not the reference) */
/* .rog-flex-verse:not(:has(.rog-flex-greek)) span {
    font-size: 1.1em;
} */
}
/* Keep reference font size unchanged */
/* .rog-flex-verse:not(:has(.rog-flex-greek)) span > span:first-child {
    font-size: 1.1em;
} */
}
/* ROG INTERLINEAR: LXXRO LOGIC (ISOLATED) */
.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;
}

/* Reduce left space for plain verses in ABA (no .rog-flex-greek child) */
.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;
    /* font-size: 1.1em; */
    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 {
    /* font-size: 0.95em; */
    color: #336699;
    font-weight: bold;
    text-align: left;
}
.rog-flex-greek {
    /* font-size: 1.1em; */
    font-family: "Candara", Garamond, sans-serif;
    text-align: left;
}
.rog-flex-romanian {
    /* font-size: 1.05em; */
    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;
    /* font-size: 1.08em; */
    border-radius: 4px;
    margin-bottom: 0.2em;
}
.rog-invert {
    background: #d9463b;
    color: #fff;
    padding: 0 2px;
    border-radius: 2px;
}

/* Make sticky-header larger on mobile devices */
@media (max-width: 600px) {
    #sticky-header {
        min-height: 64px !important;
        font-size: 1.15em !important;
        padding-top: 0.7em !important;
        padding-bottom: 0.7em !important;
    }
    #sticky-header .header-left, #sticky-header .header-right {
        min-height: 48px !important;
        font-size: 1.08em !important;
    }
    .hamburger-title {
        font-size: 1.35em !important;
    }
}
/* END ROG INTERLINEAR: LXXRO LOGIC */

/* Modal content styling for ROG notes */
#modalRoNoteClickText {
    background: #fff;
    color: #222;
    padding: 1.5em 2em;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    max-width: 600px;
    margin: 2em auto;
    line-height: 1.5;
}

@media (max-width: 600px) {
    #modalRoNoteClickText {
        max-width: 95vw;
        padding: 1em 0.5em;
        margin: 1em auto;
        word-break: break-word;
    }
}
.tts-highlight {
  background: #ffe066 !important;
  font-weight: bold;
  border-radius: 3px;
  transition: background 0.2s;
}

/* --- Consistent font size for modals and main content on mobile --- */
@media (max-width: 700px) {
    .main-content {
        font-size: 1.1em;
    }
}

/* ============================================
   VERSE SELECTION FEATURE
   ============================================ */
/* Verse reference clickable styling */
.verse-ref-number {
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
    /* Prevent text selection on mobile to avoid conflict with long-press copy */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Prevent touch callout menu on iOS */
    -webkit-touch-callout: none;
    /* Keep verse ref and button together on same line */
    display: inline-block;
    white-space: nowrap;
}

/* Copy button inline with verse reference */
.verse-copy-btn {
    display: inline-block;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 3px;
    margin-left: 3px;
    margin-right: 6px;
    vertical-align: baseline;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    animation: copyBtnFadeIn 0.3s ease;
    width: 15px;
    height: 14px;
    text-align: center;
}

.verse-copy-btn:hover {
    background: #229954;
    transform: scale(1.15);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.verse-copy-btn:active {
    transform: scale(0.95);
    background: #1e8449;
}

.verse-copy-btn.copied {
    background: #3498db;
    animation: copyBtnSuccess 0.5s ease;
}

@keyframes copyBtnFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes copyBtnSuccess {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.verse-ref-number:hover {
    color: #2980b9; /* Subtle blue on hover */
    transform: scale(1.05); /* Slight zoom effect */
}

.verse-ref-number:active {
    transform: scale(0.98); /* Press effect */
}
/* ============================================
   COPY VERSE FEATURE - Toast Animation
   ============================================ */
@keyframes fadeInOut {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(10px); 
    }
    10% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    90% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-10px); 
    }
}

/* ============================================
   HOVER MODAL - Hide on touch devices
   ============================================ */
/* Hide hover tooltip modal on touch devices (where hover doesn't make sense) */
@media (hover: none) and (pointer: coarse) {
    #modalRoNoteHover {
        display: none !important;
    }
}

/* ============================================
   WELCOME MODAL - Version Announcement
   ============================================ */
.welcome-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.welcome-modal-content .modal-header {
    background: #337ab7;
    color: #fff;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.welcome-modal-content .modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.welcome-modal-content .modal-body {
    padding: 0;
}

.welcome-modal-content .modal-body ul {
    line-height: 1.8;
    font-size: 1.05em;
}

.welcome-modal-content .modal-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.welcome-modal-close-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s ease;
}

.welcome-modal-close-btn:hover {
    background: #45a049;
}

/* Mobile responsiveness for Welcome Modal */
@media (max-width: 600px) {
    .welcome-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .welcome-modal-content .modal-header {
        padding: 15px;
    }
    
    .welcome-modal-content .modal-header h2 {
        font-size: 1.2em;
    }
}

/* Animations for Welcome Modal */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}
