@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    display: grid;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    overflow: scroll;
    background: #24b9b5;
    padding: 15px;
    position: relative;
}

.flipbook {
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    margin: auto;
    position: relative;
}

.flipbook .hard {
    background: #990100 !important;
    color: #fff;
    font-weight: bold;
    height: 100%;
}

.flipbook .hard small {
    font-style: italic;
    font-weight: lighter;
    opacity: 0.7;
    font-size: 14px;
}

.flipbook .page {
    background: #24b9b5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 10px;
    border: 1px solid rgba(36, 185, 181, 0.11);
}

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

.flipbook .page small {
    font-size: 14px;
    margin-bottom: 10px;
}

/* Navigation Buttons */
.page-nav {
    position: fixed;
    bottom: 15%;
    height: 120px;
    width: 45px;
    background: rgba(128, 128, 128, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 1000;
    border-radius: 8px;
}

.page-nav:hover {
    background: rgba(128, 128, 128, 0.4);
}

.page-nav.prev {
    left: 10px;
}

.page-nav.next {
    right: 10px;
}

.page-nav::after {
    content: '';
    width: 15px;
    height: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.7);
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    transition: border-color 0.3s ease;
}

.page-nav:hover::after {
    border-color: rgba(255, 255, 255, 0.9);
}

.page-nav.prev::after {
    transform: rotate(-135deg);
    margin-left: 8px;
}

.page-nav.next::after {
    transform: rotate(45deg);
    margin-right: 8px;
}

/* Adjust navigation buttons for mobile */
@media screen and (max-width: 768px) {
    .page-nav {
        width: 35px;
        height: 100px;
        bottom: 20%;
    }

    .page-nav.prev {
        left: 5px;
    }

    .page-nav.next {
        right: 5px;
    }

    .page-nav::after {
        width: 12px;
        height: 12px;
    }
}

@media screen and (max-width: 480px) {
    .page-nav {
        width: 30px;
        height: 80px;
        bottom: 25%;
    }

    .page-nav.prev {
        left: 3px;
    }

    .page-nav.next {
        right: 3px;
    }

    .page-nav::after {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
}

/* Media Queries */
@media screen and (max-width: 720px) {
    body {
        padding: 5px;
    }
    
    .flipbook {
        height: 85vh;
        max-width: 100vw;
    }

    .page img {
        object-fit: fill;
        max-height: 85%;
        width: 100%;
        max-width: 100%;
        display: block;
    }
}

/* Landscape orientation specific styles */
@media screen and (max-width: 720px) and (orientation: landscape) {
    body {
        padding: 5px 15px;
    }

    .flipbook {
        height: 95vh;
        max-width: 100vw;
    }

    .page {
        padding: 5px;
    }

    .page img {
        height: 95%;
        max-height: 95vh;
        width: 100vw;
        max-width: 100%;
        object-fit: fill;
        display: block;
    }
}

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

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

.error-message {
    color: #990100;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}