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

.container {
  input {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    color: var(--input-color, $input-color);
    border: 1px solid var(--input-border-color, $input-border-color);
    width: max-content;
    outline: none;
    font-size: var(--label-font-size, $label-font-size);

    background-repeat: no-repeat;
    background-position-y: center;
    background-position-x: 100%;

    height: 30px;
    width: 30px;

    margin: 10px 0 10px 0;

    transition: box-shadow 0.15s ease-in-out 0s,
      background-color 0.15s ease-in-out 0s;

    // transition: background-color 0.15s ease-in-out 0s;

    &.hasConfirm {
      border: 1px solid var(--checkbox-warning-border-color, $checkbox-warning-border-color);
    }

    &.hasError {
      border: 1px solid
        var(--input-invalid-border-color, $input-invalid-border-color);
    }

    &:enabled {
      cursor: pointer;
    }

    &:disabled {
      background-color: var(
        --input-disabled-background-color,
        $input-disabled-background-color
      );
      color: var(--input-disabled-font-color, $input-disabled-font-color);
      border: 1px solid
        var(--input-disabled-border-color, $input-disabled-border-color);
    }
  }

  input:hover:enabled {
    border: 1px solid var(--input-hover-color, $input-hover-color);
    box-shadow: 0 0 0 2px var(--input-hover-color, $input-hover-color);

    &.hasConfirm {
      border: 1px solid var(--checkbox-warning-hover-border-color, $checkbox-warning-hover-border-color);
      box-shadow: 0 0 0 2px var(--checkbox-warning-hover-border-color, $checkbox-warning-hover-border-color);
    }

    &.hasError {
      border: 1px solid
        var(--input-invalid-border-color, $input-invalid-border-color);
      box-shadow: 0 0 0 2px
        var(--input-invalid-hover-color, $input-invalid-hover-color);
    }
  }

  input:checked {
    background-color: var(--input-hover-color, $input-hover-color);

    &.hasConfirm {
      background-color: var(--checkbox-warning-checked-bg-color, $checkbox-warning-checked-bg-color);
    }

    &.hasError {
      background-color: var(
        --input-invalid-border-color,
        $input-invalid-border-color
      );
    }

    &:disabled {
      background-color: var(
        --input-disabled-background-color,
        $input-disabled-background-color
      );
    }
  }

  input:checked:after {
    content: '\2714';
    font-size: 20px;
    display: grid;
    height: 100%;
    justify-content: center;
    align-content: center;
    color: #ffffff;
  }
  input:checked:disabled:after {
    color: var(--input-disabled-border-color, $input-disabled-border-color);
  }

  .confirmDialog {
    @include confirmDialogFadeIn;
  }

  small {
    padding-top: 0;
  }
}
