/**
 * Behavioral Effects CSS
 * Visual polish and animations for behavioral science principles
 */

/* ============================================
   CELEBRATION ANIMATIONS
   ============================================ */

@keyframes celebrationPop {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.1) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@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 slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ============================================
   LOSS AVERSION WARNINGS
   ============================================ */

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.loss-aversion-modal {
  backdrop-filter: blur(4px);
}

/* ============================================
   PROGRESS INDICATORS
   ============================================ */

.behavioral-progress {
  backdrop-filter: blur(4px);
}

.behavioral-progress .progress-fill {
  position: relative;
  overflow: hidden;
}

.behavioral-progress .progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   SOCIAL PROOF INDICATORS
   ============================================ */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.social-proof-indicator {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   MICRO-ANIMATIONS
   ============================================ */

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.8);
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   BUTTON INTERACTIONS
   ============================================ */

button,
.btn-action,
[data-action] {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

button:hover,
.btn-action:hover,
[data-action]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(57, 255, 20, 0.3);
}

button:active,
.btn-action:active,
[data-action]:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(57, 255, 20, 0.2);
}

/* Ripple effect on click */
button::after,
.btn-action::after,
[data-action]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(57, 255, 20, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

button:active::after,
.btn-action:active::after,
[data-action]:active::after {
  width: 300px;
  height: 300px;
}

/* ============================================
   PROGRESS BARS (Enhanced)
   ============================================ */

.progress-bar {
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   SUCCESS STATES
   ============================================ */

.success-state {
  animation: successPulse 0.6s ease;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
  }
}

/* ============================================
   ERROR STATES
   ============================================ */

.error-state {
  animation: errorShake 0.5s ease;
}

@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-3px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(3px);
  }
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-state {
  position: relative;
  overflow: hidden;
}

.loading-state::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(57, 255, 20, 0.2),
    transparent
  );
  animation: loadingSweep 1.5s infinite;
}

@keyframes loadingSweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

.hover-lift {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(57, 255, 20, 0.2);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
}

/* ============================================
   TRANSITION EFFECTS
   ============================================ */

.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-down {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   FOCUS STATES
   ============================================ */

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #39ff14;
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
