@keyframes ux-horizontal-loader-loading {
  0%, 100% {
    transform: translateX(var(--ux-loader-animation-offset-start));
  }
  50% {
    transform: translateX(var(--ux-loader-animation-offset-end));
  }
}
@keyframes ux-spin {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
:host {
  display: inline-block;
}

:host([variant=horizontal]) {
  background: var(--ux-loader-track-color);
  border-radius: var(--ux-loader-bar-radius);
  height: var(--ux-loader-bar-size);
  overflow: hidden;
  position: relative;
  width: 100%;
}
:host([variant=horizontal])::before {
  content: "";
  animation: ux-horizontal-loader-loading var(--ux-loader-animation-duration, 2s) infinite ease;
  background: var(--ux-loader-bar-color);
  border-radius: var(--ux-loader-bar-radius);
  height: var(--ux-loader-bar-size);
  left: 50%;
  position: absolute;
  transform: translateX(-150%);
  width: 50%;
}

:host([variant=spinner]) {
  border: 6px solid #eff0f4;
  border-radius: 50%;
  height: 50px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  vertical-align: middle;
  width: 50px;
}
:host([variant=spinner])::after {
  animation: ux-spin 1s linear infinite;
  border: 6px solid transparent;
  border-radius: 50%;
  border-top-color: var(--ux-spinner-track-color);
  content: "";
  inset: -6px;
  position: absolute;
}

@media (prefers-reduced-motion) {
  :host([variant=horizontal])::before {
    animation-duration: 4s;
  }
  :host([variant=spinner])::after {
    animation-duration: 3s;
  }
}