// SPDX-FileCopyrightText: 2023 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-3.0-or-later

.event-rule-button(@disabled: false) {
  text-align: center;
  line-height: 1.5;
  display: flex;
  align-items: center;
  padding: .5em 1em;
  .rounded-corners(3px);

  &:is(a) {
    text-decoration: none;
  }

  & when (@disabled = false) {
    border: none;
    color: @icinga-blue;
    background: @low-sat-blue;

    &:hover,
    &:focus {
      background: @low-sat-blue-dark;
      color: @icinga-blue;
    }

    &:focus {
      outline: 3px solid fade(@icinga-blue, 50%);
      outline-offset: 1px;
    }
  }

  & when (@disabled = true) {
    padding-left: ~"calc(1em - 1px)";
    padding-right: ~"calc(1em - 1px)";
    border: 1px solid @control-disabled-color;
    color: @control-disabled-color;
    cursor: not-allowed;

    .user-select(none);
  }

  .icon::before {
    margin-right: 0;
  }
}
