c8y-rectangle-spinner,
.c8y-rectangle-spinner {
  position: relative;
  display: block;
  padding-top: 45px;
  min-width: 50px;
  min-height: 40px;
  color: @text-muted;
  text-align: center;
  font-size: @font-size-base;

  .spinner {
    left: 50%;
    margin-left: -25px;
  }

  &.spinner-xs {
    padding-top: 35px;
    min-width: 30px;
    min-height: 30px;

    .spinner {
      margin-left: -15px;
    }
  }

  &.spinner-inline {
    display: inline-block;
    padding-top: 11px;
    padding-left: 50px;
    vertical-align: middle;
    text-align: left;

    .spinner {
      left: 0;
      margin-left: 0;
    }

    &.spinner-xs {
      padding-top: 5px;
      padding-left: 35px;
    }
  }
}

.spinner {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0 auto;
  width: 50px;
  height: 40px;
  text-align: center;
  font-size: 10px;
  opacity: 0.5;

  &.spinner-xs,
  .spinner-xs & {
    width: 30px;
    height: 30px;

    > div {
      margin: 0;
      width: 4px;
    }
  }
}

.spinner > div {
  display: inline-block;
  margin-right: 1px;
  width: 6px;
  height: 100%;
  background-color: @spinner-color;
  animation: stretchdelay 1.2s infinite ease-in-out;
}

.spinner .rect2 {
  animation-delay: -1.1s;
}

.spinner .rect3 {
  animation-delay: -1s;
}

.spinner .rect4 {
  animation-delay: -0.9s;
}

.spinner .rect5 {
  animation-delay: -0.8s;
}

@keyframes stretchdelay {
  0%,
  40%,
  100% {
    transform: scaleY(0.4);
  }

  20% {
    transform: scaleY(1);
  }
}

.spinner-panel-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);

  .grid-stack-item & {
    right: 10px;
    left: 10px;
  }

  .spinner {
    top: 0;
    left: 50%;
    margin-left: -25px;
  }
}

.spinner-inline-wrapper {
  position: relative;
  display: inline-block;
  width: 60px;
  vertical-align: middle;

  .spinner {
    .translate(0, -50%);
  }
}

.spinner-btn {
  position: relative;
  display: inline-block;
  width: 45px;
  transform: scale(0.5) translateY(-28px);
}
