/* Page transitions */
.view {
  animation: pageFadeIn 0.45s ease both;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered book cards — homepage & catalog */
.book-card {
  animation: cardSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.book-card:nth-child(1) { animation-delay: 0.06s; }
.book-card:nth-child(2) { animation-delay: 0.12s; }
.book-card:nth-child(3) { animation-delay: 0.18s; }
.book-card:nth-child(4) { animation-delay: 0.24s; }
.book-card:nth-child(5) { animation-delay: 0.3s; }
.book-card:nth-child(6) { animation-delay: 0.36s; }
.book-card:nth-child(n+7) { animation-delay: 0.42s; }

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.book-card .book-cover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover .book-cover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(244, 180, 0, 0.1);
}

/* Buttons */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover { transform: translateY(-2px) scale(1.02); }
.btn:active { transform: translateY(0) scale(0.98); }

/* Nav links */
.nav-link::after {
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Empty search state */
.empty-search-state {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  animation: bounceIn 0.6s ease both;
}

.empty-search-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-2);
  animation: gentleBounce 2s ease-in-out infinite;
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.9); }
  60% { opacity: 1; transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Toast */
.toast {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
