/* payment-animation.css */
/* ===== PAYMENT ANIMATION SYSTEM ===== */

/*
  MELP PAYMENT ANIMATION LIBRARY

  This file contains common animation classes that can be shared across all payment-related components.
  It includes entrance animations, hover effects, and transition utilities.

  Usage:
  - Apply animation classes directly: .fade-in-up, .slide-in-left, .scale-in
  - Use staggered animations with delays: .animation-delay-100, .animation-delay-200
  - Combine with visibility: .animate-on-load, .animate-on-scroll

  Animation Types:
  1. Entrance Animations - fadeInUp, fadeInLeft, fadeInRight, scaleIn
  2. Exit Animations - fadeOut, slideOut, scaleOut
  3. Hover Effects - hover-lift, hover-glow, hover-scale
  4. Transition Utilities - transition-all, transition-transform, transition-opacity
  5. Animation Delays - Staggered timing for sequential animations
*/

/* ===== Z-index KEYFRAMES ===== */
/* Z-Index Utilities */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }
.z-200 { z-index: 200; }
.z-300 { z-index: 300; }
.z-400 { z-index: 400; }
.z-500 { z-index: 500; }
.z-1000 { z-index: 1000; }
.z-2000 { z-index: 2000; }
.z-3000 { z-index: 3000; }
.z-4000 { z-index: 4000; }
.z-5000 { z-index: 5000; }
.z-9999 { z-index: 9999; }
/* ===== ANIMATION KEYFRAMES ===== */

/* Entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-2rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(2rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -0.5rem, 0);
  }
  70% {
    transform: translate3d(0, -0.25rem, 0);
  }
  90% {
    transform: translate3d(0, -0.125rem, 0);
  }
}

@keyframes priceSwitch {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* SVG path drawing animation */
@keyframes drawSVG {
  to {
    stroke-dashoffset: 0;
  }
}

/* Exit animations */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-2rem);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(2rem);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* ===== ANIMATION UTILITY CLASSES ===== */

/* Entrance animation classes */
.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
  opacity: 0;
  animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
  opacity: 0;
  animation: fadeInRight 0.6s ease-out forwards;
}

.fade-in-down {
  opacity: 0;
  animation: fadeInDown 0.6s ease-out forwards;
}

.scale-in {
  opacity: 0;
  animation: scaleIn 0.5s ease-out forwards;
}

.bounce-in {
  animation: bounce 1s ease-out;
}

/* Exit animation classes */
.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

.slide-out-left {
  animation: slideOutLeft 0.3s ease-out forwards;
}

.slide-out-right {
  animation: slideOutRight 0.3s ease-out forwards;
}

.scale-out {
  animation: scaleOut 0.3s ease-out forwards;
}

/* Special effect classes */
.pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

.price-switch {
  animation: priceSwitch 0.5s ease-in-out;
}

.svg-draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawSVG 2s ease-in-out forwards;
}

/* ===== ANIMATION DELAYS ===== */

