@import '../../../styles/common.scss';

.container {
  .options {
    display: flex;
    flex-wrap: wrap;
    grid-gap: 15px;
    max-width: fit-content;

    .option {
      display: grid;
      grid: minmax(50px, 1fr) / 1fr;

      align-items: center;

      label,
      input {
        cursor: pointer;

        &.disabled {
          cursor: default;
        }
      }

      label {
        display: grid;
        grid: 1fr / 30px 1fr;
        column-gap: 8px;

        color: var(--radio-label-color, $radio-label-color);
        font-size: 16px;
        font-weight: unset;

        align-items: center;

        user-select: none;

        &.disabled {
          .radioOutline {
            fill: var(--radio-disabled-outline-color, $radio-disabled-outline-color);
          }

          .checked {
            .radioDot {
              fill: var(--radio-disabled-dot-color, $radio-disabled-dot-color);
            }
          }
        }
      }

      input {
        display: none;
      }
    }
  }

  .buttonContainer {
    height: 30px;
    width: 30px;

    .radioOutline {
      fill: none;
      stroke: var(--radio-outline-stroke-color, $radio-outline-stroke-color);
      stroke-width: 1;
    }

    .radioDot {
      fill: none;
    }

    &:hover:not(.unSelectable):not(.hasConfirm) {
      .radioOutline {
        stroke: var(--radio-hover-stroke-color, $radio-hover-stroke-color);
        stroke-width: 3;
        transition: stroke-width 0.15s ease-in-out 0s;
      }
    }

    &.checked {
      .radioOutline {
        fill: var(--radio-checked-fill-color, $radio-checked-fill-color);
      }
      .radioDot {
        fill: white;
      }
    }

    &.hasConfirm {
      .radioOutline {
        stroke: var(--radio-warning-stroke-color, $radio-warning-stroke-color);
        stroke-width: 3;
      }
    }

    &.hasError {
      .radioOutline {
        stroke: var(--input-invalid-color, $input-invalid-color);
      }
      &.checked {
        .radioDot {
          fill: var(--input-invalid-color, $input-invalid-color);
        }
      }

      &:hover {
        .radioOutline {
          stroke: var(--input-invalid-color, $input-invalid-color);
          stroke-width: 3;
        }
      }
    }
  }

  .confirmDialog {
    @include confirmDialogFadeIn;
  }

  small {
    padding-top: 0;
  }
}
