:host {
  display: block;
  width: 100%;
  min-height: 1.25rem;
}

.nui-progress-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border-radius: var(--border-radius-sm);
  background: var(--nui-card-border);
}

.nui-progress-bar-value {
  height: 100%;
  border-radius: inherit;
  background: var(--nui-primary-color);
  transition: width var(--transition-medium) ease;
}

.nui-progress-bar[mode="determinate"] .nui-progress-bar-value {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  overflow: hidden;
}

.nui-progress-bar-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: var(--font-size-2xs);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;
  color: var(--nui-white-text-color);
}

.nui-progress-bar[mode="indeterminate"] .nui-progress-bar-value {
  position: absolute;
  inset: 0;
  width: 100%;
  background: transparent;
}

.nui-progress-bar[mode="indeterminate"] .nui-progress-bar-value::before,
.nui-progress-bar[mode="indeterminate"] .nui-progress-bar-value::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--nui-primary-color);
  will-change: left, right;
}

.nui-progress-bar[mode="indeterminate"] .nui-progress-bar-value::before {
  animation: nui-progress-bar-indeterminate 2.1s
    cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}

.nui-progress-bar[mode="indeterminate"] .nui-progress-bar-value::after {
  animation: nui-progress-bar-indeterminate-short 2.1s
    cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
  animation-delay: 1.15s;
}

@keyframes nui-progress-bar-indeterminate {
  0% {
    left: -35%;
    right: 100%;
  }

  60% {
    left: 100%;
    right: -90%;
  }

  100% {
    left: 100%;
    right: -90%;
  }
}

@keyframes nui-progress-bar-indeterminate-short {
  0% {
    left: -200%;
    right: 100%;
  }

  60% {
    left: 107%;
    right: -8%;
  }

  100% {
    left: 107%;
    right: -8%;
  }
}
