/* ==========================================================================
   Business Flow Diagram (Signal Flow Architecture — Archify Inspired)
   Theme: FutureOne — chantroituonglai.net
   ========================================================================== */

/* 1. Main Section Container */
.fut-flow {
  position: relative;
  background-color: #071827;
  color: #f1f5f9;
  padding: 88px 0 96px;
  overflow: hidden;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  border-top: 1px solid rgba(148, 216, 234, 0.12);
  border-bottom: 1px solid rgba(148, 216, 234, 0.12);
}

/* Background Gradients & Dot Matrix Grid */
.fut-flow::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

.fut-flow::after {
  content: '';
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 680px;
  height: 520px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, rgba(14, 165, 233, 0.05) 45%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.fut-flow .fut-container {
  position: relative;
  z-index: 2;
}

/* 2. Header */
.fut-flow__header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 40px;
}

.fut-flow__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.28);
  color: #22d3ee;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.fut-flow__header h2 {
  font-size: 2.375rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.fut-flow__header p {
  font-size: 1.0625rem;
  line-height: 1.68;
  color: #94a3b8;
  margin: 0;
}

/* 3. Interactive Route Controls (Route Probes) */
.fut-flow__routes-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.fut-flow__route-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(15, 35, 56, 0.7);
  border: 1px solid rgba(148, 216, 234, 0.2);
  color: #cbd5e1;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.fut-flow__route-btn:hover {
  background: rgba(22, 50, 80, 0.9);
  border-color: rgba(6, 182, 212, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.fut-flow__route-btn.is-active {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #22d3ee;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
}

.fut-flow__route-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: background 0.22s ease;
}

.fut-flow__route-btn.is-active .fut-flow__route-dot {
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}

/* 4. Story Chapter Toast / Status Bar */
.fut-flow__status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(13, 30, 49, 0.8);
  border: 1px solid rgba(148, 216, 234, 0.16);
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  backdrop-filter: blur(8px);
}

.fut-flow__chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #22d3ee;
}

.fut-flow__chapter-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22d3ee;
  animation: fut-flow-ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes fut-flow-ping {
  0% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

.fut-flow__chapter-text {
  color: #cbd5e1;
  font-weight: 500;
}

.fut-flow__progress-bar-wrap {
  width: 140px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
}

.fut-flow__progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* 5. Desktop SVG Stage */
.fut-flow__stage-wrapper {
  position: relative;
  width: 100%;
  background: rgba(9, 26, 43, 0.6);
  border: 1px solid rgba(148, 216, 234, 0.14);
  border-radius: 20px;
  padding: 24px 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.fut-flow__stage {
  position: relative;
  width: 100%;
  height: 560px;
  overflow: visible;
}

/* SVG Connection Layer */
.fut-flow__connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.fut-flow__path-bg {
  stroke: rgba(125, 211, 252, 0.15);
  stroke-width: 1.8px;
  fill: none;
  stroke-dasharray: 4 4;
}

.fut-flow__path-active {
  stroke: #06b6d4;
  stroke-width: 2.2px;
  fill: none;
  stroke-linecap: round;
  transition: stroke 0.3s ease, opacity 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.6));
}

.fut-flow__path-success {
  stroke: #10b981;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.6));
}

/* Signal Particles */
.fut-flow-particle {
  pointer-events: none;
  filter: drop-shadow(0 0 8px currentColor);
}

/* 6. Nodes Styling */
.fut-flow-node {
  position: absolute;
  z-index: 5;
  background: rgba(13, 31, 51, 0.94);
  border: 1px solid rgba(148, 216, 234, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.24s ease,
              box-shadow 0.24s ease,
              opacity 0.24s ease,
              filter 0.24s ease;
}

.fut-flow-node:hover,
.fut-flow-node:focus-visible {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(6, 182, 212, 0.8);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.3);
  outline: none;
  z-index: 15;
}

.fut-flow-node.is-active {
  border-color: #06b6d4;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.45);
}

.fut-flow-node.is-success {
  border-color: #10b981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.45);
}

.fut-flow-node.is-dimmed {
  opacity: 0.32;
  filter: blur(0.4px);
}

.fut-flow-node__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.fut-flow-node__icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fut-flow-node__group {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
}

.fut-flow-node h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
}

.fut-flow-node p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 3px 0 0;
  line-height: 1.35;
}

/* 7. Special Node Variants */

/* Hub Node (Center) */
.fut-flow-node--hub {
  width: 220px;
  background: linear-gradient(145deg, rgba(16, 42, 70, 0.96) 0%, rgba(9, 25, 43, 0.96) 100%);
  border: 1.5px solid rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.25);
  padding: 16px 18px;
  border-radius: 18px;
  text-align: center;
}

.fut-flow-node--hub .fut-flow-node__header {
  justify-content: center;
}

.fut-flow-node--hub .fut-flow-node__icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #ffffff;
  border-radius: 9px;
}

.fut-flow-node--hub h3 {
  font-size: 1.0625rem;
  font-weight: 800;
  color: #ffffff;
}

