@import './globals.scss';

.Suggestion 
{
  width: 100%;

  .input {
    border: 1px solid rgba(69, 69, 69, 0.1);
    border-radius: $border-radius;
    overflow: visible;
    min-height: 30px;
  }

  input {
    position: relative;
    box-sizing: border-box;
    padding: 5px 10px;
    border: none;
    height: auto;
    overflow-y: auto;
    z-index: 2;
    margin: 5px;
    background-color: transparent;
    height: 30px;
    line-height: 30px;
  }

  input:focus {
    outline: none;
  }

  // Choosed suggestions
  .choosed {
    margin-right: 20px;
    width: 100%;
    clear: both;

    .suggestion {
      float: left;
      box-sizing: border-box;
      padding: 2px 35px 2px 5px;
      margin: 5px 0;
      border-radius: 25px;
      position: relative;
      box-sizing: border-box;
      padding: 3px 5px 3px 10px;
      background-color: $dodgerblue;
      color: $white;
      margin: 8px 4px;

      .suggestion-text{
        display: inline-block;
        font-size: 0.87rem;
        box-sizing: border-box;
        padding:2px 5px;
      }

      .suggestion-remove {
        display: inline-block;
        font-size: 0.67rem;
        text-align: center;
        border-radius: 50%;
        overflow: hidden;
        color: $white;
        margin-left: 5px;
        padding: 2px;
        width: 10px;
        height: 10px;
        line-height: 10px;
        border: 1px solid $white;
      }
      .suggestion-remove:hover {
        cursor: pointer;
      }
    }
  }

  .suggestions-area {
    position: relative;
    background-color: transparent;
    border-radius: $border-radius;
    box-sizing: border-box;
    z-index: 3;
    width: 100%;
    left: 10px;
    top: 20px;

    .ul {
      position: absolute;
      top: -15px;
      left: -10px;
      width: auto;
      border: 1px solid $border-color;
      z-index: 2;
      border-radius: $border-radius;
      background-color: $white;
      margin: 0;
      padding: 0;
      width: 100%;

      .suggestions {
        display: block;
        // Each single li`s height = 40px
        // Max height of the suggestions holder are 5 items
        max-height: 200px;
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
      }

      li {
        list-style: none;
        margin: 0;
        padding: 0;
        min-height: 30px;
        line-height: 30px;
        padding: 5px 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      // Mouse over or selected with an arrow down/up
      .active{
        background-color: $dodgerblue-light-xl;
      }

      // Selected - selection are inside the input area
      .selected{
        position: relative;
      }

      .selected:after{
        content: '✔';
        position: absolute;
        top: 5px;
        left: 5px;
        width: 5px;
        height: 5px;
        font-size: 0.77rem;
      }

      li:hover {
        cursor: pointer;
      }
    }
  }
}
