@use '@/styles/variables' as *;
@use '@/styles/mixins' as *;

.badge {
  position: relative;
  display: inline-flex;

  &__dot {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid $card-background;

    &--default {
      background-color: $text-secondary;
    }

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

    &--success {
      background-color: $success-color;
    }

    &--warning {
      background-color: $warning-color;
    }

    &--error {
      background-color: $error-color;
    }

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

  &__count {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    @include flex-center;
    min-width: 18px;
    height: 18px;
    padding: 0 $spacing-xs;
    border-radius: $border-radius-pill;
    font-size: $font-size-xs;
    font-weight: $font-weight-medium;
    color: #ffffff;
    border: 2px solid $card-background;

    &--sm {
      min-width: 16px;
      height: 16px;
      font-size: 10px;
    }

    &--md {
      min-width: 18px;
      height: 18px;
      font-size: $font-size-xs;
    }

    &--default {
      background-color: $text-secondary;
    }

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

    &--success {
      background-color: $success-color;
    }

    &--warning {
      background-color: $warning-color;
    }

    &--error {
      background-color: $error-color;
    }

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

.badgeTag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: $border-radius-sm;
  font-weight: $font-weight-medium;

  &--sm {
    padding: 2px $spacing-sm;
    font-size: $font-size-xs;
  }

  &--md {
    padding: $spacing-xs $spacing-sm;
    font-size: $font-size-xs;
  }

  &--default {
    background-color: $background-color;
    color: $text-secondary;
  }

  &--primary {
    background-color: rgba($primary-color, 0.1);
    color: $primary-color;
  }

  &--success {
    background-color: rgba($success-color, 0.1);
    color: $success-color;
  }

  &--warning {
    background-color: rgba($warning-color, 0.1);
    color: darken($warning-color, 10%);
  }

  &--error {
    background-color: rgba($error-color, 0.1);
    color: $error-color;
  }

  &--info {
    background-color: rgba($info-color, 0.1);
    color: $info-color;
  }
}
