/* WKR-219H: Matrix Animation System */

:root {
  --animation-duration: 1.2s;
  --animation-delay-offset: 0.15s;
}

/* Matrix Enter: Cards desenhando com efeito Matrix (blur + fade + slideX) */
@keyframes matrix-enter {
  0% {
    opacity: 0;
    transform: translateX(-50px);
    filter: blur(8px);
  }
  40% {
    opacity: 0.6;
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

/* Matrix Code: Efeito de caracteres aleatórios antes do conteúdo real */
@keyframes matrix-code {
  0% {
    content: "▓▒░ ░▒▓ █ ▒ ░";
    opacity: 0.8;
  }
  50% {
    content: "▓▒░█▓▒ ░ █▓";
    opacity: 0.5;
  }
  100% {
    content: "";
    opacity: 0;
  }
}

/* Matrix Line: Linha horizontal passando pela tela (efeito scan) */
@keyframes matrix-line {
  0% {
    opacity: 0;
    transform: translateY(-100%);
    height: 2px;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0) 0%, rgba(14, 165, 233, 0.8) 50%, rgba(14, 165, 233, 0) 100%);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(100vh + 100%));
    background: linear-gradient(180deg, rgba(14, 165, 233, 0) 0%, rgba(14, 165, 233, 0.6) 50%, rgba(14, 165, 233, 0) 100%);
  }
}

/* Classes aplicáveis via JavaScript */

.wkr-card-animate-enter {
  animation: matrix-enter var(--animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.wkr-card-animate-enter-0 {
  animation: matrix-enter var(--animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--animation-delay-offset) * 0);
}

.wkr-card-animate-enter-1 {
  animation: matrix-enter var(--animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--animation-delay-offset) * 1);
}

.wkr-card-animate-enter-2 {
  animation: matrix-enter var(--animation-duration) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--animation-delay-offset) * 2);
}

/* Respect accessibility: disable animations if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  @keyframes matrix-enter {
    0%, 100% {
      opacity: 1;
      transform: translateX(0);
      filter: blur(0);
    }
  }

  @keyframes matrix-code {
    0%, 100% {
      opacity: 0;
      content: "";
    }
  }

  @keyframes matrix-line {
    0%, 100% {
      opacity: 0;
    }
  }

  .wkr-card-animate-enter,
  .wkr-card-animate-enter-0,
  .wkr-card-animate-enter-1,
  .wkr-card-animate-enter-2 {
    animation: none !important;
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Optional: additional animation utilities for scan line effect */
.wkr-scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: matrix-line 3s ease-in-out infinite;
}

/* Disable scan line on reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .wkr-scan-line {
    display: none;
  }
}
