/* ============================================================
   TRX Seafood Wharf — Animations & Micro-interactions
   ============================================================ */

/* ══════════════════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════════════════ */

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

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

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

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

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

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

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

@keyframes bounce-in {
  0%   { transform: scale(0.5);  opacity: 0; }
  70%  { transform: scale(1.1);  opacity: 1; }
  100% { transform: scale(1); }
}

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 180, 216, 0.3); }
  50%       { box-shadow: 0 0 24px rgba(0, 180, 216, 0.6); }
}

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

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

/* ══════════════════════════════════════════════════════════════
   UTILITY ANIMATION CLASSES
   ══════════════════════════════════════════════════════════════ */

.animate-spin    { animation: spin 1s linear infinite; }
.animate-pulse   { animation: pulse 2s ease infinite; }
.animate-ping    { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
.animate-float   { animation: float 3s ease-in-out infinite; }
.animate-glow    { animation: glow-pulse 2s ease infinite; }

.animate-fade-in       { animation: fade-in 0.3s ease both; }
.animate-slide-up      { animation: slide-up 0.35s ease both; }
.animate-slide-down    { animation: slide-down 0.35s ease both; }
.animate-slide-in-right{ animation: slide-in-right 0.3s ease both; }
.animate-scale-in      { animation: scale-in 0.25s var(--transition-spring) both; }
.animate-bounce-in     { animation: bounce-in 0.5s var(--transition-spring) both; }

/* Staggered animations for lists */
.stagger-children > *:nth-child(1)  { animation-delay: 0ms; }
.stagger-children > *:nth-child(2)  { animation-delay: 60ms; }
.stagger-children > *:nth-child(3)  { animation-delay: 120ms; }
.stagger-children > *:nth-child(4)  { animation-delay: 180ms; }
.stagger-children > *:nth-child(5)  { animation-delay: 240ms; }
.stagger-children > *:nth-child(6)  { animation-delay: 300ms; }

/* ══════════════════════════════════════════════════════════════
   SKELETON LOADING
   ══════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-tertiary) 25%,
    var(--color-bg-secondary) 50%,
    var(--color-bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.skeleton-text.sm  { height: 10px; width: 60%; }
.skeleton-text.lg  { height: 20px; }

.skeleton-circle {
  border-radius: 50%;
  aspect-ratio: 1;
}

.skeleton-card {
  background: linear-gradient(
    90deg,
    var(--color-bg-secondary) 25%,
    var(--color-bg-tertiary) 50%,
    var(--color-bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xl);
  height: 120px;
}

/* ══════════════════════════════════════════════════════════════
   RIPPLE EFFECT
   ══════════════════════════════════════════════════════════════ */

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   PAGE TRANSITIONS
   ══════════════════════════════════════════════════════════════ */

.page-transition-enter {
  animation: slide-up 0.3s ease both;
}

/* ══════════════════════════════════════════════════════════════
   STATUS DOT (for live indicators)
   ══════════════════════════════════════════════════════════════ */

.status-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

.status-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-success);
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.status-dot.warning { background: var(--color-warning); }
.status-dot.warning::before { background: var(--color-warning); }

.status-dot.danger  { background: var(--color-danger); }
.status-dot.danger::before  { background: var(--color-danger); }

.status-dot.muted   { background: var(--color-text-muted); }
.status-dot.muted::before   { display: none; }

/* ══════════════════════════════════════════════════════════════
   QR SCAN ANIMATION
   ══════════════════════════════════════════════════════════════ */

.scanner-overlay {
  position: relative;
}

.scanner-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--color-accent-primary),
    transparent);
  animation: scan-line 2s linear infinite;
  box-shadow: 0 0 8px var(--color-accent-primary);
}

@keyframes scan-line {
  0%   { top: 10%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 90%; opacity: 0; }
}

.scanner-corners::before,
.scanner-corners::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--color-accent-primary);
  border-style: solid;
}

.scanner-corners::before {
  top: 8%;
  left: 8%;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 4px;
}

.scanner-corners::after {
  bottom: 8%;
  right: 8%;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════
   BALANCE COUNTER ANIMATION
   ══════════════════════════════════════════════════════════════ */

.balance-update {
  animation: counter-up 0.4s ease both;
}

/* ══════════════════════════════════════════════════════════════
   HOVER INTERACTIONS
   ══════════════════════════════════════════════════════════════ */

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

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

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

.hover-scale {
  transition: transform var(--transition-spring);
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════ */

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