#book_with_controls {
  width: 100%;
  height: auto;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#book {
  position: relative;
  width: 80%;
  height: 700px;
  overflow: hidden;
}

.page {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.page:nth-child(odd) {
  left: 0;
  transform-origin: left center;
}

.page:nth-child(even) {
  left: 50%;
  transform-origin: right center;
}

.page canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.page.flipped {
  transform: rotateY(-180deg);
  z-index: 2;
}

.controls {
  margin-top: 20px;
  text-align: center;
}

.controls button {
  padding: 10px;
}
.modal-overlay_book_Flip {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay_book_Flip .modal-content {
  background: #000000 !important;
  width: 100%;
  /* max-width: fit-content; */
  padding: 50px 0px 21px;
  border-radius: 10px;
  position: relative;
}

.modal-overlay_book_Flip .modal-close {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 28px;
  cursor: pointer;
  color: white;
  font-size: 30px;
}

@media (max-width: 768px) {
  /* #book .page {
    width: 100%; 
  } */
}

/* Modal styling */
.modal-overlay_book_Flip {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  background: white;
  padding: 20px;
  max-width: 90%;
  overflow: hidden;
}

.controls {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
}

@media (max-width: 1200px) {
  #book {
    width: 90%;
  }
}

@media (max-width: 920px) {
  #book {
    width: 100%;
  }
}
@media (max-width: 768px) {
  /* For small screens, display one page at a time */
  #book .page {
    width: 100%; /* Full width for one page */
  }
  .page:nth-child(even) {
    left: 0;
    transform-origin: right center;
  }

  .controls {
    display: block;
    text-align: center;
  }

  .controls button {
    padding: 10px 20px;
  }
}
