/**
 * Styling for FlipBook — v1.4.0
 * Layout navigasi yang lebih rapi dan simetris
 */

.flipbook-outer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 90000; /* Menutupi header tema */
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.flipbook-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(160deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: auto;
}

#book-container {
    display: inline-block;
    position: relative;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#book-container canvas { display: block; }

/* ================================================================
   PANEL NAVIGASI (Ditingkatkan)
   ================================================================ */
.flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 280px;
    padding: 5px 12px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    box-sizing: border-box;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Tombol TOC Spesifik ── */
.flipbook-btn-toc {
    background: #6366f1; /* Indigo */
    color: white;
    min-width: auto;
}
.flipbook-btn-toc:hover {
    background: #4f46e5;
}

/* ── Panel TOC (Slide-out Overlay) ── */
.fb-toc-panel {
    position: absolute;
    top: 40px;
    left: 20px;
    width: 280px;
    max-height: calc(100% - 140px);
    background: #1a1a2e;
    z-index: 1000;
    border-radius: 12px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    transform: translateX(-120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
}

.fb-toc-panel.active {
    transform: translateX(0);
}

.fb-toc-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fb-toc-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

#fb-toc-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.fb-toc-list {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    overflow-y: auto;
    flex: 1;
}

.fb-toc-list li a {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.fb-toc-list li a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.fb-toc-list li a .toc-page {
    color: #3b82f6;
    font-weight: bold;
}

/* ── Bagian Tengah (Page Input) ── */
.flipbook-nav-center {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    padding: 3px 10px;
    border-radius: 20px;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

#flipbook-page-go {
    width: 35px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #3b82f6;
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    padding: 0;
    outline: none;
}

.fb-label {
    font-size: 14px;
    color: #94a3b8;
    font-weight: 500;
}

/* ── Tombol ── */
.flipbook-btn {
    border: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: auto;
    justify-content: center;
}

.flipbook-btn-nav {
    background: #3b82f6;
    color: white;
}

.flipbook-btn-nav:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.flipbook-btn-go {
    background: #10b981;
    color: white;
    min-width: auto;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 9px;
}

.flipbook-btn-go:hover {
    background: #059669;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .flipbook-controls {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        border-radius: 0;
        width: 100% !important;
    }
    
    .flipbook-btn {
        width: 100%;
    }
    
    .flipbook-nav-center {
        width: 100%;
        justify-content: center;
        order: -1;
    }
}

/* ── Tombol Home Spesifik ── */
.flipbook-btn-home {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    min-width: auto;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.flipbook-btn-home:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Override parent WP */
.entry-content, .post-content, main, article, .elementor-section {
    overflow: visible !important;
}
