/* ============================================
   UI Animation Enhancements
   Standalone file — deleting it leaves site 100% functional
   ============================================ */

/* ---- 1. Breathing Background ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(108,99,255,0.5), transparent 70%);
  animation: breathe 15s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.6; }
}

/* ---- 2. Glass Card Scroll Reveal ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- 3. Button Ripple + Hover ---- */
.btn, button {
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}
.btn:hover, button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(108,99,255,0.2);
}
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleExpand 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleExpand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---- 4. Input Focus / Validation ---- */
.input-focused {
  border-bottom: 2px solid #6C63FF;
  animation: focusLine 0.3s ease forwards;
}
@keyframes focusLine {
  from { border-bottom-color: transparent; }
  to   { border-bottom-color: #6C63FF; }
}
.input-valid {
  border-color: #34D399;
}
.input-invalid {
  border-color: #EF4444;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ---- 5. Order Status Badge 3D Flip ---- */
.status-flipper {
  perspective: 600px;
  display: inline-block;
}
.status-flipper .status-inner {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}
.status-flipper.flipped .status-inner {
  transform: rotateY(180deg);
}

/* ---- 6. Message Bubble Enter ---- */
.msg-enter {
  animation: bubbleEnter 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes bubbleEnter {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
.msg-glow {
  box-shadow: 0 0 12px rgba(52,211,153,0.5);
  transition: box-shadow 0.3s ease;
}

/* ---- 7. Tab / Page Transition ---- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-content-enter {
  animation: fadeSlideIn 0.35s ease forwards;
}

/* ---- Performance: GPU layers ---- */
.animate-on-scroll,
.ripple,
.input-invalid,
.msg-enter,
.tab-content-enter {
  will-change: transform, opacity;
}

/* ---- Accessibility: respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  body::before,
  .animate-on-scroll,
  .btn, button,
  .ripple,
  .input-focused,
  .input-invalid,
  .status-flipper .status-inner,
  .msg-enter,
  .tab-content-enter {
    animation: none !important;
    transition: none !important;
  }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
