@import 'overwrites.scss';
@import 'contrast.scss';

$lightContrast: contrast($body-bg, white);
$darkContrast: contrast($body-bg, black);

.rscfilter {
  &__toggle {
    @if ($lightContrast > $darkContrast) {
      color: white;
    }
  }

  &__toggle::after {
    @if ($lightContrast > $darkContrast) {
      background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNSIgdmlld0JveD0iMCAwIDEwIDUiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0wIC00LjM3MTE0ZS0wN0w1IDVMMTAgMEwwIC00LjM3MTE0ZS0wN1oiIGZpbGw9IiNGRkZGRkYiLz4KPC9zdmc+");
    }
  }
}

.rscfilter-pane {
  &::before {
    background: $white;
  }
}

.rscfilter-option {
  &__checkbox {
    border: 1px solid $border-color;
  }

  &:focus &__checkbox {
    border: 2px solid $primary;
  }
}

.rscfilter-selections {
  &__item {
    &-discard {
      @if ($lightContrast > $darkContrast) {
        background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxNCAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTExLjEzNTkgMy40NzIwNkwxMC4zNzIyIDIuNzA4MzFMNy4zNDQyOCA1LjczNjIzTDQuMzE2MzYgMi43MDgzMUwzLjU1MjYxIDMuNDcyMDZMNi41ODA1MyA2LjQ5OTk4TDMuNTUyNjEgOS41Mjc5TDQuMzE2MzYgMTAuMjkxNkw3LjM0NDI4IDcuMjYzNzNMMTAuMzcyMiAxMC4yOTE2TDExLjEzNTkgOS41Mjc5TDguMTA4MDMgNi40OTk5OEwxMS4xMzU5IDMuNDcyMDZaIiBmaWxsPSIjRkZGRkZGIi8+Cjwvc3ZnPgo=");
      }
    }
  }
}
