/* ═══════════════════════════════════════════════════════════════════════════
   ECOllet UI — Animations & Transitions
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Entry animations ─────────────────────────────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Pulse effects ────────────────────────────────────────────────────────── */
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

@keyframes ring-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(230, 57, 70, 0.4); }
  50%       { box-shadow: 0 0 18px rgba(230, 57, 70, 0.7); }
}

/* ── Shimmer / skeleton ───────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-glass-sm) 25%,
    var(--color-glass-md) 50%,
    var(--color-glass-sm) 75%
  );
  background-size: 400px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

/* ── Live feed new item ───────────────────────────────────────────────────── */
@keyframes feed-enter {
  from { opacity: 0; transform: translateX(-6px); max-height: 0; }
  to   { opacity: 1; transform: translateX(0); max-height: 80px; }
}

.feed-item.entering {
  animation: feed-enter 0.35s var(--transition-spring) forwards;
}

/* ── Glow scan line ───────────────────────────────────────────────────────── */
@keyframes scan-line {
  0%   { top: -5%; opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.5; }
  100% { top: 105%; opacity: 0; }
}

.scan-line-effect {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-blue-400), transparent);
  animation: scan-line 6s linear infinite;
  pointer-events: none;
}

/* ── Number counter ───────────────────────────────────────────────────────── */
@keyframes count-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.count-updated {
  animation: count-up 0.25s ease-out;
}

/* ── Utility animation helpers ────────────────────────────────────────────── */
.animate-fade-in    { animation: fade-in      0.3s ease forwards; }
.animate-slide-up   { animation: slide-up     0.3s ease forwards; }
.animate-scale-in   { animation: scale-in     0.25s ease forwards; }
.animate-slide-left { animation: slide-in-left 0.3s ease forwards; }

.delay-1 { animation-delay: 0.05s; animation-fill-mode: both; }
.delay-2 { animation-delay: 0.10s; animation-fill-mode: both; }
.delay-3 { animation-delay: 0.15s; animation-fill-mode: both; }
.delay-4 { animation-delay: 0.20s; animation-fill-mode: both; }
.delay-5 { animation-delay: 0.25s; animation-fill-mode: both; }
.delay-6 { animation-delay: 0.30s; animation-fill-mode: both; }
.delay-7 { animation-delay: 0.35s; animation-fill-mode: both; }
.delay-8 { animation-delay: 0.40s; animation-fill-mode: both; }

/* ── Hover glow effect ────────────────────────────────────────────────────── */
.hover-glow-blue {
  transition: box-shadow var(--transition-base);
}
.hover-glow-blue:hover {
  box-shadow: 0 0 0 1px var(--border-strong), 0 4px 24px var(--color-blue-glow);
}

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

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-default);
  border-top-color: var(--color-blue-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
