/* animations.css — Animacions suaus (tema municipal clar)
   Veure docs/style-guide.md */

/* SOS: ressalt subtil en lloc de glow neó */
@keyframes sos-glow {
  0%,
  100% {
    box-shadow: 0 10px 22px rgba(200, 30, 30, 0.16);
  }

  50% {
    box-shadow: 0 14px 30px rgba(200, 30, 30, 0.26);
  }
}

/* Anells SOS */
@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    opacity: 0.5;
  }

  100% {
    transform: scale(1.42);
    opacity: 0;
  }
}

/* Estat online */
@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.28);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(25, 135, 84, 0);
  }
}

/* Scanline càmeres */
@keyframes scanline {
  0% {
    top: -6%;
  }

  100% {
    top: 106%;
  }
}

/* Parpelleig de senyal */
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

/* Entrades */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ressalt de panells */
@keyframes glow-green {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(23, 32, 42, 0.06);
  }

  50% {
    box-shadow: 0 12px 26px rgba(23, 32, 42, 0.12);
  }
}

/* Flash d'alerta activa */
@keyframes alert-flash {
  0%,
  100% {
    border-color: rgba(200, 30, 30, 0.5);
    box-shadow: 0 0 0 rgba(200, 30, 30, 0);
  }

  50% {
    border-color: rgba(200, 30, 30, 0.75);
    box-shadow: 0 0 0 4px rgba(200, 30, 30, 0.08);
  }
}

/* Spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Glitch molt suau per títols */
@keyframes glitch-1 {
  0%,
  89%,
  100% {
    transform: translate(0, 0);
  }

  92% {
    transform: translate(-1px, 0);
  }

  96% {
    transform: translate(1px, 0);
  }
}

/* Cursor typing */
@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: var(--color-accent);
  }
}

/* Matrix fallback (extensions demo) */
@keyframes matrix-fall {
  from {
    opacity: 0.9;
  }

  to {
    opacity: 0.08;
  }
}

/* Accessibilitat: reduccio de moviment */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
