// 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.
:root {
  --watt-radio-color: var(--watt-color-primary);
  --watt-disabled-radio-color: var(--watt-color-neutral-grey-300);
  --watt-radio-label-color: var(--watt-on-light-high-emphasis);
  --watt-disabled-radio-label-color: var(--watt-on-light-low-emphasis);
}

watt-radio label {
  display: flex;
  align-items: center;
  color: var(--watt-radio-label-color);

  &.disabled {
    cursor: not-allowed;
    color: var(--watt-radio-disabled-label-color);
  }
}

watt-radio input[type="radio"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  appearance: none;
  margin: 0 var(--watt-space-s) 0 0;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--watt-radio-color);
  display: grid;
  place-content: center;

  &::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--watt-radio-color);
  }

  &:checked::before {
    transform: scale(1);
  }
}

/* STATES */
watt-radio.disabled {
  --watt-radio-label-color: var(--watt-disabled-radio-label-color);
  --watt-radio-color: var(--watt-disabled-radio-color);
}
