﻿.flipview-container {
    display: flex;
    height: 600px;
    background: #f3f6fb;
}

/* ===============================
           LEFT: PDF VIEWER
        ==================================*/
#flipbookView.flipbook-left {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f6fb;
    border-right: 1px solid #e1e5ed;
    position: relative;
    padding: 12px 0px;
}

.flipbook-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    /*background: #ffffff;*/
    border-radius: 14px;
    /*box-shadow: 0 4px 18px rgba(0, 0, 0, 0.07);*/
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .flipbook-wrap .page {
        background: #ffffff;
        overflow: hidden;
        border-radius: 10px;
        box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
    }

/* ===============================
           LOADING SPINNER
==================================*/
/* Overlay loading phủ lên flipbook */
.loading {
    position: absolute;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.25);
    display: none; /* Flipbook sẽ set thành flex khi loading */
    align-items: center;
    justify-content: center;
}

/* Khung bên trong */
.loading-inner {
    background: #ffffff;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Vòng xoay */
.spinner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    border-top-color: #0066ff;
    animation: spin 0.8s linear infinite;
}

/* animation dùng chung */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ===============================
           FULLSCREEN BUTTON
        ==================================*/
.fullscreen-btn {
    position: absolute;
    top: 0px;
    right: 10px;
    z-index: 9;
    font-size: 20px;
    background: #ffffffd0;
    color: #003366;
    width: 40px;
    height: 40px;
    display: flex;
    align-items:center;
    justify-content:center;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid #d9d9d9;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    transition: 0.25s ease;
}

    .fullscreen-btn:hover {
        background: #ffffff;
        transform: scale(1.1);
    }

/* ===============================
           PREV / NEXT BUTTONS
        ==================================*/
.flip-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9;
    width: 40px;
    height: 40px;
    display: flex;
    align-items:center;
    justify-content: center;
    background: #ffffffdd;
    border: 1px solid #d0d4da;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    color: #003366;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: 0.25s ease;
    opacity: 1;
    pointer-events: auto;
}

    .flip-btn:hover {
        background: #ffffff;
        transform: translateY(-50%) scale(1.12);
    }

#prevView {
    left: 10px;
}

#nextView {
    right: 10px;
}

/* ===============================
           FULLSCREEN MODE
==================================*/
.flipbook-wrap.fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: #000000;
    z-index: 99999;
    border-radius: 0;
}

    .flipbook-wrap.fullscreen .fullscreen-btn {
        top: 18px;
        right: 22px;
    }

body.fullscreen-mode {
    overflow: hidden;
}

/* ===============================
           RIGHT: SIDEBAR PHỤ LỤC
==================================*/
.flipview-sidebar {
    flex: 0.7;
    background: #ffffff;
    border-left: 1px solid #e1e5ed;
    padding: 20px 18px;
    overflow-y: auto;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.04);
}

    .flipview-sidebar h3 {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 10px;
        color: #003366;
    }

    .flipview-sidebar .sidebar-subtitle {
        font-size: 13px;
        color: #6b7280;
        margin-bottom: 16px;
    }

/* ===============================
   TOC / MỤC LỤC STYLE
================================*/
.toc-section-title {
    font-size: 14px;
    font-weight: 800;
    margin: 14px 0 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.toc-red {
    color: #e53935;
}

.toc-green {
    color: #2e7d32;
}

.toc-orange {
    color: #f57c00;
}

.toc-blue {
    color: #1565c0;
}

.toc-purple {
    color: #8e24aa;
}

.toc-pink {
    color: #d81b60;
}

.appendix-item {
    background: #f7f9fc;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e1e5ed;
    cursor: pointer;
    transition: 0.25s ease;
    margin-bottom: 6px;
}

    .appendix-item:hover {
        border-color: #0066ff;
        box-shadow: 0 3px 10px rgba(0, 102, 255, 0.12);
        transform: translateX(2px);
    }

.appendix-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.appendix-page {
    font-weight: 700;
    width: 26px;
    flex-shrink: 0;
    color: #e53935;
    font-size: 14px;
}

.appendix-main {
    flex: 1;
}

.appendix-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.appendix-meta,
.appendix-desc {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.35;
}

/* ===============================
   SMALL SCROLLBAR FOR SIDEBAR
================================*/
/* Chrome, Edge, Safari */
.flipview-sidebar::-webkit-scrollbar {
    width: 6px; /* độ rộng nhỏ */
}

.flipview-sidebar::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 10px;
}

.flipview-sidebar::-webkit-scrollbar-thumb {
    background-color: #c3c8d1;
    border-radius: 10px;
}

    .flipview-sidebar::-webkit-scrollbar-thumb:hover {
        background-color: #aab1bb;
    }

/* Firefox */
.flipview-sidebar {
    scrollbar-width: thin; /* thin = mảnh */
    scrollbar-color: #c3c8d1 #f0f2f5; /* thumb | track */
}

