@import '../../style/themes/index';
@import '../../style/mixins/index';

@tag-prefix-cls: ~'@{ant-prefix}-tag';

.@{tag-prefix-cls} {
  .reset-component();

  display: inline-flex;
  /* Inside auto layout */
  flex: none;
  flex-grow: 0;
  align-items: center;
  justify-content: center;
  order: 1;
  // msb overwrite start
  height: @tag-border-radius;
  // msb overwrite end

  margin-right: 8px;
  padding: 4px 12px;
  font-weight: @typography-font-base;
  font-size: @tag-font-size;
  line-height: @tag-line-height;
  white-space: nowrap;
  background: @tag-default-bg;
  border: @border-width-base @border-style-base @border-color-base;
  border-radius: @tag-border-radius;
  opacity: 1;
  transition: all 0.3s;

  &,
  a,
  a:hover {
    color: @tag-default-color;
  }

  > a:first-child:last-child {
    display: inline-block;
    margin: 0 -8px;
    padding: 0 8px;
  }

  &-close-icon {
    //msb overwrite start
    margin-left: 8px;
    color: @color-gray-400!important;
    font-size: @tag-close-icon-size;
    //msb overwrite end
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
      color: @heading-color;
    }
  }

  &-has-color {
    border-color: transparent;
    &,
    a,
    a:hover,
    .@{iconfont-css-prefix}-close,
    .@{iconfont-css-prefix}-close:hover {
      color: @text-color-inverse;
    }
  }

  &-checkable {
    cursor: pointer;

    &:not(&-checked):hover {
      color: @primary-color;
    }

    &:active,
    &-checked {
      color: @color-primary-500;
      //msb overwrite start
      border-color: @color-primary-500;
      //msb overwrite end
    }

    &-checked {
      //msb overwrite start
      background-color: @color-primary-25;
      //msb overwrite end
    }

    &:active {
      //msb overwrite start
      background-color: @color-primary-25;
      //msb overwrite end
    }
  }

  &-hidden {
    display: none;
  }

  &-outline {
    color: @color-gray-800;
    background: @color-base-white;
    border: 1px solid @color-gray-200;
  }

  .make-status-color-classes(@status, @cssVariableType) {
    @bgColor: '@{cssVariableType}-color-deprecated-bg';
    @borderColor: '@{cssVariableType}-color-deprecated-border';
    @textColor: '@{cssVariableType}-color';
    &-@{status} {
      color: @@textColor;
      background: @@bgColor;
      border-color: @@borderColor;
    }
  }

  .make-status-color-classes(success, success);
  .make-status-color-classes(processing, info);
  .make-status-color-classes(error, error);
  .make-status-color-classes(warning, warning);

  // To ensure that a space will be placed between character and `Icon`.
  > .@{iconfont-css-prefix} + span,
  > span + .@{iconfont-css-prefix} {
    margin-left: 8px;
  }
}

@import './rtl';
