/* ===== Animations ===== */

/* Floating elements on landing page */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* Floating decorations */
.float { animation: float 3s ease-in-out infinite; }
.float-slow { animation: float-slow 4s ease-in-out infinite; }
.float-delay-1 { animation-delay: 0.5s; }
.float-delay-2 { animation-delay: 1s; }
.float-delay-3 { animation-delay: 1.5s; }

/* Entry animations */
.animate-in {
  opacity: 0;
  animation: fade-in-up 0.6s ease forwards;
}

.animate-in:nth-child(1) { animation-delay: 0.1s; }
.animate-in:nth-child(2) { animation-delay: 0.2s; }
.animate-in:nth-child(3) { animation-delay: 0.3s; }
.animate-in:nth-child(4) { animation-delay: 0.4s; }

.bounce-in {
  animation: bounce-in 0.6s ease forwards;
}

/* Page transition for reader */
.page-enter {
  animation: fade-in-up 0.4s ease forwards;
}

.page-exit {
  animation: fade-in-up 0.3s ease reverse forwards;
}

/* Hover wiggle for book cards */
.book-card:hover .cover {
  animation: wiggle 0.4s ease;
}

/* Decorative floating elements on hero */
.hero-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.6;
  font-size: 32px;
}

.hero-deco:nth-child(1) {
  top: 15%;
  left: 10%;
  animation: float 3s ease-in-out infinite;
}

.hero-deco:nth-child(2) {
  top: 25%;
  right: 12%;
  animation: float-slow 4s ease-in-out infinite 0.5s;
}

.hero-deco:nth-child(3) {
  bottom: 20%;
  left: 15%;
  animation: float 3.5s ease-in-out infinite 1s;
}

.hero-deco:nth-child(4) {
  bottom: 30%;
  right: 8%;
  animation: float-slow 3s ease-in-out infinite 0.3s;
}

.hero-deco:nth-child(5) {
  top: 40%;
  left: 5%;
  animation: float 4s ease-in-out infinite 0.7s;
}

/* Progress bar animation */
@keyframes progress-fill {
  from { width: 0; }
}

.progress-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  animation: progress-fill 0.6s ease forwards;
}
