/* ================================
   File: components/book-card/book-card.css
   Description: Styling for book card layout, animation, and 3D hover effects
   Updated: Preserved size, fixed alignment & spacing, made cover flush
   ================================= */

.book-card {
  width: 240px;
  height: 360px;
  perspective: 1000px;
  cursor: pointer;
  margin: 1rem;
  flex-shrink: 0;
  box-sizing: border-box;

  /* Entrance animation */
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: fadeUp 0.6s ease-out forwards;

  /* Needed for touch support */
  touch-action: none;
}

.book-card:nth-child(1) { animation-delay: 0.1s; }
.book-card:nth-child(2) { animation-delay: 0.2s; }
.book-card:nth-child(3) { animation-delay: 0.3s; }
/* Add more delays as needed */

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.book-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, #111 0%, #1e1e1e 20%, #111 100%);
  border-radius: 6px;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  box-shadow: 10px 20px 40px rgba(0, 0, 0, 0.4);
  will-change: transform;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  backface-visibility: hidden;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
}

.book-cover {
  width: 100%;
  height: 100%;
  flex: 1;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
}

.book-info {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  text-align: center;
  color: #f3f3f3;
  box-sizing: border-box;
}

.book-info h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: bold;
}

.book-info p {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: #ccc;
}

