body {
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: white;
    overflow-x: hidden;
}

body.high-contrast {
    background: #000 !important;
    color: #ffcc00 !important;
}

body.high-contrast .flip-book {
    filter: invert(1) hue-rotate(180deg) contrast(1.5);
}

.accessibility-toolbar {
    position: fixed;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
    flex-wrap: wrap;
    justify-content: center;
}

.accessibility-toolbar button {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    font-size: 1.1rem;
    padding: 8px 15px;
    border-radius: 12px;
}

.accessibility-toolbar button:hover {
    background-color: #ffcc00;
    color: #000;
}

h1 {
    margin: 20px 0 10px 0;
    font-size: 2.2rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90vw;
    height: 75vh;
    margin: 10px 0;
    transition: transform 0.3s ease-in-out;
    transform-origin: center top;
}

.flip-book {
    width: 100%;
    height: 100%;
    transition: opacity 0.5s;
    opacity: 0;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    background-color: transparent;
}

.flip-book.loaded {
    opacity: 1;
}

.page {
    background-color: white;
    overflow: hidden;
}

.page canvas {
    width: 100%;
    height: 100%;
    object-fit: fill; 
}

/* StPageFlip built-in shadow styling support */
.page.--left {
    box-shadow: inset -7px 0 30px -7px rgba(0, 0, 0, 0.2);
}
.page.--right {
    box-shadow: inset 7px 0 30px -7px rgba(0, 0, 0, 0.2);
}

.controls {
    margin-top: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.2);
}

button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

button:hover {
    background-color: white;
    color: #2b5876;
}

#page-info {
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 200px;
}

#page-slider {
    width: 100%;
    cursor: pointer;
    accent-color: #004d40;
}
