/* =========================
   BOOK CARD (BASE)
   ========================= */

.book-item {
  background: #b8a7a7;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: #eaeaea;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);

  transition: 
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.book-item:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* Reset link styles */
.book-item a {
  color: inherit;
  text-decoration: none;
}

.book-item h3 {
  color: #ffffff;
  margin: 8px 0 4px;
}

.book-item p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

/* =========================
   BOOK IMAGE
   ========================= */

.book-item img {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* =========================
   GRID VIEW
   ========================= */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  padding: 20px;
}

#gridView {
  max-width: 1100px;
  margin: 0 auto;
}

#gridView .book-item {
  max-width: 160px;
  margin: 0 auto;
  font-size: 0.9rem;
}

/* =========================
   MARQUEE VIEW
   ========================= */

.book-marquee {
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
  position: relative;
}

.book-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 120s linear infinite;
}

.book-marquee:hover .book-marquee-track {
  animation-play-state: paused;
}

.book-marquee-content {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

/* Smaller cards inside marquee */
.book-marquee .book-item {
  min-width: 140px;
  padding: 12px;
  font-size: 0.85rem;
}

.book-marquee .book-item img {
  max-width: 100px;
}

/* =========================
   MARQUEE ANIMATION
   ========================= */

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* =========================
   TOGGLE BUTTON
   ========================= */

#toggleViewBtn {
  display: block;
  margin: 20px auto;
  padding: 10px 24px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease;
}

#toggleViewBtn:hover {
  background: #666;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 648px) {
  .book-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
  }

  .book-item {
    font-size: 0.9rem;
  }
}
