@use "../../../variables/index" as *;

@use "../../core/buttons/buttons";


/**
 * c8y datapoint pill - Component styles
 *
 * Note: Uses $size-* tokens for spacing where applicable.
 *
 * Intentionally hardcoded values:
 * - Component-specific dimensions: Fixed sizes for component layout
 * - Off-grid spacing: Component-specific positioning
 * - Border widths (1px, 2px, 3px): Standard borders
 * - Font-sizes: Typography
 * - Percentages: Layout
 */
.c8y-datapoint-pill, .c8y-alarm-pill, .c8y-event-pill {
  display: flex;
  overflow: hidden;
  align-items: center;
  min-height: $size-24;
  max-width: 100%;
  border-radius: $size-16;
  background-color: $component-background-default;
  box-shadow: none;
  border: 1px solid $component-color-text-muted;
  font-size: $font-size-small;
  line-height: 1;
  &__btn {
    @include buttons.btn-clean();
    align-self: stretch;
    padding: $size-4 $size-4 $size-4 $size-base;
    border-right: 1px solid $component-color-text-muted;
    color: $text-muted;
    line-height: 1;
  }
  &__label {
    display: flex;
    overflow: hidden;
    align-items: center;
    padding: $size-4 calc($size-base + $size-4) $size-4 $size-4;
    line-height: 1;
  }
}

.c8y-datapoint-pill{
  &__btn {
    &, &:not(.btn){
      padding: $size-4;
      &:first-child{
        border-bottom-left-radius: $size-16!important;
        border-top-left-radius: $size-16!important;
      }
      + .c8y-datapoint-pill__btn{
        border-right: 0;
        padding-right: $size-base;
      }
    }
  }
}

.c8y-alarm-pill {
  border-radius: $size-4;
  &__btn {
    &, &:not(.btn){
      padding: $size-4!important;
      + .c8y-alarm-pill__btn{
        border-right: 0;
      }
    }
  }
}

.c8y-event-pill {
  border-radius: 2px;
  border: 1px dotted $component-color-text-muted;
  &__btn {
    &, &:not(.btn){
      border-right: 1px dotted $component-color-text-muted;
      padding: $size-4 !important;
      + .c8y-event-pill__btn{
        border-right: 0;
      }
    }
  }
}
.c8y-datapoint-pill, .c8y-alarm-pill, .c8y-event-pill{
  &.pill--sm{
    .c8y-datapoint-pill, .c8y-alarm-pill, .c8y-event-pill {
      &__btn {
        &, &:not(.btn){
          font-size: 11px;
          padding: 1px $size-8 1px $size-4!important;
          + .c8y-datapoint-pill__btn,
          + .c8y-alarm-pill__btn,
          + .c8y-event-pill__btn {
            border-right: 0;
            padding-right: $size-base;
          }
        }
      }
    }
  }
}
