/**
 * @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;
  width: 100%;
  overflow: hidden;
  background-color: var(--fd-border-muted);
  border-radius: var(--fd-radius-full);
}

/* 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 {
  background-image: linear-gradient(
    -45deg,
    transparent 25%,
    rgba(255, 255, 255, 0.2) 25%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 50%,
    transparent 75%,
    rgba(255, 255, 255, 0.2) 75%
  );
  background-size: 40px 40px;
  animation: fd-progress-stripe 1s linear infinite;
}

/* ========================================================================
 * 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;
  gap: var(--fd-space-1);
  font-size: var(--fd-text-xs);
  color: var(--fd-muted-foreground);
}

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

/* 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 {
  background-color: var(--fd-info);
  animation: fd-progress-pulse 1.5s ease-in-out infinite;
}

.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);
}
