/* CSS Animations Keyframes */

/* 1. Loading spinner rotation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-spinner {
  animation: spin 1s linear infinite;
}

/* 2. Radar sweep rotation */
@keyframes radar-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-sweep {
  animation: radar-spin 4s linear infinite;
}

/* 3. Logo pulse/rotate effect */
@keyframes logo-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-icon {
  animation: logo-rotate 12s linear infinite;
}

/* 4. Green pulse status dot animation */
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 hsla(var(--color-accessible), 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px hsla(var(--color-accessible), 0);
  }
  100% {
    box-shadow: 0 0 0 0 hsla(var(--color-accessible), 0);
  }
}

.result-card[data-status="accessible"] .status-dot,
.history-item[data-status="accessible"] .status-dot-small {
  animation: pulse-green 2s infinite;
}

/* 5. Restricted warning blink animation */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.result-card[data-status="restricted"] .status-dot,
.history-item[data-status="restricted"] .status-dot-small {
  animation: blink 1.5s infinite;
}

/* 6. Card list item entrance transition */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Staggered load delays for cards 1 to 5 */
.result-card:nth-child(1) { animation-delay: 0ms; }
.result-card:nth-child(2) { animation-delay: 80ms; }
.result-card:nth-child(3) { animation-delay: 160ms; }
.result-card:nth-child(4) { animation-delay: 240ms; }
.result-card:nth-child(5) { animation-delay: 320ms; }

/* 7. Input scan line scanner animation */
@keyframes scan-line {
  0% { left: -100%; }
  100% { left: 200%; }
}

.input-row-scanning {
  position: relative;
  overflow: hidden;
}

.input-row-scanning::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, transparent, hsla(var(--accent), 0.1), transparent);
  animation: scan-line 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* Accessibility: Respect system settings for reduced animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .radar-sweep, .logo-icon {
    animation: none !important;
    transform: none !important;
  }
}
