@use 'sass:math';
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

.ng-autocomplete {
  width: 600px;
}

.autocomplete-default {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0.25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.autocomplete-container {
  position: relative;
  overflow: visible;

  .input-container {
    input {
      &:disabled {
        background-color: #eee;
        color: #666;
      }
    }

    .x {
      position: absolute;
      right: 10px;
      margin: auto;
      cursor: pointer;
      top: 43%;
      transform: translateY(-50%);

      i {
        color: rgba(0, 0, 0, 0.54);
        font-size: 18px;
        vertical-align: middle;
      }
    }

    .xx {
      position: absolute;
      right: 10px;
      margin: auto;
      cursor: pointer;
      top: 43%;
      transform: translateY(-50%);

      i {
        color: rgba(0, 0, 0, 0.54);
        font-size: 18px;
        vertical-align: middle;
      }
    }
  }

  .suggestions-container {
    position: absolute;
    width: 100%;
    background: white;
    height: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .25);
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    margin-left: 2px;

    ul {
      padding: 0;
      margin: 0;
      max-height: 240px;
      overflow-y: auto;

      li {
        position: relative;
        list-style: none;
        padding: 0;
        margin: 0;
        cursor: pointer;

        a {
          padding: 2px 10px 2px;
          display: block;
          text-decoration: none !important;
          color: #333333;
          cursor: pointer;
          color: rgba(0, 0, 0, 0.87) !important;
          font-size: 15px;
        }

        &:hover {
          background-color: rgba(158, 158, 158, 0.18) !important;
        }
      }
    }

    .complete-selected {
      background-color: rgba(158, 158, 158, 0.18) !important;
    }

    .heading {
      position: relative;
      padding: 10px 15px;
      border: solid 1px #f1f1f1;

      .text {
        font-size: 0.85em;
      }
    }

    .x {
      position: absolute;
      right: 10px;
      margin: auto;
      cursor: pointer;
      top: 50%;
      transform: translateY(-50%);

      i {
        color: rgba(0, 0, 0, 0.54);
        font-size: 18px;
        vertical-align: middle;
      }
    }

    &.is-hidden {
      visibility: hidden;
    }

    &.is-visible {
      visibility: visible;
    }
  }

  .not-found {
    padding: 0 0.5em;
    border: solid 1px #f1f1f1;
    background: white;

    div {
      padding: .4em 0;
      font-size: .95em;
      line-height: 1.4;
      border-bottom: 1px solid rgba(230, 230, 230, 0.7);
    }

  }

  &.active {
    z-index: 99999;
  }
}

.highlight {
  font-weight: bold;
}

.autocomplete-overlay {
  position: fixed;
  background-color: transparent;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

input[type=text]::-ms-clear {
  display: none;
}

/*Loading spinner*/

.sk-fading-circle {
  $circleCount: 12;
  $animationDuration: 1.2s;

  width: 20px;
  height: 20px;
  position: absolute;
  right: 10px;
  top: 0;
  bottom: 0;
  margin: auto;

  .sk-circle {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
  }

  .sk-circle:before {
    content: '';
    display: block;
    margin: 0 auto;
    width: 15%;
    height: 15%;
    background-color: #333;
    border-radius: 100%;
    animation: sk-circleFadeDelay $animationDuration infinite ease-in-out both;
  }

  @for $i from 2 through $circleCount {
    .sk-circle#{$i} {
      transform: rotate(math.div(360deg, $circleCount) * ($i - 1));
    }
  }

  @for $i from 2 through $circleCount {
    .sk-circle#{$i}:before {
      animation-delay: - $animationDuration + math.div($animationDuration, $circleCount) * ($i - 1);
    }
  }

}

@keyframes sk-circleFadeDelay {

  0%,
  39%,
  100% {
    opacity: 0
  }

  40% {
    opacity: 1
  }
}
