/*
 * ════════════════════════════════════════════════════════════════════════════
 * LOADING ANIMATION MODULE
 * ════════════════════════════════════════════════════════════════════════════
 * Animações suaves para transição entre skeleton e cards reais.
 * Uso: Importar após LandingStyle.css
 */

/* Fade-out suave para os skeletons quando os dados chegarem */
.skeleton.fade-out {
  animation: fadeOut 0.6s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* Cards começam invisíveis e fazem fade-in com movimento sutil */
.card {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Efeito staggered: cada card aparece com um pequeno delay */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }

/* Loading spinner como alternativa (caso queira usar) */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--card-color, #c0832a);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 60px auto;
}

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

/* Mensagem de loading centralizada */
.loading-message {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  padding: 20px;
  grid-column: 1 / -1;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Container do grid durante loading */
.grid.loading {
  min-height: 400px;
  position: relative;
}

/* Transição suave do total counter */
.total-counter {
  transition: opacity 0.3s ease;
}

.total-counter.hidden {
  opacity: 0;
}

/* Shimmer aprimorado para skeleton (opcional, melhoria do existente) */
.skeleton .skel-block {
  position: relative;
  overflow: hidden;
}

.skeleton .skel-block::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: shimmerOverlay 2s infinite;
}

@keyframes shimmerOverlay {
  to {
    left: 100%;
  }
}
