.flipbook-page {
    min-height: calc(100vh - 90px);
    padding: 70px 20px 30px;
    margin-top: 90px;
    background:
        radial-gradient(circle at top right, rgba(42, 187, 223, 0.10), transparent 20%),
        radial-gradient(circle at bottom left, rgba(42, 187, 223, 0.08), transparent 25%),
        #f5f1ea;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
    border-radius: 10px;
}

[data-theme="dark"] .flipbook-page {
    background:
        radial-gradient(circle at top right, rgba(42, 187, 223, 0.10), transparent 20%),
        radial-gradient(circle at bottom left, rgba(42, 187, 223, 0.08), transparent 25%),
        #111;
}

.flipbook-shell {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

.flipbook-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    position: relative;
    z-index: 5;
    flex-wrap: wrap;
    direction: rtl;
    flex-direction: row;
}

.fb-btn {
    --fb-btn-size: 50px;

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: var(--fb-btn-size);
    height: var(--fb-btn-size);
    min-width: var(--fb-btn-size);
    min-height: var(--fb-btn-size);
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #2abbdf;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    vertical-align: middle;
    appearance: none;
    -webkit-appearance: none;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 0.22s ease,
        background 0.22s ease,
        box-shadow 0.22s ease,
        opacity 0.22s ease;
    box-shadow: 0 10px 30px rgba(42, 187, 223, 0.28);
}
.fb-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    font-size: 1.6rem;
    font-weight: 500;
    pointer-events: none;
    transform: translateY(-1px);
}

.fb-download-btn .fb-btn-icon {
    font-size: 1.35rem;
    transform: translateY(-1px);
}

.fb-btn:hover {
    transform: translateY(-2px);
    background: #21afd1;
    box-shadow: 0 14px 34px rgba(42, 187, 223, 0.32);
}

.fb-btn:active {
    transform: scale(0.96);
}

.fb-btn:focus-visible {
    outline: 3px solid rgba(42, 187, 223, 0.25);
    outline-offset: 3px;
}

.fb-btn:disabled,
.fb-btn[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.fb-btn:disabled:hover,
.fb-btn[aria-disabled="true"]:hover {
    transform: none;
    background: #2abbdf;
    box-shadow: none;
}

[data-theme="dark"] .fb-btn {
    background: #2abbdf;
    color: #fff;
}

.fb-status {
    min-width: 90px;
    text-align: center;
    font-weight: 700;
    color: var(--text-primary, #111);
    font-size: 1rem;
}

[data-theme="dark"] .fb-status {
    color: #f5f1ea;
}

.fb-separator {
    opacity: 0.5;
    margin: 0 6px;
}

.flipbook-root {
    width: 100%;
    min-height: 74vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.flipbook {
    width: 1080px;
    max-width: 100%;
    height: 700px;
    margin: 0 auto;
}

.page {
    background: #fff;
    overflow: hidden;
}

.page-content {
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-content canvas {
    width: 96%;
    height: 96%;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.flipbook-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 241, 234, 0.75);
    backdrop-filter: blur(6px);
    z-index: 10;
    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

[data-theme="dark"] .flipbook-loader {
    background: rgba(17, 17, 17, 0.7);
}

.flipbook-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(0, 0, 0, 0.12);
    border-top-color: #2abbdf;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

/* PageFlip overrides */
.stf__parent {
    margin: 0 auto;
}

.stf__block {
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.16);
    border-radius: 10px;
}

.stf__item {
    background: #fff;
}

@media (max-width: 1200px) {
    .flipbook {
        width: 940px;
        height: 620px;
    }
}

@media (max-width: 992px) {
    .flipbook-page {
        padding: 100px 12px 20px;
    }

    .flipbook {
        width: 88vw;
        height: 58vw;
        max-height: 74vh;
    }

    .fb-btn {
        --fb-btn-size: 46px;
    }
}

@media (max-width: 768px) {
    .flipbook-root {
        min-height: 68vh;
    }

    .flipbook {
        width: 88vw;
        height: 124vw;
        max-height: 74vh;
    }

    .fb-status {
        font-size: 0.95rem;
    }

    .flipbook-toolbar {
        gap: 10px;
    }

    .fb-btn {
        --fb-btn-size: 44px;
    }
}

