select[iris-custom-select-element] {
  display: none;
}

.iris-custom-select-container {
  position: relative;
  .iris-input__label {
    position: absolute;
    top: -21px;
    left: 0;
    display: block;
    transition: 0.2s;
    font-size: 1rem;
    // color: $colorPrimary;
    // font-weight: 700;
  }
  &.iris-input__input-field:focus {
    .iris-input__label {
      // top: -14px;
      color: $colorPrimary;
    }
    padding-bottom: 6px;
    // border-width: 3px;
    // border-image: linear-gradient(to right, $colorPrimary, $colorSecondary);
    // border-image-slice: 1;
    border: 2px solid #9b9b9b;
  }
}

.iris-custom-select-container {
  --width: 200px;
  display: block;
  position: relative;
  // width: var(--width);

  &:focus {
    outline: none;
  }

  // label that show the selected option's value
  .iris-custom-select-label-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .iris-custom-select-label {
      margin: 0;
      padding: 0;
      font-size: $textFieldFontSize;
      font-weight: 400;
      flex: 1;
      // width: var(--width);
      // border-bottom: 1px solid black;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      // padding: 0.25rem 0.5rem;
      cursor: pointer;
      user-select: none;
    }

    .arrow-down {
      border: 4px solid transparent;
      border-top-color: black;
    }
  }

  // the custom option list
  .iris-custom-select-list {
    display: none;
    min-width: 100%;
    background-color: #fff;
    position: absolute;
    z-index: 100;
    padding-top: 0.375em;
    top: 110%;
    left: 0;
    margin: 0;
    border: 1px solid black;
    // width: 100%;
    border-top: none;
    // min-height: var(--width);
    max-height: 50vh;
    overflow-y: auto;
    &.show {
      display: block;
    }

    & * {
      white-space: nowrap;
    }
  }

  // the custom option
  .iris-custom-select-option {
    user-select: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    &:hover {
      background-color: hsl(200, 100%, 70%);
    }
    &.selected {
      background-color: hsl(200, 100%, 50%);
    }
  }
}

// iris custom select variant - with groupped options
.iris-custom-select-container {
  .grouped-list-container {
    margin: 0.775rem;

    .grouped-list-label {
      font-weight: 500;
      font-size: 1.2em;
    }
    .iris-custom-select-option {
      padding: 0.4em 0.75em;
    }
  }
  .grouped-list-container + .grouped-list-container {
    margin-top: 0.675rem;
  }
}
