/* ==========================================================================
   SlikWeb Subtle Animations & Micro-Interactions
   ========================================================================== */

/* Fade In on Load / Scroll */
.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Stagger delays */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }

/* Subtle Glow on Metallic Cards */
.glow-card {
  position: relative;
}

.glow-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 40%, rgba(255, 255, 255, 0.05));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity var(--transition-normal);
}

[data-theme="light"] .glow-card::before {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), transparent 40%, rgba(0, 0, 0, 0.04));
}

.glow-card:hover::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent 50%, rgba(255, 255, 255, 0.15));
}

/* Interactive Network Node Pulsing */
@keyframes signalPulse {
  0% {
    r: 4;
    opacity: 0.8;
  }
  50% {
    r: 9;
    opacity: 0;
  }
  100% {
    r: 4;
    opacity: 0;
  }
}

.node-pulse {
  animation: signalPulse 2.5s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  transform-origin: center;
}

/* Server Status Ping Animation */
@keyframes pingPacket {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.packet-line {
  stroke-dasharray: 6 12;
  animation: pingPacket 3s linear infinite;
}

/* Accessibility: Respect Reduced Motion */
@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;
  }
}
