:host {
  position: relative;
  display: inline-block;
  height: var(--size);
  width: var(--size);
}

.progress {
  --margin: var(--spacing-unit);
  --stroke-background-color: var(--color-background-secondary);
  --label-color: var(--color-text);

  position: relative;
  height: var(--size);
  width: var(--size);
  line-height: var(--size);
  font-size: var(--font-size);
  margin: var(--margin);
}

/* Tint */
.progress.neutral {
  --stroke-color: var(--color-neutral);
}

.progress.primary {
  --stroke-color: var(--color-primary);
}

.progress.secondary {
  --stroke-color: var(--color-secondary);
}

.progress.warning {
  --stroke-color: var(--color-warning);
}

.progress.danger {
  --stroke-color: var(--color-danger);
}

/* Scale */
.progress.small {
  --size: 24px;
  --font-size: 9px;
  --stroke-width: 3px;
}

.progress.medium {
  --size: 32px;
  --font-size: 12px;
  --stroke-width: 4px;
}

.progress.large {
  --size: 40px;
  --font-size: 18px;
  --stroke-width: 5px;
}

.progress.leaned {
  --margin: 0;
}

svg.foreground {
  height: var(--size);
  width: var(--size);
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

svg.background {
  height: var(--size);
  width: var(--size);
  position: absolute;
  top: 0;
  left: 0;
}

label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-color);
  font-weight: bold;
  font-size: var(--font-size);
  width: var(--size);
  height: var(--size);
  line-height: var(--size);
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

circle.foreground {
  stroke: var(--stroke-color);
  transition: stroke-dashoffset 0.35s;
  stroke-linecap: round;
  stroke-width: var(--stroke-width);

  animation-duration: 0.8s;
  animation-timing-function: linear;
  animation-delay: 0s;
  animation-iteration-count: infinite;
  transform-origin: 50% 50% 0;
}

circle.background {
  stroke: var(--stroke-background-color);
  stroke-width: var(--stroke-width);
}

circle.rotating {
  animation-name: rotate;
}
