/* ======================================================= */
/* --- SIDE CONTROL BUTTONS (EXPANDABLE) --- */
/* ======================================================= */

.side-control-btn {
    position: fixed;
    z-index: 50002;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: none;
    border-radius: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.3s ease-in-out;
    white-space: nowrap;
    opacity: 0.30;                 /* 70% transparent when inactive */
    transition: transform 0.3s ease-in-out, opacity 0.25s ease;
}

/* Bring it back to full opacity on interaction */
.side-control-btn:hover,
.side-control-btn:active {
    opacity: 1;
}

/* Icons */
.side-control-btn svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

/* ---------- LEFT SIDE (slide from left) ---------- */
.side-control-btn.left-side {
    left: 0;
    flex-direction: row-reverse;          /* icon stays on the outer edge */
    border-radius: 0 24px 24px 0;
    background: #1e293b;                  /* dark slate */
    transform: translateY(-50%) translateX(calc(-100% + 52px));
}
.side-control-btn.left-side:hover,
.side-control-btn.left-side:active {
    transform: translateY(-50%) translateX(0);
}

/* Vertical positions – good finger spacing */
#side-like-btn      { bottom: 252px; background: #e11d48; }   /* rose/red */
#side-comments-btn  { bottom: 192px; background: #0ea5e9; }   /* sky */
#side-info-btn      { bottom: 132px; background: #6366f1; }   /* indigo */
#side-annotate-btn  { bottom: 72px; background: #d97706; } /* Annotate - amber */
#side-music-btn     { bottom: 12px; background: #7c3aed; } /* Music - violet */

/* ---------- RIGHT SIDE (slide from right) ---------- */
.side-control-btn.right-side {
    right: 0;
    border-radius: 24px 0 0 24px;
    background: #1e40af;                  /* deep blue */
    transform: translateY(-50%) translateX(calc(100% - 52px));
}
.side-control-btn.right-side:hover,
.side-control-btn.right-side:active {
    transform: translateY(-50%) translateX(0);
}

/* Vertical positions */
#side-share-btn       { bottom: 252px; background: #316FF6; } /* facebook blue */
#side-zoom-btn        { bottom: 192px; background: #059669; } /* emerald */
#side-grid-btn        { bottom: 132px; background: #003366; } /* dark blue */
#side-toc-btn         { bottom: 72px; background: #db2777; } /* TOC - pink */
#side-fullscreen-btn  { bottom: 12px;  background: #333333; } /* dark grey */

/* Full-screen icon swap */
body.is-fullscreen #side-fullscreen-btn .icon-expand   { display: none; }
body.is-fullscreen #side-fullscreen-btn .icon-compress { display: block !important; }

/* Like heart states (keep the two-phase switching) */
#side-like-btn.liked .icon-heart-outline { display: none; }
#side-like-btn.liked .icon-heart-filled  { display: block !important; }

/* ---------- Tablet / Phone refinements ---------- */
@media (max-width: 1024px) {
    .side-control-btn {
        padding: 11px 14px;
        font-size: 14px;
        gap: 8px;
    }
    .side-control-btn svg { width: 24px; height: 24px; }

    .side-control-btn.left-side  { transform: translateY(-50%) translateX(calc(-100% + 48px)); }
    .side-control-btn.right-side { transform: translateY(-50%) translateX(calc(100% - 48px)); }

    /* Slightly tighter vertical gaps on tablets */
    #side-like-btn, #side-share-btn       { bottom: 230px; }
    #side-comments-btn, #side-zoom-btn    { bottom: 180px; }
    #side-info-btn, #side-grid-btn        { bottom: 130px; }
    #side-annotate-btn, #side-toc-btn     { bottom: 80px; }
    #side-music-btn, #side-fullscreen-btn { bottom: 30px; }
}

@media (max-width: 480px) {
    .side-control-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    .side-control-btn svg { width: 22px; height: 22px; }

    .side-control-btn.left-side  { transform: translateY(-50%) translateX(calc(-100% + 44px)); }
    .side-control-btn.right-side { transform: translateY(-50%) translateX(calc(100% - 44px)); }

    #side-like-btn, #side-share-btn       { bottom: 230px; }
    #side-comments-btn, #side-zoom-btn    { bottom: 180px; }
    #side-info-btn, #side-grid-btn        { bottom: 130px; }
    #side-annotate-btn, #side-toc-btn     { bottom: 80px; }
    #side-music-btn, #side-fullscreen-btn { bottom: 30px; }
}

/* ================================================================ */
/* Hide all side buttons in landscape phones, keep only Full Screen */
/* ================================================================ */
@media (max-height: 480px) and (orientation: landscape) {
    .side-control-btn {
        display: none !important;
    }
}

/* Hide the old control bar completely */
#controls {
    display: none !important;
}

/* ======================================================= */
/* --- PAGE NAVIGATOR – DISPLAY ONLY (no interaction) --- */
/* ======================================================= */

#page-navigator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    z-index: 50000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;                 /* whole bar is non-interactive */
    
    /* Dim grey → transparent gradient */
    background: linear-gradient(
        to top,
        rgba(30, 30, 30, 0.99) 0%,
        rgba(30, 30, 30, 0.70) 39%,
        rgba(30, 30, 30, 0.35) 75%,
        transparent 100%
    );
    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 680px;
    padding: 0 20px;
}

/* Page numbers */
.page-display {
    min-width: 48px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 450;
    font-size: 15px;
    color: #f1f5f9;
    letter-spacing: 0.3px;
    user-select: none;
    white-space: nowrap;
}

.page-display.total {
    color: #f1f5f9;
    font-weight: 450;
}

/* Slider track only (no thumb) */
.slider-wrapper {
    position: relative;
    flex: 1;
    height: 6px;
    background: rgba(148, 163, 184, 0.3);
    border-radius: 99px;
    overflow: hidden;
}

/* Progress fill */
.slider-wrapper::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 99px;
    transition: width 0.15s ease;
}

/* Completely hide the real range input */
#page-slider {
    display: none !important;
}



/* Hide the old YouTube button on viewer (we replaced it) */
.youtube-tutorial-btn { display: none !important; }