/**Variable**/
@import './base/checked.scss';

/*toolbar*/
.vhb-toolbar {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  color: $vhb-font-color;
  font-family: $vhb-font-family;
  background-color: $vhb-toolbar-background-color;
  &:after {
    content: "";
    display: block;
    clear: both;
    height: 0;
    overflow: hidden;
    visibility: hidden;
  }
  &.is--perfect {
    border: 1px solid $vhb-table-border-color;
    border-bottom-width: 0;
    background-color: $vhb-table-header-background-color;
  }
  &.is--loading {
    &:before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: $vhb-loading-z-index;
      user-select: none;
      background-color: $vhb-loading-background-color;
    }
  }
  .vhb-buttons--wrapper {
    flex-grow: 1;
    & > .vhb-button+.vhb-button--item,
    & > .vhb-button--item+.vhb-button,
    & > .vhb-button--item+.vhb-button--item {
      margin-left: 0.8em;
    }
    & > .vhb-button--item {
      display: inline-block;
    }
  }
  .vhb-tools--wrapper {
    & > .vhb-button+.vhb-tool--item,
    & > .vhb-tool--item+.vhb-button,
    & > .vhb-tool--item+.vhb-tool--item {
      margin-left: 0.8em;
    }
    & > .vhb-tool--item {
      display: inline-block;
    }
  }
  .vhb-tools--wrapper {
    & > .vhb-button {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
  .vhb-tools--wrapper,
  .vhb-tools--operate {
    display: flex;
    flex-shrink: 0;
    align-items: center;
  }
  .vhb-custom--wrapper {
    position: relative;
    margin-left: 0.8em;
    &.is--active {
      & > .vhb-button {
        background-color: $vhb-toolbar-custom-active-background-color;
        border-radius: 50%;
      }
      .vhb-custom--option-wrapper {
        display: block;
      }
    }
  }
  .vhb-custom--option-wrapper {
    display: none;
    position: absolute;
    right: 2px;
    text-align: left;
    background-color: $vhb-toolbar-panel-background-color;
    z-index: 19;
    border: 1px solid $vhb-table-border-color;
    border-radius: $vhb-border-radius;
    box-shadow: 0 1px 6px rgba(0,0,0,.2);
    .vhb-custom--header {
      padding: 0.28em 0;
      font-weight: 700;
      border-bottom: 1px solid $vhb-table-popup-border-color;
    }
    .vhb-custom--body {
      padding: 0.2em 0;
      max-height: 17.6em;
      .vhb-custom--option {
        &:hover {
          background-color: $vhb-table-row-hover-background-color;
        }
      }
    }
    .vhb-custom--header,
    .vhb-custom--body {
      & > li {
        max-width: 16em;
        min-width: 12.5em;
        padding: 0.2em 1em 0.2em 2.3em;
        @for $i from 2 through 8 {
          $interval: $i - 1 + 0.2;
          &.level--#{$i}{
            padding-left: #{$interval + 2.3}em;
            .vhb-checkbox--icon {
              left: #{$interval + 0.6}em;
            }
          }
        }
      }
    }
    .vhb-custom--footer {
      border-top: 1px solid $vhb-table-popup-border-color;
      text-align: right;
      button {
        background-color: transparent;
        width: 50%;
        height: 2.5em;
        border: 0;
        color: $vhb-font-color;
        text-align: center;
        cursor: pointer;
        &:focus {
          outline: none;
        }
        &:hover {
          color: $vhb-primary-color;
        }
      }
    }
  }
}

.vhb-custom--option-wrapper .vhb-custom--header,
.vhb-custom--option-wrapper .vhb-custom--body {
  list-style-type: none;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  user-select: none;
  & > li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.vhb-custom--option {
  @extend %XECheckbox;
  .vhb-checkbox--icon {
    left: 0.6em;
    top: 0.38em;
  }
}

.vhb-toolbar {
  font-size: $vhb-font-size;
  height: $vhb-toolbar-height-default;
  .vhb-custom--option {
    & > .vhb-checkbox--icon {
      font-size: $vhb-checkbox-font-size-default;
    }
  }
  &.size--medium {
    font-size: $vhb-font-size-medium;
    height: $vhb-toolbar-height-medium;
    .vhb-custom--option {
      & > .vhb-checkbox--icon {
        font-size: $vhb-checkbox-font-size-medium;
      }
    }
  }
  &.size--small {
    font-size: $vhb-font-size-small;
    height: $vhb-toolbar-height-small;
    .vhb-custom--option {
      & > .vhb-checkbox--icon {
        font-size: $vhb-checkbox-font-size-small;
      }
    }
  }
  &.size--mini {
    font-size: $vhb-font-size-mini;
    height: $vhb-toolbar-height-mini;
    .vhb-custom--option {
      & > .vhb-checkbox--icon {
        font-size: $vhb-checkbox-font-size-mini;
      }
    }
  }
}