@import "../../../../assets/scss/variables";

:root {
  --list-item-color: --title-color;
  --svg-to-black: inherit;
  --border-color: #EFEFEF;
  --service-box-dropdown: white;
  --item-hover:#1A73E8;
}


:root[data-theme="dark"] {
  --list-item-color: #20262E;
  --svg-to-black: brightness(0) saturate(100%) invert(11%) sepia(11%) saturate(1218%) hue-rotate(174deg) brightness(100%) contrast(90%);
  --border-color: #2F363E;
  --service-box-dropdown: #20262E;
--item-hover:#40474F;
}

.custom-radio-select {
  position: relative;
  min-width: 350px;
  width: 100%;

  .select-head {
    width: 100%;
    position: relative;
    background-color: $white;
    color: $title-color;
    font-size: 2rem;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    padding-left: 33px;
    cursor: pointer;

    .down-arrow {
      padding-right: 22px;
    }

    & ul {
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      padding: 0 15px 0 0;
      margin: 0;

      li {
        color: $title-color;
        text-overflow: ellipsis;
        overflow: hidden;
      }

    }

    & .open {
      margin: 0 10px;
      cursor: pointer;
    }

    &.disabled {
      cursor: initial;
      background-color: transparent;

      .down-arrow {
        display: none;
      }


      & .open {
        display: none;
      }
    }


  }

  ul.options {
    width: 100%;
    padding: 0;
    position: absolute;
    max-height: 600px;
    overflow-y: auto;
    z-index: 200000000;
    top: 0;
    left: 0;
    background-color: $dropdown-color;
    box-shadow: 0px 3px 6px #00000029;
    font-size: 1.8rem;
    letter-spacing: 0.4px;
    flex-direction: column;

    & li {
      min-height: 45px;
      padding-left: 34px;
      color: $text-color;
      display: flex;
      align-items: center;
      font-size: 2rem;
      letter-spacing: 0.4px;
      order: 1;

      &.disabled {
        cursor: not-allowed!important;
        pointer-events: none!important;
        color:#cccccc!important;
        background-color: #f8f8f8!important;
      }

      &.selected {

        order: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        padding-right: 30px;

        & .close {
          margin: 0 15px 0 auto;
          cursor: pointer;
        }
      }

      &:not(.selected) {

        cursor: pointer;
        font-size: 1.3rem;

        &:hover {
          color: $white;
          background-color: $secondary-color;
        }
      }

      & * {
        white-space: pre;
      }
    }

    img, svg {
      filter: $svg-default
    }
  }


  &.default {
    li {
      font-weight: $bold;
    }

    .options li {
      min-height: 36px;
    }

  }

  &.service-header {
    width: 100%;
    min-width: 280px;
    position: relative;

    .select-head {
      background-color: transparent;

      & li {
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        gap: 0.4rem;
      }

      img, svg {
        filter: $svg-default;
      }

    }
.options{
  right: 0;
  left:unset;
  min-width: max-content;
}
    ul.options li {
      font-size: 1.4rem;
      padding-right: 34px;
    }
  }

  &.search-listbox {
    min-width: 215px;
    width: 100%;

    .select-head {

      width: 100%;
      height: 37px;
      background-color: $blue-to-gray;
      color: $white;
      padding-left: 17px;
      border: none;

      & li {
        font-size: 1.4rem;
        color: $white;
      }

      .select-placeholder {
        font-size: 1.4rem;
      }
    }

    ul.options {
      min-width: max-content;

      li {
        font-size: 1.4rem;
        width: inherit;
        height: 37px;
        padding-right: 10px;
      }
    }
  }

  &.search-listbox-blue {
    min-width: 215px;
    width: max-content;

    .select-head {
      border-radius: 5px;
      width: 100%;
      height: 37px;
      background-color: $blue-to-gray;
      color: $white;
      padding-left: 17px;
      border: none;

      & li {
        font-size: 1.4rem;
        color: $white;
      }

      .select-placeholder {
        font-size: 1.4rem;
      }
    }

    ul.options {
      background-color: $blue-to-gray;
      min-width: max-content;
      border-radius: 5px;
      position: absolute;
      li {
        min-height: unset;
        color:$white;
        background-color: $blue-to-gray;
        font-size: 1.4rem;
        width: inherit;
        height: 37px;
        padding-right: 10px;

        padding-left: 17px;
        &:hover{
          color: $white;
background-color: var(--item-hover);
        }
      }
    }
  }

  &.form-options {
    .select-head {
      background-color: transparent;
      color: $inactive-color;
      font-size: 1.6rem;
      font-weight: $thin;
      border: none;
      border-bottom: 1px solid $black;


    }

    .options {
      top: 45px;
    }
  }


  &.mass-exodus {
    background: pink;
    width: 180px;
    min-width: unset;

    .select-head {
      height: 44px;
      border: 1px solid $main-color;
      color: $title-color;
      font-size: 1.2rem;
      font-weight: 300;
    }

    .options {
      margin-top: 43px;
    }
  }


}


.error-message {
  color: $error-color;
  font-size: 1.2rem;
  padding-left: 4px;
  margin-top: 5px;
}

