/* ===== Flowchart & Visual Components ===== */

/* ── HORIZONTAL FLOW (How it works) ── */
.flow-pipeline {
  display: flex; align-items: flex-start; gap: 0;
  position: relative; padding: 0 0 20px;
}
.flow-node {
  flex: 1; text-align: center; position: relative; padding: 0 8px;
}
.flow-node-icon {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--white);
  background: var(--teal); position: relative; z-index: 2;
}
.flow-node:nth-child(2) .flow-node-icon { background: var(--teal-dark); }
.flow-node:nth-child(3) .flow-node-icon { background: var(--navy); }
.flow-node:nth-child(4) .flow-node-icon { background: var(--success); }
.flow-node h4 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.flow-node p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; max-width: 200px; margin: 0 auto; }
.flow-node .flow-time {
  display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 600;
  color: var(--teal); background: var(--teal-light); padding: 3px 12px; border-radius: 99px;
}
/* Arrow connector between nodes */
.flow-node::after {
  content: ''; position: absolute; top: 32px; right: -12px;
  width: 24px; height: 2px; background: var(--border); z-index: 1;
}
.flow-node::before {
  content: ''; position: absolute; top: 27px; right: -14px;
  width: 0; height: 0;
  border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  border-left: 8px solid var(--teal); z-index: 1; opacity: 0.5;
}
.flow-node:last-child::after, .flow-node:last-child::before { display: none; }

@media (max-width: 768px) {
  .flow-pipeline { flex-direction: column; gap: 0; align-items: stretch; }
  .flow-node { display: flex; align-items: flex-start; gap: 16px; text-align: left; padding: 16px 0; border-bottom: 1px dashed var(--border); }
  .flow-node:last-child { border-bottom: none; }
  .flow-node::after, .flow-node::before { display: none; }
  .flow-node-icon { margin: 0; width: 48px; height: 48px; flex-shrink: 0; font-size: 18px; }
  .flow-node p { max-width: none; }
  .flow-node h4 { font-size: 16px; }
}

/* ── PATIENT JOURNEY (Healthcare) ── */
.journey {
  display: flex; align-items: center; gap: 0; padding: 24px 0;
  overflow-x: auto; scrollbar-width: none;
}
.journey::-webkit-scrollbar { display: none; }
.journey-step {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 0 6px; min-width: 100px;
}
.journey-dot {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 8px; position: relative; z-index: 2;
}
.journey-dot.teal { background: var(--teal-light); }
.journey-dot.green { background: #ECFDF5; }
.journey-dot.blue { background: #EFF6FF; }
.journey-dot.amber { background: var(--orange-light); }
.journey-step .j-label { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.journey-step .j-sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.journey-arrow {
  flex: 0 0 auto; display: flex; align-items: center; padding: 0 2px; margin-bottom: 30px;
}
.journey-arrow svg { width: 24px; height: 12px; }
.journey-arrow path { fill: none; stroke: var(--border); stroke-width: 1.5; }
.journey-arrow polygon { fill: var(--teal); opacity: 0.4; }

@media (max-width: 640px) {
  .journey-step { min-width: 80px; }
  .journey-dot { width: 36px; height: 36px; font-size: 14px; }
  .journey-step .j-label { font-size: 11px; }
}

/* ── TEAM HUB DIAGRAM ── */
.hub-diagram {
  display: flex; align-items: center; justify-content: center;
  gap: 32px; padding: 32px 0;
}
.hub-center-node {
  width: 100px; height: 100px; border-radius: 24px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--white); flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(13,155,106,0.2);
}
.hub-center-node .h-icon { font-size: 28px; }
.hub-center-node .h-name { font-size: 10px; font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.hub-spokes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.hub-spoke {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  transition: all 0.2s;
}
.hub-spoke:hover { border-color: var(--teal); color: var(--teal); }
.hub-spoke .sp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
.hub-spoke .sp-arrow { color: var(--teal); font-size: 10px; opacity: 0.4; }
.hub-connector {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.hub-connector span {
  width: 32px; height: 1px; background: var(--border);
}
.hub-connector .arr { color: var(--teal); font-size: 10px; opacity: 0.5; }

@media (max-width: 768px) {
  .hub-diagram { flex-direction: column; gap: 16px; }
  .hub-spokes { grid-template-columns: repeat(2, 1fr); }
}

/* ── HANDOFF FLOW (Coordination example) ── */
.handoff-flow {
  display: flex; align-items: center; gap: 0; justify-content: center;
  padding: 24px 0; flex-wrap: wrap;
}
.handoff-box {
  padding: 12px 20px; border-radius: 10px; text-align: center;
  border: 1px solid var(--border); background: var(--white);
}
.handoff-box .hf-bot { font-size: 11px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: 0.3px; }
.handoff-box .hf-action { font-size: 13px; font-weight: 500; color: var(--text); margin-top: 2px; }
.handoff-arrow {
  padding: 0 8px; font-size: 18px; color: var(--teal); opacity: 0.4;
}

@media (max-width: 640px) {
  .handoff-flow { flex-direction: column; gap: 4px; }
  .handoff-arrow { transform: rotate(90deg); }
  .handoff-box { width: 100%; }
}

/* ── JOURNEY WRAPPER ── */
.journey-wrapper {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin-bottom: 32px;
}
.journey-wrapper h4 {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 4px; text-align: center;
}
.journey-wrapper .jw-sub {
  font-size: 12px; color: var(--text-muted); text-align: center; margin-bottom: 8px;
}
