/* ================================
   Global page entrance
   ================================ */

.page {
  animation: pageEnter 0.4s ease-out both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   Hero
   ================================ */

.hero {
  animation: heroFade 0.5s ease-out both;
}

@keyframes heroFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   Search hint animation
   ================================ */

.search-input {
  animation: searchPulse 1.1s ease-out 0.4s both;
}

@keyframes searchPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(37, 99, 235, 0);
  }
}

/* ================================
   Tool cards – entrance
   ================================ */

.tool-card {
  animation: cardIn 0.35s ease-out both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:nth-child(1) { animation-delay: 0.04s; }
.tool-card:nth-child(2) { animation-delay: 0.08s; }
.tool-card:nth-child(3) { animation-delay: 0.12s; }
.tool-card:nth-child(4) { animation-delay: 0.16s; }

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover – premium feedback */

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* ================================
   Category underline animation
   ================================ */

.category-title {
  position: relative;
}

.category-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 3px;
  background: var(--primary);
  animation: underlineGrow 0.45s ease-out forwards;
}

@keyframes underlineGrow {
  to {
    width: 100%;
  }
}

/* ================================
   Favorite button feedback
   ================================ */

.favorite-btn.active {
  animation: favoritePop 0.3s ease-out;
}

@keyframes favoritePop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* Optional sparkle */

.favorite-btn.active::after {
  content: "★";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.6rem;
  opacity: 0;
  animation: sparkle 0.4s ease-out forwards;
}

@keyframes sparkle {
  to {
    opacity: 1;
  }
}

/* ================================
   Footer entrance
   ================================ */

footer {
  animation: footerIn 0.4s ease-out both;
}

@keyframes footerIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   Reduced motion
   ================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
