/* ==========================================================================
   AEGIS CAD AI - ANIMATIONS & TRANSITIONS (animations.css)
   ========================================================================== */

/* 1. Continuous Ticker Marquee */
@keyframes marquee-scroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-content {
  display: flex;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee-wrapper:hover .marquee-content {
  animation-play-state: paused;
}

/* 2. Radar Pulse for Blueprint Hotspots */
@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0.9;
  }
  70% {
    opacity: 0.25;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.2);
    opacity: 0;
  }
}

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

.pin-pulse-ring {
  animation: pulse-ring 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.blueprint-hotspot-pin:hover .pin-core {
  animation: pulse-core 0.8s ease infinite;
}

/* 3. Terminal Blinking Cursor */
@keyframes cursor-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.terminal-cursor {
  animation: cursor-blink 1s infinite steps(1);
}

/* 4. CAD Blueprint Laser Scanner Beam */
@keyframes scanline-sweep {
  0% {
    top: 0%;
    opacity: 0.8;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    top: 100%;
    opacity: 0.8;
  }
}

.blueprint-scanner-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-emerald), transparent);
  box-shadow: 0 0 12px var(--accent-emerald);
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

.blueprint-scanner-line.is-active {
  opacity: 1;
  animation: scanline-sweep 1.8s ease-in-out infinite alternate;
}

/* 5. Modal Animations */
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-backdrop.is-open {
  animation: modal-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-backdrop.is-open .modal-dialog {
  animation: modal-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 6. Toast Notifications */
@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast {
  animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 7. Loading Spinners */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* 8. Reduced Motion Accessibility */
@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;
  }
  .marquee-content {
    animation: none;
    transform: none;
  }
}
