/* Book Showcase Styles */

/* Consolidated Container Styles */
.book-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  /* Reduced from 1200px for better portrait aspect ratio */
  height: 700px;
  /* Increased from 600px */
  margin: 0 auto;
  perspective: 1500px;
  transform-style: preserve-3d;
}

.book-spine {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 100%;
  z-index: 10;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.book-pages {
  position: absolute;
  left: 60px;
  top: 0;
  width: calc(100% - 60px);
  height: 100%;
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  gap: 0;
}

.book-page {
  width: 50%;
  height: 100%;
  position: relative;
  background: #fff;
  transform-origin: center;
  transition: transform 0.6s cubic-bezier(0.645, 0.045, 0.355, 1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  transform-style: preserve-3d;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.book-page.left {
  border-radius: 15px 0 0 15px;
  transform: rotateY(0deg);
  border-right: 2px solid #ddd;
  transform-origin: right center;
}

.book-page.right {
  border-radius: 0 15px 15px 0;
  transform: rotateY(0deg);
  transform-origin: left center;
}

.book-content {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.book-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.page-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 10%);
  border-radius: inherit;
  pointer-events: none;
}

.book-navigation {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 10;
}

/* Updated Blue Button Styles */
.book-nav-btn {
  background: #3B82F6;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
}

.book-nav-btn:hover {
  background: #2563EB;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.5);
}

.book-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  background: #9CA3AF;
  box-shadow: none;
}

.page-number {
  position: absolute;
  bottom: 20px;
  font-size: 14px;
  color: #666;
}

.left .page-number {
  right: 20px;
}

.right .page-number {
  left: 20px;
}

.book-page.active {
  transform: rotateY(0deg) translateZ(0px);
}

.book-page.inactive {
  transform: rotateY(-10deg) translateZ(-50px);
}

.book-controls {
  z-index: 20;
}

/* Legacy controls (kept just in case) */
.prev-page,
.next-page {
  transition: all 0.3s ease;
}

.prev-page:hover {
  transform: scale(1.1) translateY(-2px);
}

.next-page:hover {
  transform: scale(1.1) translateY(2px);
}

/* Flip animations */
.book-page.right.flip {
  transform: rotateY(-180deg);
  z-index: 30;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.book-page.left.flip-left {
  transform: rotateY(180deg);
  z-index: 30;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.book-page .book-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  backface-visibility: hidden;
}

.book-page .book-front {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.book-page {
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Consolidated Responsive adjustments */
@media (max-width: 768px) {
  .book-container {
    height: 500px;
    /* Reduced height for mobile, but keeps portrait ratio */
  }

  .book-navigation {
    bottom: -60px;
  }

  .book-nav-btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  .book-spine {
    width: 40px;
  }

  .book-pages {
    left: 40px;
    width: calc(100% - 40px);
  }

  .book-controls {
    right: -12px;
  }

  .prev-page,
  .next-page {
    width: 40px;
    height: 40px;
  }
}