.book {
    transition: opacity 0.4s 0.2s;
}

.cover, .page-img{
    width: 100%;
    height: 100%;
    border-radius: 4px;
    margin: 0!important;
    padding: 0!important;
}

.page {
    background-color: #111111;
    float: left;
    background: left top no-repeat;
    background-size: cover;
    padding: 2em;
}

.page:nth-child(even) {
    clear: both;
}

.book {
    perspective: 250vw;
    height: 50%;
}

#idz-preview {
    background: url('../images/DJI_0733.jpg') center center no-repeat;
    background-size: cover;
}

.book-container {
    padding: 50px 0px;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-user-select: none;
}

.book .pages {
    width: 80vw;
    height: 55vw;
    max-height: 600px;
    max-width: 800px;
    transform: rotate3d(0,1,1,2deg);
    position: relative;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    border-radius: 4px;
}

.book .page {
    float: none;
    clear: none;
    margin: 0;
    position: absolute;
    top: 0;
    width: 40vw;
    height: 55vw;
    max-width: 400px;
    max-height: 600px;
    transform-origin: 0 0;
    transition: transform 1s;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    cursor: pointer;
    user-select: none;
    background-color: #f0f0f0;
    /*box-shadow: 2px 3px 3px 0px rgba(80,80,80,0.2);*/
}

.book .page:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.1s;
    z-index: 2;
}

.book .page:nth-child(odd) {
    pointer-events: all;
    transform: rotateY(0deg);
    right: 0;
    border-radius: 0 4px 4px 0;
    background-image: linear-gradient(to right, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, 0) 10%);
}

.book .page:nth-child(odd):hover {
    transform: rotateY(-15deg);
}

.book .page:nth-child(odd):hover:before {
    background: rgba(0, 0, 0, 0.03);
}

.book .page:nth-child(odd):before {
    background: rgba(0, 0, 0, 0);
}

.book .page:nth-child(even) {
    pointer-events: none;
    transform: rotateY(180deg);
    transform-origin: 100% 0;
    left: 0;
    border-radius: 4px 0 0 4px;
    border-color: black;
    background-image: linear-gradient(to left, rgba(0, 0, 0, .12) 0%, rgba(0, 0, 0, 0) 10%);
}

.book .page:nth-child(even):before {
    background: rgba(0, 0, 0, 0.2);
}

.book .page.grabbing {
    transition: none;
}

.book .page.flipped:nth-child(odd) {
    pointer-events: none;
    transform: rotateY(-180deg);
}

.book .page.flipped:nth-child(odd):before {
    background: rgba(0, 0, 0, 0.2);
}

.book .page.flipped:nth-child(even) {
    pointer-events: all;
    transform: rotateY(0deg);
}

.book .page.flipped:nth-child(even):hover {
    transform: rotateY(15deg);
}

.book .page.flipped:nth-child(even):hover:before {
    background: rgba(0, 0, 0, 0.03);
}

.book .page.flipped:nth-child(even):before {
    background: rgba(0, 0, 0, 0);
}

*,
* :before,
*:after {
    box-sizing: border-box;
}

.page:nth-child(odd) {
    background-position: right top;
}

.quote {
    font-style: italic;
    color: #555;
    padding: 0px 10px 0px 30px;
}

.quote-author {
    text-align: right;
    display: block;
    color: black;
}

/* Animation for the first page to indicate interactivity */
@keyframes breathe-page {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(-20deg);
    }
}

.book .page:first-child {
    animation: breathe-page 3s ease-in-out infinite;
    animation-delay: 1s; /* Start animation 2 seconds after page load */
}

/* Stop animation when user hovers over the book to avoid interference */
.book:hover .page:first-child {
    animation: none;
}

/* Stop animation once any page has been flipped */
.book .page.flipped ~ .page:first-child,
.book .page:first-child.flipped {
    animation: none;
}