/**
 * Page Visibility Fix
 * Ensures only active pages are visible and prevents page overlap
 */

/* Force all pages to be hidden by default */
.page:not(.active) {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Only active pages should be visible */
.page.active {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: auto !important;
}

/* Specific fix for viewer page */
#viewer-page:not(.active) {
    display: none !important;
}

/* Ensure proper flex display for viewer when active */
#viewer-page.active {
    display: flex !important;
}