/* ============================================================
   WOMARKT OS — Flow Navigation Overlay
   n8n-style role-aware node graph during route transitions
   ============================================================ */

.flow-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flow-fade-in 0.15s ease-out;
}

.flow-nav-overlay.flow-nav--fade-out {
  animation: flow-fade-out 0.2s ease-in forwards;
}

@keyframes flow-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes flow-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.flow-nav-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 172, 172, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 172, 172, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  animation: flow-grid-pulse 3s ease-in-out infinite;
}

@keyframes flow-grid-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.flow-nav-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    transparent 0%,
    rgba(0, 172, 172, 0.03) 50%,
    transparent 100%
  );
  background-size: 100% 4px;
  animation: flow-scanline 8s linear infinite;
}

@keyframes flow-scanline {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

.flow-nav-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: min(920px, 94vw);
  padding: 0 16px;
}

.flow-nav-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.flow-nav-logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8eaed;
}

.flow-nav-frame {
  position: relative;
  width: 100%;
  padding: 36px 28px 28px;
  background: rgba(10, 10, 10, 0.88);
  border: 1px solid rgba(0, 172, 172, 0.22);
  backdrop-filter: blur(10px);
}

.flow-nav-bracket {
  position: absolute;
  width: 16px;
  height: 16px;
}

.flow-nav-bracket--tl {
  top: -1px;
  left: -1px;
  border-top: 2px solid rgba(0, 212, 170, 0.7);
  border-left: 2px solid rgba(0, 212, 170, 0.7);
}

.flow-nav-bracket--tr {
  top: -1px;
  right: -1px;
  border-top: 2px solid rgba(0, 212, 170, 0.7);
  border-right: 2px solid rgba(0, 212, 170, 0.7);
}

.flow-nav-bracket--bl {
  bottom: -1px;
  left: -1px;
  border-bottom: 2px solid rgba(0, 212, 170, 0.7);
  border-left: 2px solid rgba(0, 212, 170, 0.7);
}

.flow-nav-bracket--br {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid rgba(0, 212, 170, 0.7);
  border-right: 2px solid rgba(0, 212, 170, 0.7);
}

.flow-nav-module {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #00d4aa;
  margin-bottom: 28px;
}

.flow-nav-graph {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 172, 172, 0.3) transparent;
}

.flow-nav-nodes {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  min-width: min-content;
  padding: 8px 4px 4px;
}

.flow-nav-node-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.flow-nav-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 108px;
  opacity: 0.35;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.flow-nav-node--active {
  opacity: 1;
}

.flow-nav-node--current {
  transform: scale(1.05);
}

.flow-nav-node--current .flow-nav-node-circle {
  border-color: #00d4aa;
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.45);
  animation: flow-node-pulse 1.2s ease-in-out infinite;
}

@keyframes flow-node-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 212, 170, 0.35); }
  50% { box-shadow: 0 0 24px rgba(0, 212, 170, 0.65); }
}

.flow-nav-node-circle {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 172, 172, 0.08);
  border: 2px solid rgba(0, 172, 172, 0.35);
  color: #00d4aa;
  font-size: 18px;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.flow-nav-node--active .flow-nav-node-circle {
  background: rgba(0, 172, 172, 0.15);
  border-color: rgba(0, 212, 170, 0.6);
}

.flow-nav-node--done .flow-nav-node-circle {
  background: rgba(0, 212, 170, 0.12);
  border-color: #00d4aa;
  color: #00d4aa;
}

.flow-nav-node-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #8b929a;
  text-align: center;
  line-height: 1.35;
  max-width: 100px;
}

.flow-nav-node--active .flow-nav-node-label {
  color: #c8cdd3;
}

.flow-nav-node--current .flow-nav-node-label {
  color: #00d4aa;
  font-weight: 600;
}

.flow-nav-connector {
  width: 52px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 12px;
}

.flow-nav-connector-line {
  stroke: rgba(0, 172, 172, 0.25);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 6 4;
  transition: stroke 0.35s ease;
}

.flow-nav-connector--active .flow-nav-connector-line {
  stroke: #00d4aa;
  stroke-dasharray: none;
  animation: flow-connector-flow 0.8s linear infinite;
}

@keyframes flow-connector-flow {
  0% { stroke-dasharray: 4 8; stroke-dashoffset: 0; }
  100% { stroke-dasharray: 4 8; stroke-dashoffset: -24; }
}

.flow-nav-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #525860;
  letter-spacing: 0.08em;
}

.flow-nav-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d4aa;
  animation: flow-status-blink 1s ease-in-out infinite;
}

@keyframes flow-status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.flow-nav-status-text {
  color: #8b929a;
}

.flow-nav-timeout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  font-size: 11px;
  color: #fbbf24;
}

.flow-nav-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #525860;
}

.flow-nav-footer-brand {
  color: rgba(0, 172, 172, 0.6);
}

.flow-nav-footer-sep {
  color: rgba(0, 172, 172, 0.3);
}

.flow-nav-footer-route {
  color: #00d4aa;
}

/* Mobile: full-screen, scrollable graph */
@media (max-width: 640px) {
  .flow-nav-content {
    width: 100%;
    padding: 0 12px;
    gap: 20px;
  }

  .flow-nav-frame {
    padding: 28px 16px 20px;
  }

  .flow-nav-logo-text {
    font-size: 14px;
  }

  .flow-nav-module {
    font-size: 10px;
    margin-bottom: 20px;
  }

  .flow-nav-node {
    width: 88px;
  }

  .flow-nav-node-circle {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }

  .flow-nav-node-label {
    font-size: 10px;
    max-width: 84px;
  }

  .flow-nav-connector {
    width: 36px;
  }

  .flow-nav-graph {
    margin: 0 -8px;
    padding: 0 8px;
  }
}

@media (max-width: 400px) {
  .flow-nav-nodes {
    justify-content: flex-start;
  }
}
