//
// Tags - component that allows you to tag entities
// --------------------------------------------------

div.tagsinput {
  float: left;
  width: 100%;
  overflow-y: auto;
}

.taglist {
  text-align: center;

  .tag {
    position: relative;
    display: inline-block;
    height: 22px;
    padding: 1px 10px 0 12px;
    margin-bottom: @spacing-sm-px;
    margin-left: 20px;
    font-size: 13px;
    line-height: 18px;
    color: @tag-text-color;
    text-decoration: none;
    background: @tag-bg;
    border-top-right-radius: @tag-border-radius;
    border-bottom-right-radius: @tag-border-radius;

    &:first-child {
      margin-left: 10px;
    }

    span {
      display: block;
      float: left;
      max-width: 120px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    a {
      display: block;
      float: left;
    }

    small {
      font-size: 11px;
    }

    &:before {
      position: absolute;
      top: 0;
      left: -10px; // chrome looks better with -11px but IE has line if so
      float: left;
      width: 0;
      height: 0;
      /* tag point */
      content: "";
      border-color: transparent @tag-bg transparent transparent;
      border-style: solid;
      border-width: 11px 11px 11px 0;
    }

    &:after {
      position: absolute;
      top: 8px;
      left: 0;
      float: left;
      width: 5px;
      height: 5px;
      /* tag dot */
      content: "";
      background: @tag-dot-color;
      border-radius: 2px;
      box-shadow: -1px -1px 2px @tag-bg;
    }
  }
}

div.tagsinput {
  div[id$=addTag] {
    @media @sm {
      float: left;
      margin-left: 12px;
    }
  }

  span.tag.personal {
    background: @tag-bg-alt;
    &:before {
      border-color: transparent @tag-bg-alt transparent transparent;
    }
  }

  span.tag a {
    font-size: 11px;
    font-weight: bold;
    color: @tag-text-color;
    text-decoration: none;
    opacity: 0;
    -webkit-transition: opacity .3s ease 0s, color .3s ease 0s, background .3s ease 0s;
       -moz-transition: opacity .3s ease 0s, color .3s ease 0s, background .3s ease 0s;
  }

  span.tag:hover a {
    opacity: 1;
  }

  input {
    display: block;
    width: 80px;
    padding: 0;
    padding: 2px;
    margin: 0;
    margin: -2px 0 0 10px;
    margin: 0 auto;
    clear: both;
    font-family: helvetica;
    font-size: 13px;
    color: #8f8f8f !important; /* needed as script adds element value */
    background: transparent;
    border: 1px solid transparent;
    border-radius: @border-radius-base;
    outline: 0;
    box-shadow: none;

    &:hover,
    &:focus {
      background-color: rgba(0,0,0,.05);
    }

    div {
      display: block;
      float: left;
    }
  }

  .tags_clear {
    width: 100%;
    height: 0;
    clear: both;
  }
}

.not_valid {
  color: #90111a !important;
  background: #fbd8db !important;
}

.tag-wrap {
  .ui-autocomplete {
    position: absolute;
    top: 4px;
    left: 0;
    z-index: 90;
    z-index: 9999 !important;
    min-width: 200px;
    padding: 12px;
    list-style: none;
    background-color: @autocomplete-bg;
    border: 1px solid @autocomplete-border;
    border-radius: 0 0 @border-radius-base @border-radius-base;
    .box-shadow(0 5px 10px rgba(0,0,0,.2));

    li {
      margin-bottom: 4px;

      &:last-child {
        margin-bottom: 0;
      }

      a {
        display: block;
        padding: 4px;
        color: @autocomplete-text;
        text-decoration: none;
        cursor: pointer;

        &:hover {
          background: @autocomplete-rollover-bg;
          border-radius: 4px;
        }
      }
    }
  }
}

.tag-letterlist {
  color: lighten(@text-color, 20%);

  li {
    margin-right: 12px;
  }

  a {
    font-weight: @font-weight-semibold;
  }
}

/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-sm-min) {
  .taglist {
    text-align: left;

    .tag {
      float: left;
    }
  }

  div.tagsinput input {
    margin: 0;
  }
}
