@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;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    background: #ffffff;
    padding: 0;
    margin: 0;
}

.book-container {
    width: 95vw;
    height: calc(95vw / 2);
    position: relative;
    overflow: visible;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.35));
}

.flipbook {
    width: 95vw;
    height: calc(95vw / 2);
    margin: 0;
    padding: 0;
    position: relative;
}

.flipbook .hard {
    background: #ffffff !important;
    color: #fff;
    font-weight: bold;
    border: none;
    position: relative;
}

/* Remove all pseudo-elements by default */
.flipbook .hard::before,
.flipbook .hard::after {
    display: none !important;
}

/* Hide highlights during page turn animation */
.flipbook.hide-highlights .hard::before,
.flipbook.hide-highlights .hard::after {
    opacity: 0 !important;
}

/* Front cover - page 1 - ONLY right edge highlight */
.flipbook .hard:first-of-type::after,
.flipbook > div:first-child .hard::after,
.flipbook .hard.p1::after,
.flipbook [page="1"] .hard::after {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    right: 20px !important;
    bottom: 0 !important;
    width: 4px !important;
    background: linear-gradient(to right, rgba(255,255,255,0.3), transparent) !important;
    pointer-events: none !important;
    z-index: 100 !important;
    opacity: 1;
    
}

/* Explicitly hide left edge on front cover */
.flipbook .hard:first-of-type::before,
.flipbook > div:first-child .hard::before,
.flipbook .hard.p1::before,
.flipbook [page="1"] .hard::before {
    display: none !important;
}

/* Back cover - last page - ONLY left edge highlight */
.flipbook .hard:last-of-type::before,
.flipbook > div:last-child .hard::before,
.flipbook [page]:last-child .hard::before {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 20px !important;
    bottom: 0 !important;
    width: 4px !important;
    background: linear-gradient(to left, rgba(255,255,255,0.3), transparent) !important;
    pointer-events: none !important;
    z-index: 100 !important;
    opacity: 1;
    
}

/* Explicitly hide right edge on back cover */
.flipbook .hard:last-of-type::after,
.flipbook > div:last-child .hard::after,
.flipbook [page]:last-child .hard::after {
    display: none !important;
}

.flipbook.animated {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.flipbook.book-is-closed,
.flipbook.first-page,
.flipbook.last-page {
    box-shadow: none;
}

.flipbook .hard small{
	font-style: italic;
	font-weight: lighter;
	opacity: 0.7;
	font-size: 14px;
}

.flipbook .page {
    background: white;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
    gap: 0;
    border: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.flipbook .page:before, .flipbook .page:after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
}

.flipbook .page:not(.hard):before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.08) 0%, transparent 100%);
}

.flipbook .page:not(.hard):after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.08) 0%, transparent 100%);
}

.page img{
	width: 100%;
	height: 100%;
	margin: auto;
	object-fit: contain;
}

.flipbook .page small{
	font-size: clamp(10px, 1.5vw, 14px);
    margin-bottom: 10px;
}

@media screen and (max-width: 600px) and (orientation: portrait) {
    body {
        padding: 0;
    }
    
    .book-container {
        width: 100vw;
        height: 50vw;
    }
    
    .flipbook {
        width: 100vw;
        height: 50vw;
    }
    
    /* Scale spine highlights for mobile */
    .flipbook .hard:first-of-type::after,
    .flipbook > div:first-child .hard::after,
    .flipbook .hard.p1::after,
    .flipbook [page="1"] .hard::after {
        right: 10px !important;
        width: 2px !important;
    }
    
    .flipbook .hard:last-of-type::before,
    .flipbook > div:last-child .hard::before,
    .flipbook [page]:last-child .hard::before {
        left: 10px !important;
        width: 2px !important;
    }
}

@media screen and (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 0;
    }
    
    .book-container {
        width: 200vh;
        width: 200dvh;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
    }
    
    .flipbook {
        width: 200vh;
        width: 200dvh;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
    }
}

