@import "./../styles/index.scss";

.react-autosuggest__container--open .react-autosuggest__suggestions-container {
  border: 1px solid transparent;
  border-radius: 3px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 0 14px 0 rgba(0, 0, 0, 0.11);
  display: block;
  font-size: 12px;
  font-weight: 200;
  left: 0;
  position: absolute;
  overflow: auto;
  top: 31px;
  width: 370px;
  max-height: calc(100vh - 100px);
  z-index: 2;
}

.react-autosuggest__input {
  width: 100%;
  height: 30px;
  padding: 10px 20px;
  font-weight: 300;
  font-size: 12px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.react-autosuggest__input:focus {
  outline: none;
}

.react-autosuggest__container--open .react-autosuggest__input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.react-autosuggest__suggestions-container {
  display: none;
}

.react-autosuggest__suggestions-list {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.react-autosuggest__suggestion {
  color: #6a707e;
  cursor: pointer;
  margin: 0;
  padding: 8px 16px;
}

.recipient-suggestion {
  display: flex;
  flex-direction: row;
  position: relative;

  .recipient-icon {
    align-items: center;
    border-radius: 50%;
    color: #fff;
    display: flex;
    font-size: 12px;
    font-weight: 200;
    height: 27px;
    justify-content: center;
    position: relative;
    width: 27px;
  }

  .recipient-text {
    align-items: center;
    display: flex;
    font-size: 12px;
    font-weight: 200;
    margin-left: 10px;
    position: relative;
    width: 130px;

    > span{
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;

      .highlight {
        font-weight: bold;
      }
    }
  }

  .sugestion-email-right {
    align-items: center;
    display: flex;
    font-size: 12px;
    font-weight: 200;
    margin-left: 10px;
    width: 150px;
    
    > span{
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;

      .highlight {
        font-weight: bold;
      }
    }
  }
}

/* THEME
   ----------------------------- */
@mixin themable($_THEME, $_BACKGROUND_COLOR_SUGGESTION_ITEM, $_BACKGROUND_COLOR_SUGGESTION_ITEM_HOVER, $_BORDER_COLOR_SUGGESTION, $_COLOR_TEXT_SUGGESTION){
  [data-theme^=#{$_THEME}],
  [data-theme] [data-theme^=#{$_THEME}] {
    .react-autosuggest__container--open .react-autosuggest__suggestions-container {
      background-color: $_BACKGROUND_COLOR_SUGGESTION_ITEM;
      border-color: $_BORDER_COLOR_SUGGESTION;
    }

    .react-autosuggest__suggestion:hover {
      background-color: $_BACKGROUND_COLOR_SUGGESTION_ITEM_HOVER;
    }
    
    .react-autosuggest__suggestion--highlighted {
      background-color: $_BACKGROUND_COLOR_SUGGESTION_ITEM_HOVER;
    }

    .recipient-suggestion {
      .recipient-text {
        color: $_COLOR_TEXT_SUGGESTION;
      }

      .sugestion-email-right {
        > span{
          color: $_COLOR_TEXT_SUGGESTION;
        }
      }
    }
  }
}

@include themable($_THEME_LIGHT, $_BACKGROUND_COLOR_SUGGESTION_ITEM_LIGHT, $_BACKGROUND_COLOR_SUGGESTION_ITEM_HOVER_LIGHT, $_BORDER_COLOR_SUGGESTION_LIGHT, $_COLOR_TEXT_SUGGESTION_LIGHT);
@include themable($_THEME_DARK, $_BACKGROUND_COLOR_SUGGESTION_ITEM_DARK, $_BACKGROUND_COLOR_SUGGESTION_ITEM_HOVER_DARK, $_BORDER_COLOR_SUGGESTION_DARK, $_COLOR_TEXT_SUGGESTION_DARK);