/* ─── Keyframes ──────────────────────────────────────────────────────── */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes tagIn {
  from {
    opacity: 0;
    transform: scale(0.75);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

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

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

@keyframes cardPop {
  0%   { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spinnerRing {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ─── Entrance animations ────────────────────────────────────────────── */

.anima-surgir {
  opacity: 0;
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anima-surgir.atraso-1 { animation-delay: 0.10s; }
.anima-surgir.atraso-2 { animation-delay: 0.20s; }
.anima-surgir.atraso-3 { animation-delay: 0.32s; }
.anima-surgir.atraso-4 { animation-delay: 0.44s; }
.anima-surgir.atraso-5 { animation-delay: 0.56s; }

.anima-fadeIn {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

/* ─── Card stagger ───────────────────────────────────────────────────── */

.receitas-grade .receita-cartao {
  opacity: 0;
  animation: cardPop 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.receitas-grade .receita-cartao:nth-child(1)  { animation-delay: 0.00s; }
.receitas-grade .receita-cartao:nth-child(2)  { animation-delay: 0.06s; }
.receitas-grade .receita-cartao:nth-child(3)  { animation-delay: 0.12s; }
.receitas-grade .receita-cartao:nth-child(4)  { animation-delay: 0.18s; }
.receitas-grade .receita-cartao:nth-child(5)  { animation-delay: 0.24s; }
.receitas-grade .receita-cartao:nth-child(6)  { animation-delay: 0.30s; }
.receitas-grade .receita-cartao:nth-child(7)  { animation-delay: 0.36s; }
.receitas-grade .receita-cartao:nth-child(8)  { animation-delay: 0.42s; }
.receitas-grade .receita-cartao:nth-child(9)  { animation-delay: 0.48s; }

/* ─── Floating food illustration ─────────────────────────────────────── */

.flutua-anim {
  animation: float 5s ease-in-out infinite;
}

.flutua-anim-2 {
  animation: float 6.5s ease-in-out infinite;
  animation-delay: 1s;
}

.flutua-anim-3 {
  animation: float 7s ease-in-out infinite;
  animation-delay: 2s;
}

/* ─── Spinner ────────────────────────────────────────────────────────── */

.girador {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spinnerRing 0.75s linear infinite;
  margin: 0 auto;
}

.carregando-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  grid-column: 1 / -1;
}

.carregando-texto {
  font-size: 0.9rem;
  color: var(--warm-gray);
  font-weight: 500;
}

/* ─── Hover effects ──────────────────────────────────────────────────── */

.hover-eleva {
  transition: transform var(--transition), box-shadow var(--transition);
}

.hover-eleva:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ─── Compat ring fill (SVG) ─────────────────────────────────────────── */

.compat-anel-svg {
  transform: rotate(-90deg);
}

.compat-anel-trilho {
  fill: none;
  stroke: var(--cream-dark);
  stroke-width: 3;
}

.compat-anel-preenchimento {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Page transition ────────────────────────────────────────────────── */

.pagina-entrada {
  animation: fadeUp 0.4s ease forwards;
}

/* ─── Search pulse ───────────────────────────────────────────────────── */

@keyframes searchPulse {
  0%   { box-shadow: 0 0 0 0 rgba(199, 93, 58, 0.25); }
  70%  { box-shadow: 0 0 0 10px rgba(199, 93, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(199, 93, 58, 0); }
}

.busca-pulso {
  animation: searchPulse 0.5s ease;
}

/* ─── Notification aviso ─────────────────────────────────────────────── */

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.aviso {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.aviso.saindo {
  animation: toastOut 0.25s ease forwards;
}

.aviso-icone {
  font-size: 1.1rem;
}
