/* CHAMA CONTACT PUSH - Animations */
/* Keyframes, Transitions, and Visual Effects */

/* Core Animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-10px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(10px);
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px var(--primary-red);
  }
  50% {
    box-shadow: 0 0 20px var(--primary-red), 0 0 30px var(--primary-red);
  }
  100% {
    box-shadow: 0 0 5px var(--primary-red);
  }
}

@keyframes scan {
  0% {
    top: 0;
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    top: calc(100% - 4px);
    opacity: 1;
  }
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes wiggle {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

/* Loading Animations */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% {
    color: rgba(0,0,0,0);
    text-shadow:
      .25em 0 0 rgba(0,0,0,0),
      .5em 0 0 rgba(0,0,0,0);
  }
  40% {
    color: var(--text-primary);
    text-shadow:
      .25em 0 0 rgba(0,0,0,0),
      .5em 0 0 rgba(0,0,0,0);
  }
  60% {
    text-shadow:
      .25em 0 0 var(--text-primary),
      .5em 0 0 rgba(0,0,0,0);
  }
  80%, 100% {
    text-shadow:
      .25em 0 0 var(--text-primary),
      .5em 0 0 var(--text-primary);
  }
}

/* Progress Bar Animation */
@keyframes progress {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.progress-bar {
  animation: progress 2s ease-in-out;
}

/* Text Animations */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-red);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Hover Effects */
.hover-float:hover {
  animation: float 2s ease-in-out infinite;
}

.hover-glow:hover {
  animation: glow 1s ease-in-out infinite alternate;
}

.hover-wiggle:hover {
  animation: wiggle 0.5s ease-in-out;
}

.hover-heartbeat:hover {
  animation: heartbeat 1s ease-in-out infinite;
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* Status Light Animations */
.status-light-pulse {
  animation: pulse 2s infinite;
}

.status-light-glow {
  animation: glow 2s ease-in-out infinite alternate;
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
}

@keyframes loading-skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Card Entry Animations */
.card-enter {
  animation: slideInUp 0.6s ease;
}

.card-enter-delayed {
  animation: slideInUp 0.6s ease;
  animation-delay: 0.2s;
  opacity: 0;
  animation-fill-mode: forwards;
}

/* List Item Animations */
.list-item-enter {
  animation: slideInLeft 0.4s ease;
}

.list-item-exit {
  animation: slideInRight 0.4s ease reverse;
}

/* Message Animations */
.message-bounce {
  animation: bounceIn 0.6s ease;
}

.message-shake {
  animation: shake 0.6s ease;
}

/* Success Animations */
.success-checkmark {
  animation: bounceIn 0.8s ease;
}

.success-checkmark::after {
  content: '✓';
  color: var(--success);
  font-size: 2rem;
  font-weight: bold;
}

/* Error Animations */
.error-shake {
  animation: shake 0.6s ease;
}

.error-cross {
  animation: bounceIn 0.8s ease;
}

.error-cross::after {
  content: '✗';
  color: var(--error);
  font-size: 2rem;
  font-weight: bold;
}

/* Interactive Animations */
.click-animation {
  position: relative;
  overflow: hidden;
}

.click-animation::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: width 0.3s ease, height 0.3s ease;
}

.click-animation:active::before {
  width: 200px;
  height: 200px;
}

/* Notification Animations */
.notification-slide-in {
  animation: slideInRight 0.3s ease;
}

.notification-slide-out {
  animation: slideInRight 0.3s ease reverse;
}

/* QR Code Animations */
.qr-pulse {
  animation: pulse 2s infinite;
}

.qr-scanning {
  position: relative;
}

.qr-scanning::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-red), transparent);
  animation: scan 2s linear infinite;
}

/* Statistics Counter Animation */
.counter-up {
  animation: countUp 2s ease-out;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Progress Indicators */
.progress-circle {
  transform: rotate(-90deg);
  animation: progressCircle 2s ease-in-out;
}

@keyframes progressCircle {
  from {
    stroke-dasharray: 0 100;
  }
  to {
    stroke-dasharray: 100 100;
  }
}

/* Gradient Background Animation */
.animated-gradient {
  background: linear-gradient(-45deg, var(--bg-primary), var(--bg-secondary), var(--primary-red), var(--dark-red));
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
}

/* Particle Effects */
.particles {
  position: relative;
  overflow: hidden;
}

.particles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20% 30%, rgba(255, 0, 0, 0.3), transparent),
                    radial-gradient(2px 2px at 40% 70%, rgba(255, 0, 0, 0.2), transparent),
                    radial-gradient(1px 1px at 90% 40%, rgba(255, 0, 0, 0.4), transparent),
                    radial-gradient(1px 1px at 50% 50%, rgba(255, 0, 0, 0.2), transparent);
  background-size: 300px 300px, 200px 200px, 150px 150px, 100px 100px;
  animation: particles 20s linear infinite;
  pointer-events: none;
}

@keyframes particles {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-300px, -300px);
  }
}

/* Smooth Transitions */
.smooth-transition {
  transition: all var(--transition-normal);
}

.smooth-transition-slow {
  transition: all var(--transition-slow);
}

.smooth-transition-fast {
  transition: all var(--transition-fast);
}

/* Utility Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.rotate-on-hover:hover {
  transform: rotate(360deg);
  transition: transform 0.6s ease;
}

.scale-on-hover:hover {
  transform: scale(1.05);
  transition: transform var(--transition-normal);
}

.bounce-on-click:active {
  animation: bounceIn 0.3s ease;
}

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.will-change-auto {
  will-change: auto;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .loading-spinner,
  .loading-spinner-large {
    animation: none;
    border-top-color: var(--primary-red);
  }
  
  .scanning-line {
    animation: none;
    display: none;
  }
}

/* Dark Theme Specific Animations */
@media (prefers-color-scheme: dark) {
  .glow-effect {
    animation: glow 2s ease-in-out infinite alternate;
  }
  
  .red-pulse {
    animation: pulse 2s infinite;
    color: var(--primary-red);
    text-shadow: 0 0 10px var(--primary-red);
  }
}

/* Mobile Optimized Animations */
@media (max-width: 768px) {
  .mobile-reduce-animation {
    animation-duration: 0.3s !important;
  }
  
  .mobile-no-hover:hover {
    transform: none !important;
    animation: none !important;
  }
}

/* High Performance Mode */
.performance-mode * {
  animation: none !important;
  transition: none !important;
}

.performance-mode .loading-spinner,
.performance-mode .loading-spinner-large {
  border-top-color: var(--primary-red);
  animation: spin 1s linear infinite;
}
