@import 'src/styles/variables';

$big: 1.2;

.tag {
  @include outer_shadow();

  overflow: hidden;
  cursor: default;
  height: $tag_height;
  background: $content_bg_light;
  border-radius: ($tag_height * 0.5) 3px 3px ($tag_height * 0.5);
  font: $font_14_semibold;
  align-self: flex-start;
  position: relative;
  z-index: 12;

  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: stretch;
  min-width: 0;

  &:hover {
    z-index: 40;
  }

  &.hoverable {
    cursor: pointer;
  }

  &.editing {
    cursor: pointer;
    background-color: $content_bg;
  }

  &.clickable {
    cursor: pointer;
  }

  &.color-danger {
    background: $danger_gradient;
  }

  &.color-info {
    background: $info_gradient;
  }

  &.color-primary {
    background: $primary_gradient;
  }

  &.color-black {
    background: transparentize(black, 0.7);
    box-shadow: none;
    color: $gray_75;
    font: $font_14_medium;

    .hole::after {
      background: $gray_90;
    }
  }

  &.size-big {
    height: $tag_height * $big;
    font: $font_16_semibold;
    border-radius: ($tag_height * $big * 0.5) 3px 3px ($tag_height * $big * 0.5);

    .hole {
      width: $tag_height * $big;
      height: $tag_height * $big;
    }
  }
}

.hole {
  width: $tag_height;
  height: $tag_height;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 $tag_height;

  &::after {
    content: ' ';
    position: absolute;
    background: transparentize(black, 0.7);
    width: 14px;
    height: 14px;
    border-radius: 14px;
  }
}

.title {
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

button.delete {
  box-shadow: inset transparentize(white, 0.95) 1px 0,
    transparentize(black, 0.7) -1px 0;
  width: 24px;
  height: $tag_height;
  z-index: 24;
  border: none;
  padding: 0;
  border-radius: 0 3px 3px 0;
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.text {
  padding-right: $gap;
  text-overflow: ellipsis;
  overflow: hidden;
}
