/* ==========================================================================
   AmanahPay — Global, Animations & Component Styles
   ========================================================================== */

/* Smooth scrolling and base typography */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

/* 1. Ambient Floating & Breathing */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-16px) rotate(1deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(14px) rotate(-1deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* 2. Shimmer & Shine Sweep */
@keyframes shimmerSweep {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes buttonGleam {
  0% {
    left: -100%;
  }
  60%, 100% {
    left: 160%;
  }
}

/* 3. Laser Scanner Line for DuitNow QR */
@keyframes qrScan {
  0% {
    top: 6%;
    opacity: 0.3;
  }
  50% {
    top: 86%;
    opacity: 1;
  }
  100% {
    top: 6%;
    opacity: 0.3;
  }
}

/* 4. Radar / Ping Waves */
@keyframes radarWave {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.75);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes radarWaveBlue {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.75);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
  }
}

/* 5. Fade In & Slide Up for Scroll Transitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 6. Checkmark Pop Bounce */
@keyframes popBounce {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  70% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

.animate-float {
  animation: floatSlow 7s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatReverse 9s ease-in-out infinite 1.5s;
}

.animate-pulse-glow {
  animation: pulseGlow 5s ease-in-out infinite;
}

.radar-live-green {
  animation: radarWave 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.radar-live-blue {
  animation: radarWaveBlue 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.pop-in {
  animation: popBounce 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Card Hover Elevation */
.card-hover {
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 250ms ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -8px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Button with light gleam on hover */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
  transform: rotate(25deg);
  pointer-events: none;
}

.btn-shine:hover::after {
  animation: buttonGleam 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* QR Code Laser Scanner */
.qr-scanner-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #f43f5e, #fb7185, #f43f5e, transparent);
  box-shadow: 0 0 12px 2px rgba(244, 63, 94, 0.85);
  animation: qrScan 2.4s ease-in-out infinite;
  pointer-events: none;
}

/* Scroll Reveal Elements */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 650ms cubic-bezier(0.16, 1, 0.3, 1), 
              transform 650ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Tab View Switch Transition */
.view-enter {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Common UI Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: all 180ms ease-in-out;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-rounded-lg {
  border-radius: 0.75rem;
  font-weight: 600;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1rem;
  padding: 0.375rem 0.75rem;
  transition: all 180ms ease-in-out;
}

.btn-sm:active {
  transform: scale(0.97);
}

.border-gradient-h {
  border-top: 1px solid;
  border-bottom: 1px solid;
  border-image: linear-gradient(to right, transparent, rgba(203, 213, 225, 0.8), transparent) 1;
}

.border-gradient-dark {
  border-top: 1px solid;
  border-bottom: 1px solid;
  border-image: linear-gradient(to right, transparent, rgba(51, 65, 85, 0.8), transparent) 1;
}
