/**
 * @file
 * FlowDrop Progress Bar Component Styles
 *
 * Segmented progress bar for pipeline job visualization.
 */

.fd-progress-bar {
  display: flex;
  flex-direction: column;
  gap: var(--fd-space-2);
}

/* ========================================================================
 * TRACK
 * ======================================================================== */

.fd-progress-bar__track {
  display: flex;
  overflow: hidden;
  width: 100%;
  border-radius: var(--fd-radius-full);
  background-color: var(--fd-border-muted);
}

/* Size variants */
.fd-progress-bar--sm .fd-progress-bar__track {
  height: 0.375rem;
}

.fd-progress-bar--md .fd-progress-bar__track {
  height: 0.625rem;
}

.fd-progress-bar--lg .fd-progress-bar__track {
  height: 0.875rem;
}

/* ========================================================================
 * SEGMENTS
 * ======================================================================== */

.fd-progress-bar__segment {
  height: 100%;
  transition: width var(--fd-transition-normal);
}

/* First segment rounded on left */
.fd-progress-bar__segment:first-child {
  border-start-start-radius: var(--fd-radius-full);
  border-end-start-radius: var(--fd-radius-full);
}

/* Last segment rounded on right */
.fd-progress-bar__segment:last-child {
  border-start-end-radius: var(--fd-radius-full);
  border-end-end-radius: var(--fd-radius-full);
}

/* Status colors */
.fd-progress-bar__segment--completed {
  background-color: var(--fd-success);
}

.fd-progress-bar__segment--running {
  background-color: var(--fd-info);
}

.fd-progress-bar__segment--pending {
  background-color: var(--fd-warning);
}

.fd-progress-bar__segment--failed {
  background-color: var(--fd-error);
}

.fd-progress-bar__segment--cancelled {
  background-color: var(--fd-muted-foreground);
}

/* Running animation */
@keyframes fd-progress-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.fd-progress-bar__segment--animated {
  animation: fd-progress-pulse 1.5s ease-in-out infinite;
}

/* Stripe animation for running state */
@keyframes fd-progress-stripe {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}

.fd-progress-bar__segment--running.fd-progress-bar__segment--animated {
  animation: fd-progress-stripe 1s linear infinite;
  background-image: linear-gradient(-45deg, transparent 25%, rgb(255, 255, 255, 0.2) 25%, rgb(255, 255, 255, 0.2) 50%, transparent 50%, transparent 75%, rgb(255, 255, 255, 0.2) 75%);
  background-size: 40px 40px;
}

/* ========================================================================
 * LABELS
 * ======================================================================== */

.fd-progress-bar__labels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fd-space-2) var(--fd-space-4);
}

.fd-progress-bar__label {
  display: inline-flex;
  align-items: center;
  color: var(--fd-muted-foreground);
  font-size: var(--fd-text-xs);
  gap: var(--fd-space-1);
}

.fd-progress-bar__label-dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--fd-radius-full);
}

/* Label dot colors */
.fd-progress-bar__label--completed .fd-progress-bar__label-dot {
  background-color: var(--fd-success);
}

.fd-progress-bar__label--running .fd-progress-bar__label-dot {
  animation: fd-progress-pulse 1.5s ease-in-out infinite;
  background-color: var(--fd-info);
}

.fd-progress-bar__label--pending .fd-progress-bar__label-dot {
  background-color: var(--fd-warning);
}

.fd-progress-bar__label--failed .fd-progress-bar__label-dot {
  background-color: var(--fd-error);
}

.fd-progress-bar__label--cancelled .fd-progress-bar__label-dot {
  background-color: var(--fd-muted-foreground);
}

.fd-progress-bar__label-text {
  font-weight: var(--fd-font-weight-medium);
}
