@import "../../settings/includes/colors";

// Group
.radio-group {
  &.is-list-view {
    width: 100%;
  }
}

// Radio Button Singular
.radio-button {
  min-height: 40px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;

  &:not(:last-of-type) {
    margin-bottom: 8px;
  }

  &.is-list-view {
    margin-bottom: 0;
    width: 100%;

    &:hover {
      background-color: rgba($Pacific, 0.2);
    }
  }

  &.has-background {
    background-color: white;
  }

  &.is-checked {
    cursor: default;
  }

  &.is-disabled {
    pointer-events: none;
  }

  &:hover {
    .radio-button__selection {
      border-color: $Pacific;
    }
  }

  &__selection-wrapper {
    position: relative;
  }

  &__selection {
    height: 24px;
    width: 24px;
    border: 2px solid grey;
    background-color: white;
    border-radius: 50%;
    margin: 0 8px;
    position: relative;
    pointer-events: none;

    .is-disabled & {
      border-color: $Mono;
      background-color: $Mono;

      &::before {
        content: "";
        background: $Mono;
        height: 100%;
        width: 100%;
        position: relative;
        display: block;
        border-radius: 50%;
        border: 3px solid white;
      }
    }

    .is-checked & {
      background-color: $Pacific;
      border-color: $Pacific;
    }
  }

  input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
    user-select: none;
  }

  .icon {
    pointer-events: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  label {
    padding: 8px;
    width: 100%;
    cursor: pointer;

    .is-disabled & {
      color: $Mono;
    }
  }

  .multiline-label {
    line-height: 1.25;
  }

  .label-title {
    display: block;
  }
}

.radio-button-group {
  &__label {
    display: block;
    margin: 8px 0 4px;
  }
}
