/**
 * PhotoXED Delightful Animations
 * Every action should feel alive. Spring curves everywhere.
 */

.px-fade {
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.px-fade.in {
  opacity: 1;
}

.px-pop {
  animation: pxPop var(--dur) var(--ease);
}

@keyframes pxPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.px-spring-up {
  animation: pxSpringUp var(--dur-slow) var(--ease);
}

@keyframes pxSpringUp {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Sheet enter - enhanced "emerging from tab bar" feel */
.px-ms-enter .px-msCard {
  animation: pxSheetIn var(--dur-slow) var(--ease);
  animation-fill-mode: forwards; /* lock the final position so it doesn't jump back */
}

@keyframes pxSheetIn {
  0% {
    transform: translateY(110%) scale(0.96);
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Experimental weavy looping color animation for brand text */
@keyframes photoXedWeave {
  0%   { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

.px-ms-leave .px-msCard {
  animation: pxSheetOut 220ms var(--ease);
}

@keyframes pxSheetOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(80%) scale(0.96); opacity: 0; }
}

/* Upload progress shimmer */
.px-progress {
  position: relative;
  overflow: hidden;
}
.px-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transform: translateX(-100%);
  animation: pxShimmer 1.4s infinite;
}

@keyframes pxShimmer {
  100% { transform: translateX(100%); }
}

/* Photo grid enter stagger (applied via JS) */
.px-photo-enter {
  animation: pxPhotoEnter 420ms var(--ease) both;
}

@keyframes pxPhotoEnter {
  0% { transform: scale(0.96) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Expiry dial pulse (warning) */
.px-dial-warning {
  animation: pxDialWarn 2.2s infinite ease-in-out;
}

@keyframes pxDialWarn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Button press delight */
.px-btn:active {
  transform: scale(0.985);
  transition: transform 80ms linear;
}

/* Success check pop */
.px-success-pop {
  animation: pxSuccessPop 420ms var(--ease);
}

@keyframes pxSuccessPop {
  0% { transform: scale(0.6); opacity: 0; }
  55% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}