@import '../style/core/animation';
@import '../style/theme/color';
@import '../style/theme/corner';
@import '../style/core/font';

:host {
  padding-right: 20px;
  display: block;
  line-height: 18px;
}

.devui-radio {
  cursor: pointer;
  color: $devui-text;
  font-size: $devui-font-size;
  font-weight: normal;
  line-height: 1.5;
  margin: 0 auto;

  .devui-radio-material {
    width: 16px;
    height: 16px;
    display: inline-block;
    overflow: hidden;
    user-select: none;
    vertical-align: middle;
    border: solid 1px $devui-shape-icon-fill;
    border-radius: $devui-border-radius-full;
    box-shadow: 0 transparent;
    transform: translateY(-1px);
    transition: border $devui-animation-duration-base $devui-animation-ease-in-out;
  }

  .devui-radio-label {
    color: $devui-text;
    font-size: $devui-font-size;
    margin-left: 8px;
  }

  .devui-radio-input {
    opacity: 0;
    z-index: -1;
    width: 0;
    height: 0;
    display: none;
    overflow: hidden;
    pointer-events: none;
  }

  &.active .devui-radio-material {
    border-width: 4px;
    border-color: $devui-brand;
  }

  &.disabled {
    cursor: not-allowed;

    .devui-radio-label {
      color: $devui-disabled-text;
    }

    .devui-radio-material {
      border-color: $devui-shape-icon-fill;
      background-color: $devui-disabled-bg;
    }

    &.active .devui-radio-material {
      border-color: $devui-icon-fill-active-disabled;
    }
  }
}

::ng-deep :root .devui-glow-style .devui-radio {
  .devui-radio-material {
    transition: box-shadow $devui-animation-duration-slow $devui-animation-ease-in-out-smooth;
  }

  &:not(.disabled) {
    &:hover,
    &:active {
      .devui-radio-material {
        box-shadow: 0 0 0 6px $devui-range-item-hover-bg;
      }
    }
  }
}
