/* Flipbook Modal Styles */
#flipbook-modal {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.flipbook-container {
    perspective: 2000px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    opacity: 0;
    /* Hidden initially, shown by JS */
    transition: opacity 0.5s ease-in-out;
}

/* Controls Styles */
.flipbook-controls button {
    transition: all 0.3s ease;
}

.flipbook-controls button:hover {
    transform: scale(1.1);
}

.flipbook-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

#flipbook-loader {
    flex-direction: column;
}

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

/* Page styling within flipbook */
.page-wrapper {
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

canvas.page-canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
}