/* ============================================
   ANIMATIONS & KEYFRAMES
   ============================================ */

/* ── Shimmer (skeleton loaders) ──────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

/* ── FAB pulse ───────────────────────────────── */
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(229, 57, 53, 0.45); }
  50%       { box-shadow: 0 4px 32px rgba(229, 57, 53, 0.65), 0 0 0 8px rgba(229,57,53,0.10); }
}

/* ── Toast in/out ────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* ── Shake (form errors) ─────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ── Fade in ─────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Slide up ────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Slide in from right ─────────────────────── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Scale in ────────────────────────────────── */
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Bounce in ───────────────────────────────── */
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.3); }
  50%  { opacity: 1; transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ── Wallet card hover ───────────────────────── */
@keyframes cardActivate {
  0%   { transform: scale(0.95); }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ── Number count up (helper class) ─────────────── */
.animate-count {
  display: inline-block;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Screen transition ───────────────────────── */
.screen-enter {
  animation: fadeIn 0.25s ease forwards;
}

/* ── Staggered list items ────────────────────── */
.stagger-item {
  animation: slideUp 0.3s ease both;
}

.stagger-item:nth-child(1)  { animation-delay: 0ms; }
.stagger-item:nth-child(2)  { animation-delay: 40ms; }
.stagger-item:nth-child(3)  { animation-delay: 80ms; }
.stagger-item:nth-child(4)  { animation-delay: 120ms; }
.stagger-item:nth-child(5)  { animation-delay: 160ms; }
.stagger-item:nth-child(6)  { animation-delay: 200ms; }
.stagger-item:nth-child(7)  { animation-delay: 240ms; }
.stagger-item:nth-child(8)  { animation-delay: 280ms; }

/* ── Swipe actions reveal ────────────────────── */
.swipe-item {
  position: relative;
  overflow: hidden;
}

.swipe-actions {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.swipe-item.swiped .swipe-actions {
  transform: translateX(0);
}

.swipe-action-btn {
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.swipe-action-edit {
  background: rgba(33, 150, 243, 0.85);
  color: white;
}

.swipe-action-delete {
  background: rgba(229, 57, 53, 0.85);
  color: white;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ── Loading screen ──────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-4);
  z-index: 9999;
  transition: opacity 0.4s ease;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-screen .logo-icon {
  width: 72px;
  height: 72px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#loading-screen .logo-icon .material-symbols-rounded {
  font-size: 36px;
}

/* ── Reduce motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