@media screen and (min-height: 601px) and (orientation: landscape) {
    body {
        padding: 0;
    }
    
    .book-container {
        width: 180vh;
        width: 180dvh;
        height: 90vh;
        height: 90dvh;
        max-width: 100vw;
    }
    
    .flipbook {
        width: 180vh;
        width: 180dvh;
        height: 90vh;
        height: 90dvh;
        max-width: 100vw;
    }
}

@media screen and (min-width: 601px) and (max-width: 1024px) and (orientation: portrait) {
    .book-container {
        width: 95vw;
        height: calc(95vw / 2);
    }
    
    .flipbook {
        width: 95vw;
        height: calc(95vw / 2);
    }
}

@media screen and (min-width: 601px) and (max-width: 1024px) and (orientation: landscape) {
    .book-container {
        width: 190vh;
        width: 190dvh;
        height: 95vh;
        height: 95dvh;
        max-width: 100vw;
    }
    
    .flipbook {
        width: 190vh;
        width: 190dvh;
        height: 95vh;
        height: 95dvh;
        max-width: 100vw;
    }
}

@media screen and (max-width: 400px) {
    body {
        padding: 0;
    }
    
    .book-container {
        width: 100vw;
        height: 50vw;
    }
    
    .flipbook {
        width: 100vw;
        height: 50vw;
    }
    
    .flipbook .page small {
        font-size: clamp(8px, 2vw, 12px);
        margin-bottom: 5px;
    }
    
    /* Extra small spine highlights for very small screens */
    .flipbook .hard:first-of-type::after,
    .flipbook > div:first-child .hard::after,
    .flipbook .hard.p1::after,
    .flipbook [page="1"] .hard::after {
        right: 8px !important;
        width: 2px !important;
    }
    
    .flipbook .hard:last-of-type::before,
    .flipbook > div:last-child .hard::before,
    .flipbook [page]:last-child .hard::before {
        left: 8px !important;
        width: 2px !important;
    }
}

@supports (padding: max(0px)) {
    @media screen and (orientation: portrait) {
        body {
            padding-top: max(0px, env(safe-area-inset-top));
            padding-bottom: max(0px, env(safe-area-inset-bottom));
        }
    }
}
/* Page stack edges - using real divs instead of pseudo-elements */
.page-stack-left,
.page-stack-right {
    position: absolute;
    top: 0px;
    bottom: 0px;
    width: 0px;
    transition: width 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

/* Right side stack (pages already read - RTL so this is what grows) */
.page-stack-right {
    left: 100%;
    background: linear-gradient(to left, 
        #999999 0%,
        #a8a8a8 10%, 
        #c0c0c0 30%, 
        #d8d8d8 60%, 
        #e8e8e8 85%,
        #f0f0f0 100%);
    border-radius: 0 3px 3px 0;
    box-shadow: 
        inset 3px 0 5px rgba(0,0,0,0.2),
        -3px 0 8px rgba(0,0,0,0.15);
    /* Create layered page lines effect */
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 0.8px,
            rgba(0,0,0,0.06) 0.8px,
            rgba(0,0,0,0.06) 1.6px
        ),
        linear-gradient(to left, 
            #999999 0%,
            #a8a8a8 10%, 
            #c0c0c0 30%, 
            #d8d8d8 60%, 
            #e8e8e8 85%,
            #f0f0f0 100%);
}

/* Left side stack (pages still to read - RTL so this shrinks) */
.page-stack-left {
    right: 100%;
    background: linear-gradient(to right, 
        #999999 0%,
        #a8a8a8 10%, 
        #c0c0c0 30%, 
        #d8d8d8 60%, 
        #e8e8e8 85%,
        #f0f0f0 100%);
    border-radius: 3px 0 0 3px;
    box-shadow: 
        inset -3px 0 5px rgba(0,0,0,0.2),
        3px 0 8px rgba(0,0,0,0.15);
    /* Create layered page lines effect */
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 0.8px,
            rgba(0,0,0,0.06) 0.8px,
            rgba(0,0,0,0.06) 1.6px
        ),
        linear-gradient(to right, 
            #999999 0%,
            #a8a8a8 10%, 
            #c0c0c0 30%, 
            #d8d8d8 60%, 
            #e8e8e8 85%,
            #f0f0f0 100%);
}