// 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;

.watt-progress-tracker-step-pending {
  --watt-progress-tracker-step-text-color: var(--watt-color-neutral-grey-600);
  --watt-progress-tracker-step-bridge-color: var(--watt-color-neutral-grey-600);
  --watt-progress-tracker-step-fill-color: transparent;
}

.watt-progress-tracker-step-running {
  --watt-progress-tracker-step-text-color: var(--watt-color-neutral-grey-900);
  --watt-progress-tracker-step-bridge-color: var(--watt-color-primary);
  --watt-progress-tracker-step-fill-color: transparent;
}

.watt-progress-tracker-step-skipped {
  --watt-progress-tracker-step-text-color: var(--watt-color-neutral-grey-400);
  --watt-progress-tracker-step-bridge-color: var(--watt-color-neutral-grey-400);
  --watt-progress-tracker-step-fill-color: transparent;
}

.watt-progress-tracker-step-canceled {
  --watt-progress-tracker-step-text-color: var(--watt-color-neutral-grey-600);
  --watt-progress-tracker-step-icon-color: var(--watt-color-neutral-white);
  --watt-progress-tracker-step-bridge-color: var(--watt-color-neutral-grey-600);
  --watt-progress-tracker-step-fill-color: var(--watt-color-neutral-grey-600);
}

.watt-progress-tracker-step-failed {
  --watt-progress-tracker-step-text-color: var(--watt-color-state-danger);
  --watt-progress-tracker-step-icon-color: var(--watt-color-neutral-white);
  --watt-progress-tracker-step-bridge-color: var(--watt-color-state-danger);
  --watt-progress-tracker-step-fill-color: var(--watt-color-state-danger);
}

.watt-progress-tracker-step-succeeded {
  --watt-progress-tracker-step-text-color: var(--watt-color-neutral-grey-900);
  --watt-progress-tracker-step-icon-color: var(--watt-color-neutral-white);
  --watt-progress-tracker-step-bridge-color: var(--watt-color-primary);
  --watt-progress-tracker-step-fill-color: var(--watt-color-primary);
}

watt-progress-tracker-step {
  display: contents;
  --watt-progress-tracker-step-icon-color: var(--watt-progress-tracker-step-text-color);
}

watt-progress-tracker-step:not(:first-child)::before {
  content: "";
  display: block;
  width: 100%;
  min-width: var(--watt-space-m);
  height: 1px;
  margin: 0 var(--watt-space-s);
  background-color: var(--watt-progress-tracker-step-bridge-color);
}

.watt-progress-tracker-step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--watt-space-ml);
  height: var(--watt-space-ml);
  min-width: var(--watt-space-ml);
  min-height: var(--watt-space-ml);
  border-radius: 50%;
  border: 1px solid var(--watt-progress-tracker-step-bridge-color);
  background-color: var(--watt-progress-tracker-step-fill-color);

  & watt-icon {
    color: var(--watt-progress-tracker-step-icon-color);
  }
}

.watt-progress-tracker-step-running .watt-progress-tracker-step-icon {
  border: none;
}

.watt-progress-tracker-step-text {
  @include watt.typography-watt-headline-5;
  margin-left: var(--watt-space-s);
  color: var(--watt-progress-tracker-step-text-color);
  white-space: nowrap;
}