/* Staggered entrance timing */
.animation-delay-100 {
  animation-delay: 0.1s;
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-300 {
  animation-delay: 0.3s;
}

.animation-delay-400 {
  animation-delay: 0.4s;
}

.animation-delay-500 {
  animation-delay: 0.5s;
}

.animation-delay-600 {
  animation-delay: 0.6s;
}

.animation-delay-700 {
  animation-delay: 0.7s;
}

.animation-delay-800 {
  animation-delay: 0.8s;
}

.animation-delay-900 {
  animation-delay: 0.9s;
}

.animation-delay-1000 {
  animation-delay: 1s;
}

.animation-delay-1200 {
  animation-delay: 1.2s;
}

.animation-delay-1400 {
  animation-delay: 1.4s;
}

.animation-delay-1600 {
  animation-delay: 1.6s;
}

.animation-delay-1800 {
  animation-delay: 1.8s;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

/* ===== TRANSITION UTILITIES ===== */

/* Base transition classes */
.transition-all {
  transition: all var(--transition-normal);
}

.transition-fast {
  transition: all var(--transition-fast);
}

.transition-slow {
  transition: all var(--transition-slow);
}

.transition-transform {
  transition: transform var(--transition-normal);
}

.transition-opacity {
  transition: opacity var(--transition-normal);
}

.transition-colors {
  transition: color var(--transition-normal), background-color var(--transition-normal), border-color var(--transition-normal);
}

/* ===== HOVER ANIMATIONS ===== */

/* Hover effects */
.hover-lift {
  transition: transform var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-0.2rem);
}

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

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





.hover-brighten {
  transition: filter var(--transition-normal);
}

.hover-brighten:hover {
  filter: brightness(1.1);
}

/* Button hover animations */
.btn-hover-scale {
  transition: transform var(--transition-fast);
}

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

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

.btn-hover-lift:hover {
  transform: translateY(-0.1rem);
  box-shadow: 0 0.3rem 1rem rgb(from var(--color-text-primary) r g b / 15%);
}

/* ===== FOCUS ANIMATIONS ===== */

.focus-ring {
  transition: outline var(--transition-fast), transform var(--transition-fast);
}

.focus-ring:focus-visible {
  outline: 0.2rem solid var(--brand-primary);
  outline-offset: 0.2rem;
  transform: scale(1.02);
}

/* ===== RESPONSIVE ANIMATIONS ===== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .fade-in-down,
  .scale-in,
  .bounce-in,
  .fade-out,
  .slide-out-left,
  .slide-out-right,
  .scale-out,
  .pulse-glow,
  .price-switch,
  .svg-draw {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hover-lift:hover,
  .hover-scale:hover,
  .btn-hover-scale:hover,
  .btn-hover-lift:hover,
  .focus-ring:focus-visible {
    transform: none !important;
  }

  .transition-all,
  .transition-fast,
  .transition-slow,
  .transition-transform,
  .transition-opacity,
  .transition-colors,
  .hover-lift,
  .hover-scale,
  .hover-glow,
  .hover-brighten,
  .btn-hover-scale,
  .btn-hover-lift,
  .focus-ring {
    transition: none !important;
  }
}

/* Mobile-optimized animations */
@media (max-width: 768px) {
  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .fade-in-down,
  .scale-in {
    animation-duration: 0.5s;
  }

  .animation-delay-100,
  .animation-delay-200,
  .animation-delay-300,
  .animation-delay-400,
  .animation-delay-500,
  .animation-delay-600,
  .animation-delay-700,
  .animation-delay-800,
  .animation-delay-900,
  .animation-delay-1000,
  .animation-delay-1100,
  .animation-delay-1200,
  .animation-delay-1400,
  .animation-delay-1600,
  .animation-delay-1800,
  .animation-delay-2000 {
    animation-delay: 0s !important;
  }
}

/* ===== Z-INDEX MANAGEMENT SYSTEM ===== */

/*
  Z-INDEX STACKING MANAGEMENT - COMMENTED OUT

  These classes help manage stacking contexts when animations interfere with dropdowns,
  modals, or other overlays. Use these classes alongside animation classes to ensure
  proper layering.

  Usage:
  - .z-base: Default stacking level for animated content (z-index: 1)
  - .z-low: Lower stacking level for background animations (z-index: 0)
  - .z-dropdown: High stacking level for dropdowns (z-index: 9999)
  - .z-modal: Highest stacking level for modals (z-index: 10000)
  - .z-overlay: Maximum stacking level for overlays (z-index: 10001)

  Stacking Context Control:
  - .stacking-context: Creates new stacking context (position: relative)
  - .stacking-context-high: Creates high-priority stacking context
  - .no-stacking-context: Prevents stacking context creation

  Animation-specific Z-index:
  - .animation-z-safe: Safe z-index for animated elements
  - .animation-z-background: Background level for animations
  - .dropdown-container-z: Container z-index for dropdown parents
*/

/* ===== Z-INDEX UTILITY CLASSES ===== */

/* Base z-index levels */

/* Stacking context management */

/* Animation-specific z-index classes */

/* Dropdown container z-index */

/* ===== ANIMATION + Z-INDEX COMBINED CLASSES ===== */

/* Safe animated elements that won't interfere with dropdowns */

/* Background level animations for later delays */
/*
.animation-delay-600.animation-z-background,
.animation-delay-700.animation-z-background,
.animation-delay-800.animation-z-background,
.animation-delay-900.animation-z-background,
.animation-delay-1000.animation-z-background,
.animation-delay-1200.animation-z-background,
.animation-delay-1400.animation-z-background,
.animation-delay-1600.animation-z-background,
.animation-delay-1800.animation-z-background,
.animation-delay-2000.animation-z-background {
  z-index: 0 !important;
  position: relative;
}
*/

/* ===== DROPDOWN STACKING FIXES ===== */

/* Ensure dropdown containers can stack above animated elements */

/* Fallback for browsers without :has() support */

/* ===== COMPONENT-SPECIFIC Z-INDEX HELPERS ===== */

/* For elements that contain dropdowns */

/* For animated sections that should stay below dropdowns */

/* ===== RESPONSIVE Z-INDEX ===== */

/* Ensure proper stacking on mobile */

/* ===== ACCESSIBILITY CONSIDERATIONS ===== */

/* Reduce motion users get simpler stacking */

/* ===== END Z-INDEX MANAGEMENT SYSTEM ===== */
