/*
 * StepIndicator component
 *
 */

@import '../../../style/core/utilities.scss';

.dnb-step-indicator {
  --step-indicator-trigger-background: var(--color-black-3);
  --step-indicator-check-bg: var(--color-pistachio);
  --step-indicator-check-color: var(--color-success-green);
  --step-indicator-current-border: var(--color-black-80);
  --padding-top: 0;
  --padding-bottom: 0;

  &__sidebar {
    display: none;
  }

  &__list {
    padding: 0;
    margin: 0;

    list-style: none;
  }

  &__trigger {
    // Is needed to make ensure the button stays on top during height animation
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  &__trigger__button {
    line-height: inherit;
    .dnb-button__text {
      margin: 0;
      transform: none;
    }
    .dnb-button__icon {
      --button-icon-margin-top: 0.25rem;
    }
  }

  &__item {
    &__wrapper {
      display: flex;
      gap: 1rem;
      padding-bottom: 1rem;
      position: relative;

      &::before {
        content: '';
        display: block;
        position: absolute;
        top: 0.25rem;
        left: 0.71875rem;

        width: 0.0625rem;        
        height: 100%;

        background-color: var(--color-black-20);
      }
    }

    &__bullet {
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 1.5rem;
      width: 1.5rem;
      height: 1.5rem;
      z-index: 0;
      border-radius: 50%;

      &--check,
      &--empty,
      &--current {
        background-color: var(--step-indicator-check-bg);
        border-width: 0.0625rem;
        border-style: solid;
        border-color: transparent;
      }

      &--check {
        font-size: 0.875rem;
        color: var(--step-indicator-check-color);
        border-color: var(--step-indicator-check-color);
      }

      &--empty {
        color: var(--color-black-20);
        background-color: var(--color-white);
        border-color: var(--color-black-20);
      }

      &--current {
        border-width: 0.1875rem;
        border-color: var(--step-indicator-current-border);
      }
      &.dnb-skeleton {
        border-width: 0.0625rem;
        border-color: var(--color-black-20);
      }
    }

    &-content {
      display: flex;

      &__number {
        font-size: var(--font-size-basis);
        white-space: nowrap;
        margin-right: 0.5rem;
      }

      &__wrapper {
        display: flex;
        flex-direction: column;
      }

      &__text {
        font-size: var(--font-size-basis);
      }
    }

    &__icon {
      opacity: 1;
      transition: opacity 400ms ease-in-out;

      &--hidden {
        opacity: 0;
        transition-timing-function: ease-out;
      }
    }

    &:last-child &__wrapper {
      &::before {
        display: none;
      }
    }

    html[data-visual-test] &__icon {
      transition-duration: 1ms !important;
    }
  }

  &__button {
    white-space: normal;
    text-align: left;
    align-self: flex-start;

    &.dnb-anchor {
      padding: 0;
      line-height: inherit;
    }
  }
}
