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

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

  .select-head {
    width: 100%;
    position: relative;

    .buttons {
      position: absolute;
      right: 0px;
      top: 50%;
      transform: translateY(-50%);
      z-index: 10;
      cursor: pointer;
      display: flex;
      align-items: center;
      width: 50px;
      justify-content: flex-end;

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

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


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

      & .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: white;
    box-shadow: 0px 3px 6px #00000029;
    font-size: 1.8rem;
    letter-spacing: 0.4px;
    display: flex;
    flex-direction: column;

    input {
      margin: 5px;
    }

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

      &.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;
        }
      }

      &.active {
        color: white;
        background-color: $secondary-color;
      }
    }
  }

  &.user-form-select {
    z-index: unset;

    &.hasError {

      .select-head {
        border-color: $error-color;
      }
    }

    .select-head {
      padding-right: 25px;
      background-color: unset;
      border-top: unset;
      border-left: unset;
      border-right: unset;
      border-bottom: .1rem solid #707070;
      //padding: 0 0 0 .5rem;
      height: 3rem;

      & input {
        text-overflow: ellipsis;
      }

      &.disabled {
        border: none;
      }

      &.hasSelected input::placeholder {
        font-size: $input-size !important;
      }

      span {
        &.select-selected {
          li {
            font-size: $input-size;
            list-style: none;
          }

        }

        &.select-placeholder {
          font-size: $index-size;
        }

        font-weight: $thin;
        color: $text-color;
      }


    }

    .options {
      //padding-right: 15px;
      //padding-bottom: 12px;
      padding: 12px;
      top: 31px;
      max-height: 20rem;

      & .options-inner {
        overflow-y: auto;

        &::-webkit-scrollbar {
          width: 5px;
          height: 50% !important;
          transform: scaleY(0.5) !important;
        }

        /* Track */
        &::-webkit-scrollbar-track {
          background: #CCCCCC;
          margin-top: 15px;
        }

        /* Handle */
        &::-webkit-scrollbar-thumb {
          background: #040059;
        }

        /* Handle on hover */
        &::-webkit-scrollbar-thumb:hover {
        }

      }


      .selected {
        //padding: 0 0 0 .5rem;
        //height: 4rem;
        //font-size: $input-size;
        //font-weight: $thin;
        //color: $text-color;
      }



      li {
        padding: .5rem 0 .5rem .5rem;
        height: 4rem;
        font-size: $input-size;
        font-weight: $thin;
        color: $text-color;
        height: auto;

        &:not(.selected) {
          cursor: pointer;
          font-size: 1.6rem;
        }
      }
    }
  }

  .select-group {
    p {
      color:$main-color;
            font-size: 1.2rem;
            padding: 10px 0 10px 15px;
            font-weight: bold;
            background-color: #F3F8FC;
    }
    li {
      padding-left: 50px !important;
    }
  }


}

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

