$height_combo_input: 35px; // TODO: Delete this when select component in forms module is deleted in genome angular
@import "./select-option"; // TODO: Delete this when select component in forms module is deleted in genome angular

// Styles for the select component (in BzgSelectModule)

.bz-select-trigger {
    align-items: center;
    background: $bz-neutral-100;
    border: 1px solid $bz-neutral-300;
    border-radius: $bz-border-radius-m;
    display: flex;
    padding: $bz-space-inset-squish-s;
    width: inherit;
    outline: none;

    &:focus:not(.bz-select-trigger--disabled) {
      outline: 0;
    }

    &--below {
      border-color: $bz-theme-400;
      border-bottom-color: $bz-neutral-100;
      border-radius: $bz-border-radius-m $bz-border-radius-m 0 0;
    }

    &--multiple {
      padding: 0rem 1.6rem 0rem 0rem;
      min-height: 3.9rem;
    }

    &--above {
      border-color: $bz-theme-400;
      border-top-color: $bz-neutral-100;
      border-radius: 0 0 $bz-border-radius-m $bz-border-radius-m;
    }

    &--disabled {
      background-color: $bz-neutral-200;
      border-color: $bz-neutral-300;
      color: $bz-neutral-400;
    }

    &__value {
      flex-grow: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      &--multiple {
        display: flex;
        flex-direction: column;
        padding-left: 1.6rem;
      }
    }

    &__placeholder {
      flex-grow: 1;
      color: $bz-neutral-500;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      &--multiple {
        margin-left: 0.8rem;
      }
    }

    &--compact {
      font-size: $bz-font-size-body-small;
      padding: $bz-space-inset-squish-xs;

      &::placeholder {
        font-size: $bz-font-size-body-small;
        padding: $bz-space-inset-squish-xs;
      }
    }
}

.bz-select-options {
  background-color: $bz-neutral-100;
  border-radius: $bz-border-radius-m;
  border: 0;
  display: flex;
  flex-direction: column;
  max-height: 186px;
  overflow: auto;
  user-select: none;
  width: 100%;

  &--above {
    border-radius: $bz-border-radius-m;
    border: 0;
  }
}


// TODO: Delete this styles when select component in forms module is deleted in genome angular

.bz-select {
  width: 100%;
  border-radius: $bz-border-radius-m;
  position: relative;

  &__input {
    border: 1px solid $bz-neutral-300;
    padding: $bz-space-inset-squish-xs;
    color: $bz-neutral-600;
    height: 35px;
    background-color: $bz-neutral-200;
    width: inherit;
    outline: none;

    &--active {
      border-color: $bz-theme-400;
    }
  }

  &__content {
    position: absolute;
    top: $height_combo_input;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    max-height: 120px;
    border: 1px solid #ccc;
    border-radius: $bz-border-radius-m;
    background-color: $bz-neutral-100;
    box-shadow: $bz-shadow-s;
    z-index: 100;
    overflow: auto;
  }
  &__search {
    display: flex;
    align-items: center;
    margin-left: 1.6rem;
  }

  i {
    height: 16px;
    width: 16px;
    position: absolute;
    top: 0;
    bottom: 0;
    right: 10px;
    margin: auto auto auto -20px;
    background-size: contain;
    // todo: change this to svg in template
    background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iRWJlbmVfM19Lb3BpZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4Ig0KCSB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1OSAzMS45IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OSAzMS45OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxLjU7c3Ryb2tlLW1pdGVybGltaXQ6MTA7fQ0KPC9zdHlsZT4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjU3LjYsMS44IDI5LjUsMjkuOCAyOS41LDI5LjggMS41LDEuOCAiLz4NCjwvc3ZnPg0K) no-repeat center center;
    cursor: pointer;
    transition: all 0.25s ease-in-out;

    &.active {
      transform: rotate(180deg);
    }
  }
}


.bz-select__pill {
  max-height: 2.6rem;
  margin-right: 0.4rem;
  &--closed {
    margin-top: 0.2rem;
    margin-bottom: 0.4rem;
  }
}

.bz-select__pills {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  &__counter {
    background: $bz-theme-400;
    padding: 0.2em .8em;
    border: 1px solid #E0E0E0;
    color: white;
    border-radius: 2rem;
    text-align: center;
    display: flex;
    &--hidden {
      visibility: hidden;
    }
  }
  &--closed {
    flex-wrap: wrap;
    overflow: hidden;
    max-height: 3.7rem;
  }
  &--open {
    border-bottom: 1px solid #E0E0E0;
    border-top: 0;
    max-height: 12.3rem;
    overflow: auto;
    padding: 0.4rem 1.6rem;
  }
  &--above {
    border-top: 1px solid #E0E0E0;
    border-bottom: 0;
  }

  &--compact {
    font-size: $bz-font-size-body-small;
    padding: $bz-space-inset-squish-xs;
  }
}



.bz-select-overlay-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: $bz-neutral-100;
  border: 1px solid $bz-theme-400;
  border-top: 0;
  border-radius: 0 0 $bz-border-radius-m $bz-border-radius-m;
  &--above {
    border-top: 1px solid $bz-theme-400;
    border-bottom: 0;
    border-radius: $bz-border-radius-m $bz-border-radius-m 0 0;
  }
  &__multiple {
    border-top: 1px solid $bz-theme-400;
    border-radius: $bz-border-radius-m;
    &--above {
      flex-direction: column-reverse;
    }
  }
}

.bz-select-trigger {
  &--multiple {
    padding: 0rem 1.6rem 0rem 0rem;
    min-height: 3.9rem;
  }
  &--active {
    border-color: $bz-theme-400;
    border-bottom-color: $bz-neutral-100;
    border-radius: $bz-border-radius-m $bz-border-radius-m 0 0;
  }
  &__placeholder {
    &--multiple {
      margin-left: 0.8rem;
    }
  }
  &__value {
    &--multiple {
      display: flex;
      flex-direction: column;
      padding-left: 1.6rem;
    }
  }
}