.fut-flow-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.fut-flow-chip {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.fut-flow-node--hub.is-active {
  border-color: #22d3ee;
  box-shadow: 0 0 45px rgba(34, 211, 238, 0.55);
}

/* Founder Node ("Bạn" - Top Center) */
.fut-flow-node--founder {
  width: 200px;
  background: linear-gradient(145deg, rgba(35, 29, 18, 0.96) 0%, rgba(18, 22, 34, 0.96) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.2);
  text-align: center;
  padding: 12px 16px;
  border-radius: 16px;
}

.fut-flow-node--founder .fut-flow-node__header {
  justify-content: center;
}

.fut-flow-node--founder .fut-flow-node__icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.fut-flow-founder-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-top: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.fut-flow-node--founder.is-active {
  border-color: #f59e0b;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.55);
}

/* Standard Node Sizing on Desktop */
.fut-flow-node:not(.fut-flow-node--hub):not(.fut-flow-node--founder) {
  width: 165px;
}

/* 8. Node Inspector Popover / Tooltip */
.fut-flow__inspector {
  position: absolute;
  z-index: 30;
  background: rgba(8, 22, 38, 0.96);
  border: 1px solid #06b6d4;
  border-radius: 14px;
  padding: 14px 18px;
  max-width: 290px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.3);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.fut-flow__inspector.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fut-flow__inspector-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #22d3ee;
  margin-bottom: 4px;
}

.fut-flow__inspector-desc {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #cbd5e1;
  margin: 0;
}

/* 9. Mini Dashboard (Simulated Outcome) */
.fut-flow__dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.fut-flow__metric-card {
  background: rgba(13, 30, 49, 0.7);
  border: 1px solid rgba(148, 216, 234, 0.14);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
}

.fut-flow__metric-card.is-highlighted {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.fut-flow__metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fut-flow__metric-card.is-highlighted .fut-flow__metric-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.fut-flow__metric-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.fut-flow__metric-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* 10. Controls & Bottom CTA Bar */
.fut-flow__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 216, 234, 0.1);
}

.fut-flow__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fut-flow__ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fut-flow__ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.fut-flow__replay-btn {
  background: rgba(6, 182, 212, 0.18);
  border-color: rgba(6, 182, 212, 0.4);
  color: #22d3ee;
}

.fut-flow__replay-btn:hover {
  background: rgba(6, 182, 212, 0.3);
  color: #ffffff;
}

.fut-flow__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #0891b2, #0284c7);
  color: #ffffff !important;
  font-size: 0.9375rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none !important;
  box-shadow: 0 4px 16px rgba(8, 145, 178, 0.35);
  transition: all 0.22s ease;
}

.fut-flow__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.5);
  color: #ffffff !important;
}

/* 11. Mobile Vertical Story Mode (< 768px) */
.fut-flow-mobile-story {
  display: none;
}

@media (max-width: 767px) {
  .fut-flow {
    padding: 60px 0 72px;
  }

  .fut-flow__header h2 {
    font-size: 1.75rem;
  }

  .fut-flow__stage-wrapper {
    display: none; /* Hide desktop 2D canvas on small phones */
  }

  .fut-flow-mobile-story {
    display: block;
    position: relative;
    padding-left: 28px;
    margin: 24px 0;
  }

  /* Vertical glowing track line */
  .fut-flow-mobile-story::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 24px;
    left: 11px;
    width: 2px;
    background: rgba(148, 216, 234, 0.2);
    border-radius: 9999px;
  }

  .fut-flow-mobile-progress-line {
    position: absolute;
    top: 14px;
    left: 11px;
    width: 2px;
    height: 0%;
    background: linear-gradient(180deg, #06b6d4, #10b981);
    border-radius: 9999px;
    transition: height 0.4s ease;
    box-shadow: 0 0 10px #06b6d4;
  }

  .fut-flow-mobile-card {
    position: relative;
    background: rgba(13, 31, 51, 0.9);
    border: 1px solid rgba(148, 216, 234, 0.16);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
  }

  .fut-flow-mobile-card::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1e3a5f;
    border: 2px solid #071827;
    transition: all 0.3s ease;
  }

  .fut-flow-mobile-card.is-active {
    border-color: #06b6d4;
    background: rgba(16, 42, 70, 0.95);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.25);
  }

  .fut-flow-mobile-card.is-active::before {
    background: #06b6d4;
    box-shadow: 0 0 12px #06b6d4;
  }

  .fut-flow-mobile-card.is-success {
    border-color: #10b981;
  }

  .fut-flow-mobile-card.is-success::before {
    background: #10b981;
    box-shadow: 0 0 12px #10b981;
  }

  .fut-flow-mobile-step-num {
    font-size: 0.6875rem;
    font-weight: 800;
    color: #22d3ee;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
  }

  .fut-flow-mobile-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px;
  }

  .fut-flow-mobile-card p {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0 0 8px;
    line-height: 1.45;
  }

  .fut-flow-mobile-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 9999px;
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.25);
  }

  .fut-flow__dashboard {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .fut-flow__footer {
    flex-direction: column;
    align-items: stretch;
  }

  .fut-flow__cta {
    text-align: center;
    justify-content: center;
  }
}

/* 12. Tablet Responsive Adjustments (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .fut-flow__stage {
    height: 560px;
  }

  .fut-flow-node:not(.fut-flow-node--hub):not(.fut-flow-node--founder) {
    width: 165px;
    padding: 12px 14px;
  }

  .fut-flow-node--hub {
    width: 220px;
    padding: 16px 18px;
  }

  .fut-flow-node--founder {
    width: 190px;
  }
}

/* 13. Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .fut-flow *,
  .fut-flow *::before,
  .fut-flow *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fut-flow-particle {
    display: none !important;
  }

  .fut-flow__path-active {
    opacity: 0.7;
  }

  .fut-flow-node {
    opacity: 1 !important;
    transform: none !important;
  }
}
