/* ===================================
   ACT Metaphors - Animation Styles
   Visual Metaphor Animations
   =================================== */

/* ===================================
   Base Animation Container
   =================================== */

.metaphor-animation-container {
  position: relative;
  width: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================
   Quicksand Animation
   =================================== */

.animation-quicksand {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #d4a574 0%, #8b6f47 100%);
  overflow: hidden;
}

.quicksand-figure {
  width: 40px;
  height: 60px;
  background: #4A90A4;
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 20px 20px 5px 5px;
  animation: sinking 3s ease-in-out infinite;
}

.quicksand-figure::before {
  content: '';
  width: 30px;
  height: 30px;
  background: #4A90A4;
  border-radius: 50%;
  position: absolute;
  top: -25px;
  left: 5px;
}

@keyframes sinking {
  0%, 100% {
    bottom: 50%;
    opacity: 1;
  }
  50% {
    bottom: 30%;
    opacity: 0.7;
  }
}

/* ===================================
   Beach Ball Animation
   =================================== */

.animation-beach-ball {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #87CEEB 0%, #4A90A4 100%);
  overflow: hidden;
}

.beach-ball {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a6f);
  border-radius: 50%;
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  animation: floating 2.5s ease-in-out infinite;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.beach-ball::before {
  content: '';
  width: 4px;
  height: 80px;
  background: white;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.beach-ball::after {
  content: '';
  width: 80px;
  height: 4px;
  background: white;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes floating {
  0%, 100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  50% {
    transform: translateX(-50%) translateY(-20px) rotate(180deg);
  }
}

/* ===================================
   Finger Trap Animation
   =================================== */

.animation-finger-trap {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.finger-trap {
  width: 120px;
  height: 40px;
  background: repeating-linear-gradient(
    45deg,
    #d4a574,
    #d4a574 10px,
    #c49563 10px,
    #c49563 20px
  );
  border-radius: 20px;
  position: relative;
  animation: stretching 2s ease-in-out infinite;
}

@keyframes stretching {
  0%, 100% {
    width: 120px;
    height: 40px;
  }
  50% {
    width: 140px;
    height: 35px;
  }
}

/* ===================================
   Tug of War Animation
   =================================== */

.animation-tug-of-war {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #87CEEB 0%, #90EE90 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tug-rope {
  width: 200px;
  height: 8px;
  background: #8b6f47;
  position: relative;
  animation: tugging 1.5s ease-in-out infinite;
}

.tug-figure {
  width: 30px;
  height: 50px;
  background: #4A90A4;
  position: absolute;
  left: -40px;
  top: -25px;
  border-radius: 15px 15px 5px 5px;
}

.tug-figure::before {
  content: '';
  width: 25px;
  height: 25px;
  background: #4A90A4;
  border-radius: 50%;
  position: absolute;
  top: -20px;
  left: 2.5px;
}

.tug-monster {
  width: 40px;
  height: 60px;
  background: #E76F51;
  position: absolute;
  right: -50px;
  top: -30px;
  border-radius: 20px 20px 5px 5px;
}

.tug-monster::before {
  content: '';
  width: 35px;
  height: 35px;
  background: #E76F51;
  border-radius: 50%;
  position: absolute;
  top: -25px;
  left: 2.5px;
}

@keyframes tugging {
  0%, 100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-10px);
  }
}

/* ===================================
   Bus Animation
   =================================== */

.animation-bus {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #87CEEB 0%, #90EE90 50%, #8B7355 100%);
  overflow: hidden;
}

.bus {
  width: 120px;
  height: 80px;
  background: #F4A261;
  position: absolute;
  bottom: 40px;
  left: 20%;
  border-radius: 10px 10px 5px 5px;
  animation: driving 4s linear infinite;
}

.bus::before {
  content: '';
  width: 100%;
  height: 30px;
  background: #E76F51;
  position: absolute;
  top: 0;
  border-radius: 10px 10px 0 0;
}

.bus-wheel {
  width: 25px;
  height: 25px;
  background: #333;
  border-radius: 50%;
  position: absolute;
  bottom: -5px;
  animation: rotating 0.5s linear infinite;
}

.bus-wheel:first-of-type {
  left: 15px;
}

.bus-wheel:last-of-type {
  right: 15px;
}

@keyframes driving {
  0% {
    left: -150px;
  }
  100% {
    left: 100%;
  }
}

@keyframes rotating {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===================================
   Stream Animation
   =================================== */

.animation-stream {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #87CEEB 0%, #4A90A4 100%);
  overflow: hidden;
}

.stream-water {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0px,
    rgba(255, 255, 255, 0.2) 50px,
    rgba(255, 255, 255, 0.1) 100px
  );
  animation: flowing 3s linear infinite;
}

.leaf {
  width: 20px;
  height: 30px;
  background: #7FB069;
  border-radius: 0 50% 50% 50%;
  position: absolute;
  top: 50%;
  animation: drifting 5s linear infinite;
}

.leaf:nth-child(2) {
  animation-delay: 1.5s;
  top: 40%;
}

.leaf:nth-child(3) {
  animation-delay: 3s;
  top: 60%;
}

@keyframes flowing {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 100px 0;
  }
}

@keyframes drifting {
  from {
    left: -30px;
    transform: rotate(0deg);
  }
  to {
    left: 100%;
    transform: rotate(360deg);
  }
}

/* ===================================
   Weather Animation
   =================================== */

.animation-weather {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #87CEEB 0%, #B0C4DE 100%);
  overflow: hidden;
}

.cloud {
  width: 100px;
  height: 40px;
  background: #fff;
  border-radius: 50px;
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.cloud::before {
  content: '';
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: -25px;
  left: 15px;
}

.cloud::after {
  content: '';
  width: 60px;
  height: 45px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: -20px;
  right: 15px;
}

.rain {
  width: 2px;
  height: 20px;
  background: #4A90A4;
  position: absolute;
  top: 80px;
  animation: raining 1s linear infinite;
  opacity: 0.6;
}

.rain:nth-child(1) {
  left: 30%;
  animation-delay: 0s;
}

.rain:nth-child(2) {
  left: 45%;
  animation-delay: 0.3s;
}

.rain:nth-child(3) {
  left: 60%;
  animation-delay: 0.6s;
}

.rain:nth-child(4) {
  left: 75%;
  animation-delay: 0.9s;
}

@keyframes raining {
  from {
    transform: translateY(0);
    opacity: 0.6;
  }
  to {
    transform: translateY(100px);
    opacity: 0;
  }
}

/* ===================================
   Mountain Animation
   =================================== */

.animation-mountain {
  width: 100%;
  height: 200px;
  position: relative;
  background: linear-gradient(to bottom, #87CEEB 0%, #90EE90 100%);
  overflow: hidden;
}

.mountain {
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 150px solid #8B7355;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.mountain::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 80px solid transparent;
  border-right: 80px solid transparent;
  border-bottom: 120px solid #A0826D;
  position: absolute;
  bottom: -150px;
  left: -140px;
}

.climber {
  width: 15px;
  height: 25px;
  background: #4A90A4;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 8px 8px 3px 3px;
  animation: climbing 3s ease-in-out infinite;
}

.climber::before {
  content: '';
  width: 12px;
  height: 12px;
  background: #4A90A4;
  border-radius: 50%;
  position: absolute;
  top: -10px;
  left: 1.5px;
}

@keyframes climbing {
  0%, 100% {
    bottom: 20px;
  }
  50% {
    bottom: 80px;
  }
}

/* ===================================
   Default Animation
   =================================== */

.animation-default {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.animation-default p {
  color: var(--color-neutral-600);
  font-style: italic;
  text-align: center;
  padding: var(--spacing-xl);
}

/* ===================================
   Reduced Motion Support
   =================================== */

@media (prefers-reduced-motion: reduce) {
  .quicksand-figure,
  .beach-ball,
  .finger-trap,
  .tug-rope,
  .bus,
  .bus-wheel,
  .stream-water,
  .leaf,
  .rain,
  .climber {
    animation: none;
  }
  
  .bus {
    left: 50%;
    transform: translateX(-50%);
  }
  
  .leaf {
    left: 50%;
  }
}
