/* Live match updates animations */

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

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

@keyframes subtle-fade-in {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* Pulse animation for updated sections */
.pulse-update {
  animation: pulse-glow 1s ease-out;
}

/* Fade in animation for Turbo Stream updates */
.turbo-stream-update {
  animation: subtle-fade-in 0.5s ease-in;
}

/* Live indicator dot */
.live-indicator {
  position: relative;
  display: inline-block;
}

.live-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -12px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-50%) scale(1.2);
  }
}

/* Goal celebration flash */
@keyframes goal-flash {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(34, 197, 94, 0.2);
  }
  100% {
    background-color: transparent;
  }
}

.goal-celebration {
  animation: goal-flash 0.8s ease-in-out;
}

/* Goal scorer overlay — slides up from the bottom of the match card */
@keyframes goal-overlay-enter {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes goal-overlay-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(100%);
  }
}

.goal-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.93), rgba(5, 150, 105, 0.88));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom-left-radius: var(--radius-base, 8px);
  border-bottom-right-radius: var(--radius-base, 8px);
  pointer-events: none;
  animation: goal-overlay-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.goal-overlay--exit {
  animation: goal-overlay-exit 0.4s ease-in forwards;
}

/* Score pop animation when a goal is scored */
@keyframes score-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.3); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.5); }
  65%  { transform: scale(1.12); }
  100% { transform: scale(1); box-shadow: none; }
}

.score-goal-flash {
  animation: score-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Reduced motion: skip animations, use a simple color flash instead */
@media (prefers-reduced-motion: reduce) {
  .goal-overlay,
  .goal-overlay--exit {
    animation: none;
    transform: none;
  }

  .goal-overlay--exit {
    opacity: 0;
  }

  .score-goal-flash {
    animation: none;
  }
}
