.fast-pdf-book-container {
    position: relative;
    background: #2c3e50;
    background: radial-gradient(circle, #34495e 0%, #2c3e50 100%);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', sans-serif;
    width: 100%;
    height: 100%;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.prev-page {
    left: 20px;
}

.next-page {
    right: 20px;
}

.pdf-canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 60px;
    box-sizing: border-box;
}

.book-stage {
    position: relative;
    perspective: 2500px;
    /* Increased perspective for flatter look */
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Page Containers */
.page {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    z-index: 1;
}

.static-left {
    right: 50%;
    transform-origin: right center;
}

.static-right {
    left: 50%;
    transform-origin: left center;
}

/* Flipper */
.flipper {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transform-style: preserve-3d;
    z-index: 10;
    display: none;
}

.flipper-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: transparent;
    /* Changed from white */
    overflow: hidden;
    /* For shadow clipping */
}

.flipper-face.front {
    z-index: 2;
}

.flipper-face.back {
    transform: rotateY(180deg);
    z-index: 1;
}

/* Shadows */
.flip-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

/* Canvas Styles */
canvas {
    display: block;
    background: transparent;
}

/* Animation Classes */
.animating-next .flipper {
    display: block;
    left: 50%;
    transform-origin: left center;
    animation: flipRightToLeft 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

.animating-next .flipper-face.front .flip-shadow {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    animation: shadowIn 0.4s forwards;
}

.animating-next .flipper-face.back .flip-shadow {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    animation: shadowOut 0.4s 0.4s forwards;
    /* Delayed start */
    opacity: 1;
    /* Start visible then fade out */
}

.animating-prev .flipper {
    display: block;
    right: 50%;
    transform-origin: right center;
    animation: flipLeftToRight 0.8s cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

.animating-prev .flipper-face.front .flip-shadow {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    animation: shadowIn 0.4s forwards;
}

.animating-prev .flipper-face.back .flip-shadow {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    animation: shadowOut 0.4s 0.4s forwards;
    opacity: 1;
}

@keyframes flipRightToLeft {
    0% {
        transform: translateY(-50%) rotateY(0deg);
    }

    100% {
        transform: translateY(-50%) rotateY(-180deg);
    }
}

@keyframes flipLeftToRight {
    0% {
        transform: translateY(-50%) rotateY(0deg);
    }

    100% {
        transform: translateY(-50%) rotateY(180deg);
    }
}

@keyframes shadowIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes shadowOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 200;
    transition: background 0.3s;
    text-decoration: none;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.page-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    pointer-events: none;
    z-index: 100;
}

/* Mobile */
@media (max-width: 768px) {

    .static-right,
    .flipper {
        display: none !important;
    }

    .static-left {
        right: auto;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .pdf-canvas-container {
        padding: 0;
        /* Remove padding on mobile */
    }

    .page-indicator {
        bottom: 80px;
        /* Move up to avoid browser bar */
    }

    .close-btn {
        top: 10px;
        right: 10px;
    }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    z-index: 200;
}

#lottie-animation {
    width: 300px;
    height: 300px;
    max-width: 80vw;
    max-height: 80vh;
}