/**
 * @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-color-gray-200);
  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-color-success-500);
}

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

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

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

.fd-progress-bar__segment--cancelled {
  background-color: var(--fd-color-gray-400);
}

/* 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-font-size-xs);
  color: var(--fd-color-gray-600);
}

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

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

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

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

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

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