/* smart-check-box and smart-radio-button*/
.smart-toggle-box {
  display: inline-block;
  outline: none;
  height: var(--smart-editor-height);
  cursor: pointer;

  &.smart-element {
    border: none;
    background: transparent;
  }

  .smart-container,
  &.smart-container {
    position: relative;
    display: flex;
    align-items: center;
  }

  .smart-ripple {
    background: var(--smart-primary);
  }

  .smart-overlay {
    top: 0;
    height: 100%;
    background: var(--smart-primary);
    width: var(--smart-editor-height);
    position: absolute;
    left: 2px;
    border-radius: 100%;
    padding: 0px;
    opacity: 0;
    box-sizing: content-box;
    transition: opacity 280ms ease-in-out;
    margin: 0px;
  }

  .smart-label {
    color: var(--smart-background-color);
    background: inherit;
    font-size: inherit;
    font-family: inherit;
    margin: 0 8px 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: auto;
  }

  &.smart-check-box {
    .smart-input {
      width: var(--smart-check-box-default-size);
      min-width: var(--smart-check-box-default-size);
      height: var(--smart-check-box-default-size);
      min-height: var(--smart-check-box-default-size);
      background-color: var(--smart-background);
      box-sizing: initial;
      border: var(--smart-border-width) solid var(--smart-border);
      display: inline-block;
      color: var(--smart-background-color);
      border-top-left-radius: var(--smart-border-top-left-radius);
      border-top-right-radius: var(--smart-border-top-right-radius);
      border-bottom-left-radius: var(--smart-border-bottom-left-radius);
      border-bottom-right-radius: var(--smart-border-bottom-right-radius);
      margin: 0 0 0 8px;
      transition: background linear 0.2s;
      position: relative;

      &:after {
        font-family: var(--smart-font-family-icon);
        display: flex;
        justify-content: center;
        align-content: center;
        height: 100%;
        align-items: center;
      }
    }

    &[checked] {
      .smart-input:after {
        font-weight: 100;
        content: var(--smart-icon-check);
        pointer-events: none;
      }
    }

    &[checked="null"] {
      .smart-input:after {
        content: '-';
        margin-top: -1px;
      }
    }
  }

  &.smart-radio-button {
    .smart-input {
      width: var(--smart-radio-button-default-size);
      min-width: var(--smart-radio-button-default-size);
      height: var(--smart-radio-button-default-size);
      min-height: var(--smart-radio-button-default-size);
      background-color: var(--smart-background);
      box-sizing: initial;
      border-style: solid;
      border-width: var(--smart-border-width);
      border-color: var(--smart-border);
      display: inline-block;
      border-radius: 100%;
      color: var(--smart-background-color);
      margin: 0 0 0 8px;
      position: relative;

      &:after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 50%;
        height: 50%;
        font-style: normal;
        text-decoration: inherit;
        font-variant: normal;
        text-transform: none;
        color: inherit;
        border-radius: 50%;
        line-height: 100%;
      }
    }

    &[checked] {
      .smart-input {
        &:after {
          font-size: 15px;
          font-weight: 100;
          background: var(--smart-primary-color);
        }
      }
    }

    &[checked][hover]:not([focus]) {
      .smart-input::after {
        background: var(--smart-ui-state-color-hover);
      }
    }
  }

  &[active] {
    .smart-input {
      border-color: var(--smart-ui-state-border-active);
      background-color: var(--smart-ui-state-active);
      color: var(--smart-ui-state-color-active);
    }

    &:focus,
    &[focus] {
      .smart-overlay {
        opacity: 0.4;
      }
    }
  }

  &[checked] {
    .smart-input {
      border-color: var(--smart-ui-state-border-active);
      background-color: var(--smart-ui-state-active);
      color: var(--smart-ui-state-color-active);
    }
  }

  &[hover] {
    .smart-input {
      border-color: var(--smart-ui-state-border-hover);
      background-color: var(--smart-ui-state-hover);
      color: var(--smart-ui-state-color-hover);
    }
  }

  &:focus,
  &[focus] {
    .smart-input {
      outline: none;
      overflow: visible;
      border-color: var(--smart-primary);
      background-color: var(--smart-primary);
      color: var(--smart-primary-color);
    }

    .smart-overlay {
      opacity: 0.3;
    }
  }

  &[readonly] {
    cursor: initial;

    .smart-input,
    .smart-label {
      cursor: initial;
    }
  }

  &[check-mode="input"] {
    cursor: default;

    .smart-input {
      cursor: pointer;
    }
  }

  &[check-mode="label"] {
    .smart-label {
      cursor: pointer;
    }
  }
}

@import 'rtl/_toggle';