.loader {
    width: 24px;
    height: 24px;
    border: 5px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    text-align: center;
    }

    @keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
} 

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.book-size {
    width: 90vw;
    height: 85vh;
    position: relative;
}

#flipbook-viewport {
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.close-book {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Page Styles */
.page-content {
    background-color: #fdfaf3;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

#book-loader {
    position: absolute;
    color: white;
    font-family: 'Georgia', serif;
    font-style: italic;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* Navigation Buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2.5rem;
    padding: 20px 15px;
    cursor: pointer;
    z-index: 1010;
    transition: background 0.3s, color 0.3s;
    border-radius: 5px;
    user-select: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #a3b18a; /* Your brand green */
}

.prev-btn { left: -60px; }
.next-btn { right: -60px; }

/* Hide arrows on very small screens to avoid clutter */
@media (max-width: 768px) {
    .nav-btn { display: none; }
}

/* Page counter */
#page-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    opacity: 0.8;
}