/* assets/css/app-motion.css - Frontend User App Only (Zero Admin Animation) */

/* 1. Staggered Fade-Up Entrance (~500ms, GPU-composited) */
@keyframes rkFadeUp {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.stagger-item {
  opacity: 0;
  animation: rkFadeUp 500ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: transform, opacity;
}
.stagger-item:nth-child(1) { animation-delay: 40ms; }
.stagger-item:nth-child(2) { animation-delay: 90ms; }
.stagger-item:nth-child(3) { animation-delay: 140ms; }
.stagger-item:nth-child(4) { animation-delay: 190ms; }
.stagger-item:nth-child(5) { animation-delay: 240ms; }
.stagger-item:nth-child(6) { animation-delay: 290ms; }

/* 2. Lightweight Shimmer Skeleton for Slow 3G Networks */
@keyframes rkShimmer {
  0%   { transform: translate3d(-100%, 0, 0); }
  100% { transform: translate3d(100%, 0, 0); }
}
.skeleton {
  position: relative;
  overflow: hidden;
  background: #E5E7EB;
  border-radius: 12px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
  animation: rkShimmer 1.3s infinite linear;
}

/* 3. Lazy-Loaded Image Smooth Fade-In */
img.lazy-fade {
  opacity: 0;
  transition: opacity 320ms ease-out;
}
img.lazy-fade.is-loaded {
  opacity: 1;
}

/* 4. Sliding Silver / Gold Switch */
.metal-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: #E5E7EB;
  padding: 4px;
  border-radius: 999px;
  width: 176px;
  user-select: none;
}
.metal-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #FFFFFF;
  border-radius: 999px;
  transition: transform 260ms cubic-bezier(0.25, 1, 0.5, 1);
}
[data-metal="Gold"] .metal-switch-thumb {
  transform: translate3d(100%, 0, 0);
}
.metal-switch button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
}

/* 5. Tactile Press Feedback */
.pressable {
  transition: transform 120ms ease-out;
}
.pressable:active {
  transform: scale(0.97);
}

/* 6. Accessibility & Low-End Device Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .stagger-item { opacity: 1; animation: none; }
  .skeleton::after { animation: none; }
  .metal-switch-thumb, .pressable, img.lazy-fade { transition: none; }
}