// Copyright 2020 Energinet DataHub A/S
//
// Licensed under the Apache License, Version 2.0 (the "License2");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@use "@energinet-datahub/watt/utils" as watt;

:host {
  border-radius: 4px;
  @include watt.space-inset-squish-xs;
  @include watt.typography-watt-label;
  color: var(--watt-color-primary-dark);

  &.watt-badge-large {
    @include watt.typography-font-size("m");
    @include watt.typography-font-weight("bold");
  }

  &.watt-badge-neutral {
    color: var(--watt-color-neutral-grey-600);
    background: var(--watt-color-neutral-grey-200);
  }

  &.watt-badge-info {
    background: var(--watt-color-state-info-light);
  }

  &.watt-badge-success {
    background: var(--watt-color-state-success-light);
  }

  &.watt-badge-warning {
    background: var(--watt-color-state-warning-light);
  }

  &.watt-badge-danger {
    color: var(--watt-color-state-danger);
    background: var(--watt-color-state-danger-light);
  }

  &.watt-badge-version {
    color: var(--watt-on-light-high-emphasis);
    background: var(--watt-color-secondary);
  }

  &.watt-badge-skeleton {
    color: transparent;
    animation: shine 1.6s infinite linear;
    background-color: var(--watt-color-neutral-grey-200);
    background-size: 600px;
    background-image: linear-gradient(
      90deg,
      var(--watt-color-neutral-grey-300) 0px,
      var(--watt-color-neutral-grey-200) 40px,
      var(--watt-color-neutral-grey-300) 80px
    );
  }
}

@keyframes shine {
  0% {
    background-position: -100px;
  }
  40%,
  100% {
    background-position: 140px;
  }
}
