/*
Copyright 2020 Bruno Windels <bruno@windels.cloud>
Copyright 2020 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

@keyframes spinner {
    0% {
        transform: rotate(0);
        stroke-dasharray: 0 0 10 90;
    }
    45% {
        stroke-dasharray: 0 0 90 10;
    }
    75% {
        stroke-dasharray: 0 50 50 0;
    }
    100% {
        transform: rotate(360deg);
        stroke-dasharray: 10 90 0 0;
    }
}

.hydrogen:not(.legacy) .spinner circle {
    transform-origin: 50% 50%;
    animation-name: spinner;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    stroke-dasharray: 0 0 85 85;
    fill: none;
    stroke: currentcolor;
    stroke-width: 12;
    stroke-linecap: butt;
}

.hydrogen.legacy .spinner {
  display: inline-block;
  position: relative;
}

.hydrogen.legacy .spinner div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  padding: 2px;
  border: 2px solid currentcolor;
  border-radius: 50%;
  animation: legacy-spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: currentcolor transparent transparent transparent;
  width: var(--size);
  height: var(--size);
}

.hydrogen.legacy .spinner div:nth-child(1) {
  animation-delay: -0.45s;
}
.hydrogen.legacy .spinner div:nth-child(2) {
  animation-delay: -0.3s;
}
.hydrogen.legacy .spinner div:nth-child(3) {
  animation-delay: -0.15s;
}

@keyframes legacy-spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


.spinner {
    --size: 20px;
    width: var(--size);
    height: var(--size);
}
