/* ===========================
   Pipeline Builder
   =========================== */

.pipeline-container {
  padding: 20px;
}

.pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pipeline-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.pipeline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Pipeline Steps --- */

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}

.pipeline-step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  width: 100%;
  max-width: 500px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pipeline-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-step-header .step-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.pipeline-step-header .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.pipeline-step-command {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text2);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-step-status {
  position: absolute;
  top: 16px;
  right: 16px;
}

.pipeline-step-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text2);
  display: flex;
  gap: 16px;
}

/* --- Pipeline Arrow --- */

.pipeline-arrow {
  width: 2px;
  height: 32px;
  background: var(--border);
  margin: 0 auto;
  position: relative;
}

.pipeline-arrow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--border);
}

/* --- Add Step Button --- */

.pipeline-add-step {
  border: 2px dashed var(--border);
  color: var(--text2);
  cursor: pointer;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  width: 100%;
  max-width: 500px;
  font-size: 13px;
  background: transparent;
  font-family: inherit;
  transition: border-color var(--transition), color var(--transition);
}

.pipeline-add-step:hover {
  border-color: var(--accent);
  color: var(--accent2);
}

/* --- Running Pipeline States --- */

.pipeline-running .pipeline-step.active {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(108, 92, 231, 0.2);
}

.pipeline-running .pipeline-step.active .step-number {
  background: var(--accent);
  color: #fff;
}

.pipeline-running .pipeline-step.completed {
  border-color: var(--green);
}

.pipeline-running .pipeline-step.completed .step-number {
  background: var(--green);
  color: #fff;
}

.pipeline-running .pipeline-step.failed {
  border-color: var(--red);
}

.pipeline-running .pipeline-step.failed .step-number {
  background: var(--red);
  color: #fff;
}

.pipeline-running .pipeline-step.pending {
  opacity: 0.5;
}

/* Arrow colors in running state */

.pipeline-running .pipeline-arrow.completed {
  background: var(--green);
}

.pipeline-running .pipeline-arrow.completed::after {
  border-top-color: var(--green);
}

.pipeline-running .pipeline-arrow.active {
  background: var(--accent);
}

.pipeline-running .pipeline-arrow.active::after {
  border-top-color: var(--accent);
}

/* --- Pipeline Progress Bar --- */

.pipeline-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.pipeline-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}

.pipeline-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.pipeline-progress-fill.complete {
  background: var(--green);
}

.pipeline-progress-fill.failed {
  background: var(--red);
}
