@import "src/styles/variables";

$big: 1.2;

.tag {
  @include outer_shadow();

  overflow: hidden;
  cursor: default;
  height: $tag_height;
  background: $tag_bg;
  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;
  }

  &:global(.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;
    }
  }

  &:global(.is_hoverable) {
    cursor: pointer;
  }

  &:global(.is_editing) {
    cursor: pointer;
    background-color: lighten($tag_bg, 10%);
  }

  &:global(.red) {
    background: $red_gradient;
  }

  &:global(.blue) {
    background: $blue_gradient;
  }

  &:global(.green) {
    background: $green_gradient;
  }

  &:global(.olive) {
    background: $olive;
    color: transparentize(black, 0.4);
  }

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

    .hole::after {
      background: transparentize(white, 0.98);
    }
  }

  &:global(.input) {
    color: transparent !important;
    min-width: 100px;
  }

  &:global(.clickable) {
    cursor: pointer;
  }

  input {
    background: none;
    border: none;
    color: white;
    outline: none;
    display: inline-flex;
    position: absolute;
    font: inherit;

    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    min-width: 100px;
    padding-left: $tag_height;
    padding-right: 5px;
    box-sizing: border-box;
  }
}

.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.9) 1px 0, transparentize(black, 0.7) -1px 0;
  width: 24px;
  height: $tag_height;
  background: transparentize($content_bg, 0.75);
  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;
}