/* =========================================
           FlipBook Scoped Styles (Main Layout)
        ========================================= */
        #fbpH-root {
            --fbpH-bg-dark: #1e272e;
            --fbpH-accent: #f1c40f;
            --fbpH-text-main: 'Poppins', sans-serif;
            --fbpH-text-bn: 'Poppins', sans-serif;
            --fbpH-footer-h: 60px;
            --fbpH-overlay-bg: rgba(0, 0, 0, 0.9);

            font-family: var(--fbpH-text-main);
            box-sizing: border-box;
            position: relative;
            z-index: 1 !important; /* 🌟 Header Overlap Fix */
            width: 100%;
            height: 85vh; /* 🌟 Full Width Inline Height */
            min-height: 700px;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
            overflow: hidden;
            display: flex; align-items: center; justify-content: center; color: #fff;
        }

        /* --- 🌟 Theme Conflict Safe Reset 🌟 --- */
        #fbpH-root * { box-sizing: border-box !important;  line-height: normal !important; text-transform: capitalize; }
        #fbpH-root *::before, #fbpH-root *::after { box-sizing: border-box !important; }
        #fbpH-root img { max-width: none !important; border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
        #fbpH-root button { box-shadow: none !important; outline: none !important; background: transparent; border: none; cursor: pointer; }
        #fbpH-root a { text-decoration: none !important; box-shadow: none !important; }

        /* --- Landing Area --- */
        .fbpH-landing { 
            text-align: center; z-index: 10; transition: 0.3s; width: 100%; height: 100%;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            overflow-y: auto; padding: 20px;
        }
        .fbpH-logo { color: white; font-size: 32px; font-weight: 700; margin-bottom: 30px; text-shadow: 0 4px 15px rgba(0,0,0,0.5); }
        .fbpH-logo i { color: var(--fbpH-accent); }

        .fbpH-upload-btn {
            background: var(--primary-gradient); color: #fff;
            padding: 15px 40px; border-radius: 50px; cursor: pointer;
            font-family: var(--fbpH-text-bn); font-size: 18px; font-weight: 600; 
            box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
            border: 2px solid rgba(255,255,255,0.1);
            display: inline-flex; align-items: center; gap: 10px; transition: 0.3s;
            text-decoration: none; margin-bottom: 40px;
        }
        .fbpH-upload-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(230, 126, 34, 0.4); }
        #fbpH-file-upload { display: none; }

        /* --- Library Grid --- */
        .fbpH-library-title {
            font-family: var(--fbpH-text-bn); font-size: 22px; margin-bottom: 20px; 
            border-bottom: 2px solid var(--fbpH-dark); padding-bottom: 5px; display: inline-block;
        }
        .fbpH-library-grid {
            display: flex; flex-wrap: wrap; justify-content: center; gap: 25px;
            max-width: 1000px; width: 100%;
        }
        .fbpH-book-card {
            width: 140px; cursor: pointer; transition: 0.3s; position: relative;
        }
        .fbpH-book-card:hover { transform: translateY(-10px); }
        .fbpH-book-cover {
            width: 100%; height: 200px; border-radius: 5px; overflow: hidden;
            box-shadow: 0 10px 20px rgba(0,0,0,0.5); border: 2px solid #444;
            background: #333; display: flex; align-items: center; justify-content: center;
        }
        .fbpH-book-cover img { width: 100%; height: 100%; object-fit: cover; }
        .fbpH-book-cover i { font-size: 40px; color: #666; }
        .fbpH-book-title {
            margin-top: 10px; font-size: 14px; font-weight: 500; color: #ccc;
            font-family: var(--fbpH-text-bn); text-shadow: 0 2px 5px rgba(0,0,0,0.8);
        }
        .fbpH-book-card:hover .fbpH-book-cover { border-color:rgba(255,255,255); }
        .fbpH-book-card:hover .fbpH-book-title { color: #fff; }

        /* --- Popup Overlay (Converted to Inline) --- */
        .fbpH-overlay {
            position: relative !important; /* 🌟 Fixed for inline display */
            z-index: 1 !important; 
            width: 100% !important; 
            height: 100% !important; 
            background: transparent !important; 
            display: flex !important; 
            flex-direction: column; 
            opacity: 1 !important; 
            visibility: visible !important;
        }
        #fbpH-btn-close { display: none !important; } /* 🌟 Hide close button inline */

        /* --- Sidebar & Search Panel --- */
        .fbpH-sidebar, .fbpH-search-panel {
            position: absolute; left: 0; top: 0; bottom: var(--fbpH-footer-h); 
            width: 300px; 
            background: rgba(20, 20, 20, 0.98); z-index: 10004;
            transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
            border-right: 1px solid #333;

            text-align: left;
            display: flex; flex-direction: column; overflow: hidden; padding: 0;
        }
        .fbpH-sidebar.active, .fbpH-search-panel.active { transform: translateX(0); }

        .fbpH-sidebar-header {
            flex-shrink: 0; display: flex; justify-content: space-between; align-items: center;
            padding: 20px; border-bottom: 1px solid #333;
            background: rgba(25, 25, 25, 1); color: white; 
            font-family: var(--fbpH-text-bn); font-size: 18px; z-index: 2;
        }
        #fbpH-thumb-container { flex-grow: 1; overflow-y: auto; padding: 15px; }
        
/* Search UI */
.fbpH-search-box { 
    padding: 15px; 
    border-bottom: 1px solid #333; 
    display: flex; 
    align-items: stretch; 
    gap: 8px; 
}

.fbpH-search-input { 
    flex: 1; 
    background: #333; 
    border: 1px solid #444; 
    padding: 10px 15px; 
    color: #fff; 
    border-radius: 4px; 
    outline: none; 
    font-size: 14px;
    height: 42px; 
    box-sizing: border-box;
}

.fbpH-search-btn-go {
    background: var(--fbpH-accent); 
    border: none; 
    padding: 0 20px; 
    border-radius: 4px; 
    cursor: pointer; 
    color: #fff; 
    font-weight: 700;
    font-size: 18px;
    height: 42px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-sizing: border-box;
    transition: background 0.2s;
}

.fbpH-search-btn-go:hover {
    background: #d4ac0d; 
}
        #fbpH-search-results { flex-grow: 1; overflow-y: auto; padding: 10px; }
        .fbpH-search-item {
            padding: 10px; border-bottom: 1px solid #333; cursor: pointer; transition: 0.2s;
        }
        .fbpH-search-item:hover { background: #333; }
        .fbpH-search-page-num { font-size: 12px; color: var(--fbpH-accent); font-weight: bold; margin-bottom: 4px; }
        .fbpH-search-text { font-size: 13px; color: #ccc; line-height: 1.4; }
        .fbpH-search-highlight { color: #fff; background: rgba(241, 196, 15, 0.3); padding: 0 2px; }

        .fbpH-sidebar-close-icon {
            cursor: pointer; color: #aaa; transition: 0.2s; font-size: 20px;
            width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
            border-radius: 50%; background: rgba(255,255,255,0.08);
        }
        .fbpH-sidebar-close-icon:hover { color: #f1c40f; background: rgba(255,255,255,0.15); transform: rotate(90deg); }

        .fbpH-thumb-item { cursor: pointer; margin-bottom: 25px; text-align: center; opacity: 0.85; transition: all 0.2s ease; }
        .fbpH-thumb-item:hover, .fbpH-thumb-item.active { opacity: 1; transform: translateY(-3px); }
        .fbpH-thumb-item canvas, .fbpH-thumb-item img { width: 100%; height: auto; border-radius: 5px; border: 2px solid #444; display: block; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
        .fbpH-thumb-item.active canvas { border-color: var(--fbpH-accent); box-shadow: 0 0 15px rgba(241, 196, 15, 0.4); }
        .fbpH-thumb-label { color: #aaa; font-size: 12px; margin-top: 6px; font-weight: 500; }

        /* --- Book Stage --- */
        .fbpH-stage {
            position: absolute; top: 0; left: 0; width: 100%;
            height: calc(100% - var(--fbpH-footer-h)); 
            display: flex; justify-content: center; align-items: center;
            perspective: 2500px; overflow: hidden; 
            cursor: grab;
            user-select: text !important;
            -webkit-user-select: text !important;
        }
        .fbpH-stage.grabbing { cursor: grabbing !important; }

        .fbpH-zoom-layer {
            transform-origin: center center;
            display: flex; justify-content: center; align-items: center;
            position: absolute; 
            will-change: transform; 
            transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
        }
        .fbpH-zoom-layer.no-transition { transition: none !important; }

        .stf__wrapper { box-shadow: 0 2px 6px rgba(0,0,0,0.7) !important; }

        /* --- Controls --- */
        .fbpH-controls {
            position: absolute; bottom: 0; left: 0; width: 100%; height: var(--fbpH-footer-h); 
            background: rgba(15, 15, 15, 0.95); border-top: 1px solid rgba(255,255,255,0.1);
            display: flex; align-items: center; justify-content: center; gap: 15px; 
            z-index: 10005; 
            transform: translateY(100%); 
            will-change: transform; 
            transition: transform 0.3s ease-out; 
            margin: 0; padding: 0 15px !important; box-sizing: border-box; justify-content: flex-start !important;
        }
        .fbpH-controls.active { transform: translateY(0); }

        .fbpH-btn {
            flex-shrink: 0; background: transparent; border: none; color: #ccc; 
            font-size: 18px; width: 45px; height: 45px; border-radius: 8px;
            cursor: pointer; transition: 0.2s; 
            display: flex !important; align-items: center !important; justify-content: center !important;
        }
        .fbpH-btn:hover { background: rgba(255,255,255,0.1); color: #fff; transform: translateY(-2px); }
        .fbpH-btn.active-btn { color: #111; background: var(--fbpH-accent); box-shadow: 0 0 10px var(--fbpH-accent); }
        .fbpH-divider { width: 1px; height: 25px; background: rgba(255,255,255,0.2); margin: 0 5px; }

        /* 🌟 AutoPlay & Bookmark Text Disappearing FIX 🌟 */
        #fbpH-root #fbpH-btn-autoplay, #fbpH-root #fbpH-btn-bookmark { font-size: 0 !important; width: auto; padding: 0 15px; }
        #fbpH-root #fbpH-btn-autoplay i, #fbpH-root #fbpH-btn-bookmark i { font-size: 14px !important; margin-right: 6px !important; }
        #fbpH-root #fbpH-btn-autoplay::after { content: 'AutoPlay'; font-size: 14px !important; font-weight: 500; font-family: var(--fbpH-text-main); }
        #fbpH-root #fbpH-btn-autoplay.active-btn::after { content: 'Pause' !important; }
        #fbpH-root #fbpH-btn-bookmark::after { content: 'Bookmark'; font-size: 14px !important; font-weight: 500; font-family: var(--fbpH-text-main); }

        .fbpH-page-input {
            width: 50px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); 
            padding: 8px 0; border-radius: 4px; color: #fff; font-family: var(--fbpH-text-main); font-weight: 600;
            font-size: 14px; text-align: center; outline: none; margin: 0;
        }
        .fbpH-total-page { color: #ccc; font-size: 13px; font-weight: 500; margin-left: 8px; margin-right: 5px; }

        /* Page Info on Mobile Bar */
        .fbpH-page-info-mobile { color: #ccc; font-size: 14px; font-weight: 500; margin-left: 15px; font-family: var(--fbpH-text-main); }
        #fbpH-page-current { color: var(--fbpH-accent); font-weight: bold; }

        /* --- Floating Arrows --- */
        .fbpH-arrow {
            position: absolute; top: 50%; transform: translateY(-50%); width: 60px; height: 100px;
            display: flex !important; align-items: center !important; justify-content: center !important;
            color: rgba(255, 255, 255, 0.4); font-size: 40px; cursor: pointer; z-index: 10003;
            transition: all 0.3s ease; user-select: none; background: rgba(0,0,0,0.0); border-radius: 10px;
        }
        .fbpH-arrow:hover { background: rgba(0,0,0,0.3); color: var(--fbpH-accent); transform: translateY(-50%) scale(1.1); }
        .fbpH-prev { left: 20px; } .fbpH-next { right: 20px; }

        /* --- Loader & Toast --- */
        .fbpH-loader-container {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.95); z-index: 11000;
            display: none; flex-direction: column; justify-content: center; align-items: center;
        }
        .fbpH-loader {
            width: 50px; height: 50px; border: 4px solid #333; border-top-color: var(--fbpH-accent);
            border-radius: 50%; animation: fbpH-spin 0.8s infinite linear;
        }
        .fbpH-loader-text { color: #ccc; margin-top: 20px; font-family: var(--fbpH-text-bn); font-size: 18px; }
        @keyframes fbpH-spin { 100% { transform: rotate(360deg); } }

        .fbpH-toast {
            position: fixed; top: 80px; right: 20px; background: var(--fbpH-accent); color: #111;
            padding: 10px 25px; border-radius: 5px; opacity: 0; transition: 0.4s; z-index: 12000;
            font-family: var(--fbpH-text-bn); font-weight: 700; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
            pointer-events: none;
        }
        .fbpH-toast.show { opacity: 1; transform: translateY(10px); }

        /* =========================================
           CORE INTERACTION LAYERS
        ========================================= */
        .fbpH-page { 
            background-color: #ffffff; overflow: hidden; display: flex; align-items: center; justify-content: center; 
            position: relative; pointer-events: auto !important; backface-visibility: hidden;
            transform: translate3d(0, 0, 0); will-change: transform; perspective: 1000px;
        }
        .fbpH-page canvas { 
            position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; 
            object-fit: fill; display: block; z-index: 1; pointer-events: none !important; 
        }
        .textLayer {
            position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            z-index: 10; opacity: 1; mix-blend-mode: normal; pointer-events: auto !important; line-height: 1.0;
        }
        .textLayer > span { color: transparent !important; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
        .textLayer ::selection { background: rgba(0, 110, 255, 0.3); color: transparent; }

        .annotationLayer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; pointer-events: none; }
        .annotationLayer .linkAnnotation { position: absolute; z-index: 101; cursor: pointer !important; pointer-events: auto !important; border: 1px solid transparent; }
        .annotationLayer .linkAnnotation > a { display: block; width: 100%; height: 100%; border: none; background: rgba(0, 255, 255, 0); }
        .annotationLayer .linkAnnotation > a:hover { background: rgba(255, 255, 0, 0.2); box-shadow: 0 0 5px rgba(0,0,0,0.2); }

        .stf__item.-folding .textLayer, .stf__item.-turning .textLayer { display: none !important; }
		.fbpH-grabbing-mode * { user-select: none !important; -webkit-user-select: none !important; }	
		
        /* --- Search Highlight CSS --- */
        .fbpH-highlight-match { background-color: rgba(255, 255, 0, 0.6) !important; border-radius: 2px; box-shadow: 0 0 2px rgba(0,0,0,0.2); cursor: pointer; }

        /* 🌟 Prevent WP Scroll Freeze 🌟 */
        body.fbpH-locked { overflow: auto !important; height: auto !important; touch-action: auto !important; }

        /* --- Hidden More Menu --- */
        .fbpH-more-menu {
            position: absolute; bottom: 70px; right: 10px; width: 220px;
            background: rgba(20, 20, 20, 0.95); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px;
            display: none; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 10010; backdrop-filter: blur(10px);
            animation: slideUp 0.3s ease;
        }
        .fbpH-more-menu.active { display: flex; }
        @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

        .fbpH-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
        .fbpH-menu-item {
            background: rgba(255,255,255,0.1); border: none; color: #fff; padding: 10px; border-radius: 6px;
            font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: 0.2s;
        }
        .fbpH-menu-item:hover { transform: translateY(-2px); color: #fff !important; }
        .fbpH-menu-item i { font-size: 18px; }

        .fbpH-menu-footer { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; text-align: center; color: #ccc; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 5px; }



        /* --- Mobile Responsive Fixes --- */
        @media (max-width: 650px) {
            .fbpH-controls { padding: 0 10px !important; gap: 5px; justify-content: space-between !important; }
            .fbpH-sidebar, .fbpH-search-panel { width: 100%; max-width: 280px; }
            .fbpH-divider { display: none; }
            .fbpH-arrow { width: 40px; height: 60px; font-size: 25px; background: rgba(0,0,0,0.2); }
            .fbpH-prev { left: 5px; } .fbpH-next { right: 5px; }
            .fbpH-btn { width: 40px; height: 40px; font-size: 16px; }
            .fbpH-page-info-mobile { font-size: 12px; margin-left: 10px; }
            #fbpH-root #fbpH-btn-autoplay::after, #fbpH-root #fbpH-btn-bookmark::after { display: none !important; } /* Hide text on small mobile */
        }

        @media (max-width: 768px) {
            .stf__wrapper { box-shadow: none !important; background: transparent !important; }
            .fbpH-page { box-shadow: none !important; border: none !important; border-right: 1px solid #ddd; }
            .stf__item { box-shadow: none !important; }
        }