// Flow diagram
.flow-diagram {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--p-surface-border);
  background: var(--p-surface-ground);
  color: var(--p-text-color);
  cursor: pointer;
  transition: all 0.2s;

  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  &.active {
    ring: 2px;
    border-color: var(--p-primary-color);
    box-shadow: 0 0 0 2px var(--p-primary-color);
  }
}

.flow-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  flex-shrink: 0;
}

.flow-label {
  white-space: nowrap;
}

.flow-arrow {
  font-size: 0.7rem;
  color: var(--p-text-muted-color);
}

// Roadmap timeline
.roadmap {
  position: relative;
}

.roadmap-phase {
  display: flex;
  gap: 1.25rem;
  position: relative;

  &:last-child .timeline-line {
    display: none;
  }
}

.timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 44px;
  flex-shrink: 0;
}

.timeline-node {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.timeline-line {
  width: 3px;
  flex: 1;
  background: linear-gradient(
    to bottom,
    var(--p-surface-border) 0%,
    var(--p-surface-border) 60%,
    transparent 100%
  );
  border-radius: 2px;
  min-height: 20px;
}

.phase-card {
  flex: 1;
  background: var(--p-surface-0);
  border: 1px solid var(--p-surface-border);
  border-radius: 1rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

  &:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
  }
}

.expanded .phase-card {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--p-primary-color);

  &:hover {
    transform: none;
  }
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.phase-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--p-surface-border);
  padding-top: 1.25rem;
  animation: slideDown 0.3s ease;
  cursor: default;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 2000px;
  }
}

// Responsive
@media (max-width: 640px) {
  .timeline-track {
    width: 36px;
  }

  .timeline-node {
    width: 36px;
    height: 36px;

    span {
      font-size: 0.75rem;
    }
  }

  .phase-header {
    padding: 0.75rem 1rem;
  }

  .phase-body {
    padding: 0 1rem 1rem;
    padding-top: 1rem;
  }

  .flow-diagram {
    gap: 0.35rem;
  }

  .flow-step {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }

  .flow-arrow {
    font-size: 0.55rem;
  }
}
