$main: $lbry-teal-5;

.tags {
  @extend .ul--no-style;
  display: flex;
  flex-wrap: wrap;
  min-width: 0;

  .tag {
    margin-left: 0;
    margin-top: var(--spacing-small);
    margin-right: var(--spacing-small);
  }
}

.tags--remove {
  @extend .tags;

  .tag {
    margin-top: 0;
    margin-bottom: var(--spacing-small);
  }
}

.tags--vertical {
  @extend .tags;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
}

.tags--selected {
  @extend .tags;
  margin: var(--spacing-large) 0;
}

.tags__input-wrapper {
  display: flex;

  // Nested style needed for more specificity
  .tag__input {
    @extend .tag--remove;
    height: auto;
    padding: calc(var(--spacing-miniscule) - 1px) var(--spacing-small);
    background-color: mix($lbry-teal-1, $lbry-white, 10%);
    border: 1px dashed;
    border-color: lighten($lbry-teal-5, 10%);
    margin-top: -2px; // To handle the border height

    [data-mode='dark'] & {
      background-color: var(--dm-color-03);
      border-color: $lbry-gray-4;
    }
  }
}

.tag {
  @extend .badge;
  @extend .badge--tag;
  user-select: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: lowercase;
  max-width: 10rem;
  min-width: 0;

  &:hover {
    background-color: $lbry-teal-4;
    color: $lbry-white;
    svg {
      stroke: $lbry-white;
    }
  }

  &:active {
    background-color: $main;
  }
}

.tag--remove {
  max-width: 20rem;
  font-size: var(--font-body);
}

.tag--add {
  background-color: $lbry-teal-5;
  color: $lbry-white;
  .icon {
    stroke: $lbry-white;
  }

  &.tag--mature {
    @extend .badge--mature;
  }
}

.tag--mature {
  @extend .badge--mature;
  // Lighten the color a little so it doesn't stand out as much on claim previews
}

.tag__action-label {
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  padding-top: 0.7rem;

  [data-mode='dark'] & {
    border-color: rgba($lbry-white, 0.1);
  }
}
