/**
 * GenZync Modal Lock & Scroll/Selection Isolation System
 * Prevents scroll leakage, background text highlighting, and handles feedback animation.
 */

/* 1. Global Body Freeze when any Modal is Active */
body.modal-open-freeze {
    overflow: hidden !important;
    touch-action: none;
    -webkit-overflow-scrolling: auto;
}

/* 2. Freeze text selection on the background while a modal is open */
body.modal-open-freeze > *:not(.modal-overlay):not(.login-modal-overlay):not(.forgot-overlay):not(.lightbox-overlay):not(.image-lightbox-overlay):not(.confirm-password-overlay) {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
}

/* 3. Backdrop Overlays: Prevent text selection on the dark overlay itself */
.modal-overlay,
.login-modal-overlay,
.forgot-overlay,
.lightbox-overlay,
.image-lightbox-overlay,
.confirm-password-overlay,
.modal-backdrop,
.details-modal-overlay {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* 4. Ensure text inside Modal Cards / Content IS selectable and clean */
.modal-card,
.modal-content,
.login-modal-card,
.signup-modal-card,
.terms-modal-card,
.verify-modal-card,
.reset-modal-card,
.forgot-card,
.event-details-card,
.day-events-card,
.confirm-password-modal,
.reactors-modal-card,
.edit-comment-modal,
.delete-comment-modal,
.act-modal,
.act-modal-card {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
    overscroll-behavior: contain;
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* 5. Contain overscroll on all scrollable modal sections */
.modal-scroll-body,
.terms-scroll-box,
.signup-scroll-body,
.modal-body-grid,
.event-participants-scroll,
.discussion-board-scroll,
.modal-registration-card-wrap,
.reactors-list-wrap,
.act-modal-body {
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
}
