/*
 * Copyright 2018-2020 DITA (AM Consulting LLC)
 *
 * 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.
 *
 * Developed on behalf of: Bokbasen AS (https://www.bokbasen.no)
 * Licensed to: Bokbasen AS and CAST under one or more contributor license agreements.
 */

@-webkit-keyframes load {
  0% {
    transform: translate(-2.5rem, -2.5rem) rotate(0deg);
  }

  100% {
    transform: translate(-2.5rem, -2.5rem) rotate(360deg)
  }
}

@keyframes load {
  0% {
    transform: translate(-2.5rem, -2.5rem) rotate(0deg);
  }

  100% {
    transform: translate(-2.5rem, -2.5rem) rotate(360deg)
  }
}

.loading.is-loading {
  .icon {
    animation: load 1s ease-in-out infinite;
  }
}

.loading {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  z-index: 10;
  background-color: transparentize($ui-white, 0.1);
  color: $ui-dark-gray;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;

  .icon {
    position: sticky;
    top: 50%;
    left: 50%;
    width: 4rem;
    height: 4rem;
    transform: translate(-50%, -50%);
    fill: $ui-default;
  }
}

[data-viewer-theme="sepia"] {
  .loading {
    background-color: transparentize($sepia-bg, 0.1);
  }
}

[data-viewer-theme="night"] {
  .loading {
    background-color: lighten($night-bg, 10%);
    color: $ui-light-gray;

    .icon {
      fill: $ui-light-gray;
    }
  }
}
