.floatBox-Container {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  word-break: keep-all;
  white-space: nowrap;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0px 4px 31px -8px rgba(0, 0, 0, 0.8);
  font-size: var(--panel-font-size);

  @include isDarkMode {
    background: #2d3338;
  }

  @include isAnimate {
    transition: width 0.4s, height 0.4s;
  }
}

.floatBox-Measure {
  position: absolute;
  top: 0;
  left: 0;
  width: max-content; // for including <select> width
  max-width: calc(var(--panel-width) * 0.7);
  padding: 10px;
}

.floatBox-Item {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 5px 10px;
  font-size: 1em;
  text-overflow: ellipsis;
  text-align: initial;
  outline: none;
  border: none;
  border-radius: 3px;
  color: var(--color-font);
  background-color: transparent;
  cursor: pointer;

  &:hover,
  &:focus {
    background-color: rgba(215, 214, 214, 0.25);
  }

  &::-moz-focus-inner {
    border: 0;
  }

  &:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }

  &:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }

  @include isDarkMode {
    border: 1px solid transparent;
    border-radius: 5px;

    &:focus,
    &:hover {
      border-color: #1abc9c;
      background-color: #29615a;
    }
  }
}

.floatBox-Select {
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  margin: 0;
  padding-right: 1.5em !important;
  background-color: transparent;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%231abc9c%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat, repeat;
  background-position: right .5em top 50%, 0 0;
  background-size: .65em auto, 100%;

  &::-ms-expand {
    display: none;
  }

  option {
    font-size: 1em;
    font-weight: normal;
  }
}

.floatBox-Btn {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 5px 10px;
  font-size: 1em;
  text-overflow: ellipsis;
  text-align: initial;
  outline: none;
  color: var(--color-font);
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;

  &:hover,
  &:focus {
    background: rgba(215, 214, 214, 0.25);
  }

  &::-moz-focus-inner {
    border: 0;
  }

  &:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }

  &:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }
}

.floatBox-Entry {
  margin-right: 1.5em;
  color: #f9690e;
}

.floatBox-compact {
  &.floatBox-Container {
    font-size: 12px;
    border-radius: 7px;
    box-shadow: 0px 1px 15px -7px rgba(0, 0, 0, 0.8);
  }

  .floatBox-Measure {
    padding: 5px 6px;
  }

  .floatBox-Item {
    padding: 3px 7px;
    border-radius: 2px;

    &:first-child {
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
    }

    &:last-child {
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
    }
  }
}

// Firefox fix
@-moz-document url-prefix() {
  .floatBox-Container {
    box-shadow: 0px 4px 20px -8px rgba(0, 0, 0, 0.8);

    .floatBox-Select {
      padding-left: 6px;
    }

    &.floatBox-compact {
      box-shadow: 0px 1px 13px -7px rgba(0, 0, 0, 0.8);

      .floatBox-Select {
        padding-left: 3px;
      }
    }
  }
}

// modify from https://loading.io/css/
.lds-ellipsis {
  display: block;
  margin: 0 auto;
  position: relative;
  width: 64px;
  height: 32px;
}
.lds-ellipsis div {
  position: absolute;
  top: 11px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #e2e2e1;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
  left: 6px;
  animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
  left: 6px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
  left: 26px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
  left: 45px;
  animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(19px, 0);
  }
}
