/* Non-Critical CSS - Loaded asynchronously after initial render */

/* Custom staggered animation for collection rows */
@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.3s ease-in-out;
}

/* View Transition Animations for specific elements */

/* Signin form transitions */
::view-transition-old(signin),
::view-transition-new(signin) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(signin) {
  animation-name: fade-scale-out;
}

::view-transition-new(signin) {
  animation-name: fade-scale-in;
}

@keyframes fade-scale-in {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fade-scale-out {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Fallback for browsers without view transition support */
@supports not (view-transition-name: root) {
  body {
    transition: all 0.5s ease-in-out;
  }
}

/* React Flow node animations for smooth filter transitions */
/* Only needed on /connections route, can be deferred */
.react-flow__node {
  transition: opacity 200ms ease-out;
}

.react-flow__edge {
  transition: opacity 200ms ease-out;
}

.react-flow__viewport {
  will-change: transform;
}

/* Animated edge when connected node is selected */
@keyframes edge-flow {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.react-flow__edge path.animated-edge {
  stroke-dasharray: 6 3;
  animation: edge-flow 0.6s linear infinite;
}

/* Link hover transitions - nice to have but not critical for initial render */
.link {
  transition: all 0.2s ease-in-out;
}

.link-hover {
  transition: all 0.2s ease-in-out;
}

.detail-hover {
  transition: all 0.2s ease-in-out;
}

/* CSS Custom Highlight API — styled via useSearchHighlight hook */
::highlight(search) {
  background-color: color-mix(in oklch, var(--accent) 80%, transparent);
}
