@progress-fill-light: var(--main-color-brand-highlight);

.progress {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress > *:nth-child(2) {
  margin-top: 20px;
}

.progress__title {
  font-size: @text-size-3;
  font-weight: bold;
  color: var(--progress-title-color);
}

.progress--circular {
  @circle-size: 14px;

  .size(@circle-size);
  border-radius: 50%;
  opacity: .25;
  // TODO: white
  // box-shadow: inset 0 0 0 2px fade(@icon-color, 100%);
  position: relative;

  .progress__mask,
  .progress__fill {
    .size(@circle-size);
    position: absolute;
    border-radius: 50%;
    backface-visibility: hidden;
  }

  .progress__mask {
    clip: rect(0px, @circle-size, @circle-size, @circle-size/2);
  }

  .progress__fill {
    clip: rect(0px, @circle-size/2, @circle-size, 0px);
    background-color: var(--progress-circular-background);
  }
}

.progress--circular.progress--large {
  @circle-size: 46px;

  .size(@circle-size);
  // TODO: white
  // box-shadow: inset 0 0 0 6px fade(@icon-color, 100%);

  .progress__mask,
  .progress__fill {
    .size(@circle-size);
  }

  .progress__mask {
    clip: rect(0px, @circle-size, @circle-size, @circle-size/2);
  }

  .progress__fill {
    clip: rect(0px, @circle-size/2, @circle-size, 0px);
  }
}

.progress--indefinite {
  width: 42px;
  display: flex;
}

.progress__item--indefinite {
  .size(14px);
  border-radius: 7px;
  background-color: var(--progress-indefinite-background);
  animation: scale 600ms alternate infinite;

  &:nth-child(1) {
    animation-delay: -.4s;
  }

  &:nth-child(2) {
    animation-delay: -.2s;
  }

  &:nth-child(3) {
    animation-delay: 0;
  }
}

.progress--indefinite.progress--small {
  width: 24px;

  span {
    .size(8px);
  }
}

.progress__bar {
  min-width: 200px;
  display: flex;
  background-color: var(--progress-bar-background);
  height: 10px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress__bar-fill {
  display: block;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--icon-color);
  transition: transform 200ms;
  backface-visibility: hidden;
  border-radius: 10px;
}

.progress__bar--small {
  height: 5px;
  border-radius: 5px;
}

.progress__bar-fill--small {
  border-radius: 5px;
}

.progress__bar-fill--light {
  background-color: @progress-fill-light;
}

.progress__bar--light {
  background-color: #dcdcdc;
}

.progress__bar-fill--light {
  background-color: @progress-fill-light;
}

.progress__bar-indefinite-fill {
  background: linear-gradient(-45deg, @progress-fill-light 25%, transparent 25%, transparent 50%, @progress-fill-light 50%, @progress-fill-light 75%, transparent 75%, transparent);
  background-size: 18px 18px;
  animation: animatedBackground 0.3s linear infinite;
  overflow: hidden;
}


.progress--indefinite-circular {
  position: relative;
  display: inline-block;
}

.progress--indefinite-circular__spinner {
  animation: avocodeUiRotate 10s linear infinite;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress--indefinite-circular--light {
  --contrast-rgb: 255, 255, 255;
}

.progress--indefinite-circular--dark {
  --contrast-rgb: 0, 0, 0;
}
