/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
@import "../style/index";

@mixin uicore-inputs-radio {

  display: block;
  position: relative;
  padding-left: $uicore-l;
  font-size: $uicore-font-size;
  cursor: pointer;
  user-select: none;
  color: $buic-foreground-body;
  min-height: 1.57em;

  > input {
    position: absolute;
    opacity: 0;
    width: 0;
    cursor: pointer;
  }

  .core-radio-checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 1em;
    width: 1em;
    border: 1px solid $buic-foreground-disabled;
    background-color: $buic-background-control;
    border-radius: 50%;
  }

  &:hover:not(.core-disabled) input ~ .core-radio-checkmark {
    border-color:     $buic-foreground-activehover;
    transition:       all $uicore-speed-fast ease-out;
  }

  & input:checked ~ .core-radio-checkmark {
    border-color:     $buic-foreground-muted;
  }

  & input:active ~ .core-radio-checkmark,
  & input:focus ~ .core-radio-checkmark {
    border-color:     $buic-foreground-focus-border;
    box-shadow:       $uicore-inputs-focus-gradient;
  }

  .core-radio-checkmark::after {
    content: '';
    position: absolute;
    display: none;
  }

  & input:checked ~ .core-radio-checkmark::after {
    display: block;
  }

  & .core-radio-checkmark::after {
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: $buic-foreground-primary;
  }

  &.core-disabled {
    opacity: $uicore-opacity-disabled;
    cursor: not-allowed;
  }

  &.success {
    color: $buic-foreground-success;
  }

  &.warning {
    color: $buic-foreground-warning;
  }

  &.error {
    color: $buic-foreground-alert;
  }
}
