/**
 * Clean Market Ghana - Animations Stylesheet
 * Version 1.0.0
 */

/* ===== Core Animations ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rainFall {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

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

@keyframes scaleUp {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 107, 63, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 107, 63, 0.6); }
}

/* ===== Animation Classes ===== */
.anim-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.anim-fade-out {
  animation: fadeOut 0.3s ease forwards;
}

.anim-slide-up {
  animation: slideUp 0.4s ease forwards;
}

.anim-scale-up {
  animation: scaleUp 0.3s ease forwards;
}

.anim-bounce {
  animation: bounceIn 0.5s ease forwards;
}

.anim-shake {
  animation: shake 0.5s ease;
}

.anim-glow {
  animation: glow 2s ease infinite;
}

.anim-pulse {
  animation: pulse 2s ease infinite;
}

/* ===== Screen Transitions ===== */
.game-screen.active {
  animation: fadeIn 0.3s ease;
}

/* ===== Stat Bar Animations ===== */
.stat-bar-fill {
  transition: width 0.5s ease;
}

/* ===== Button Animations ===== */
.btn {
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* ===== Card Hover Effects ===== */
.shop-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-lg);
}

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

/* ===== Sorting Item Animation ===== */
.sorting-item {
  transition: all 0.2s ease;
}

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

/* ===== Rain Drops ===== */
.rain-drop {
  animation: rainFall linear infinite;
}

/* ===== Splash Animation ===== */
.splash-loading {
  animation: spin 1s linear infinite;
}

.splash-title {
  animation: slideUp 0.8s ease;
}

.splash-subtitle {
  animation: slideUp 1s ease;
}

/* ===== Day Transition ===== */
.day-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--green);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  animation: fadeIn 0.5s ease, fadeOut 0.5s ease 2s forwards;
  pointer-events: none;
}

.day-transition-text {
  font-size: 3rem;
  font-weight: bold;
  animation: bounceIn 0.5s ease 0.2s;
}

/* ===== Reduced Motion ===== */
.reduced-motion .game-screen.active,
.reduced-motion .anim-fade-in,
.reduced-motion .anim-fade-out,
.reduced-motion .anim-slide-up,
.reduced-motion .anim-scale-up,
.reduced-motion .anim-bounce,
.reduced-motion .anim-shake,
.reduced-motion .anim-glow,
.reduced-motion .anim-pulse,
.reduced-motion .splash-loading,
.reduced-motion .splash-title,
.reduced-motion .splash-subtitle,
.reduced-motion .rain-drop,
.reduced-motion .day-transition-overlay,
.reduced-motion .day-transition-text,
.reduced-motion .btn:hover,
.reduced-motion .shop-card:hover,
.reduced-motion .inspection-problem:hover,
.reduced-motion .sorting-item:hover,
.reduced-motion .stat-bar-fill {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}
