/* Flipbook reader overlay (pdf.js + StPageFlip) */

body.fb-open {
    overflow: hidden;
}

#flipbook-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(20, 26, 34, .96);
    flex-direction: column;
}

#flipbook-overlay.fb-visible {
    display: flex;
}

.fb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: #16202b;
    border-bottom: 1px solid #2c3a4a;
    color: #dfe7ef;
    flex: 0 0 auto;
}

.fb-title {
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
}

.fb-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.fb-controls .btn {
    color: #dfe7ef;
    background: #24303e;
    border: 1px solid #3a4a5d;
}

.fb-controls .btn:hover,
.fb-controls .btn:focus {
    color: #fff;
    background: #31425a;
}

.fb-page-indicator {
    min-width: 90px;
    text-align: center;
    font-size: 13px;
    color: #9fb2c6;
}

.fb-stage {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-height: 0;
    position: relative;
}

.fb-book {
    width: 100%;
    height: 100%;
    max-width: 1180px;
    max-height: calc(100vh - 70px);
}

.fb-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(20, 26, 34, .92);
    color: #dfe7ef;
    font-size: 15px;
    z-index: 5;
}

.fb-loading.fb-hidden {
    display: none;
}

.fb-spinner {
    width: 46px;
    height: 46px;
    border: 4px solid #3a4a5d;
    border-top-color: #efdd13;
    border-radius: 50%;
    animation: fb-spin 1s linear infinite;
}

@keyframes fb-spin {
    to {
        transform: rotate(360deg);
    }
}
