.incidents-export-link {
  color: $primary;
  background: none;
  text-align: left;
  padding: sizeToRem(8);
  text-decoration: none !important;

  &.disabled {
    border: sizeToRem(2) solid transparent;
    opacity: 0.5;
    cursor: not-allowed;
  }

  &:hover {
    text-decoration: none;
    color: rgba($primary, 0.7);
  }
}

.incidents-header-left {
  border-bottom: 1px solid $grey-light;
  height: sizeToRem(40);
  padding: 0 sizeToRem(15);

  @include media-breakpoint-up(md) {
    height: sizeToRem(56);
    padding: 0 0 0 sizeToRem(30);
  }
}

.incidents-header-right {
  border-bottom: 1px solid $grey-light;
  height: sizeToRem(56);
  padding: 0 sizeToRem(15);
  justify-content: space-between;

  @include media-breakpoint-up(md) {
    padding: 0 sizeToRem(30) sizeToRem(5) 0;
    justify-content: flex-end;
  }
}

.incidents-header-buttons {
  justify-content: space-between;

  @include media-breakpoint-up(sm) {
    justify-content: flex-start;
  }

  li {
    border-bottom: sizeToRem(5) solid transparent;

    @include media-breakpoint-up(sm) {
      margin-right: sizeToRem(40);
    }

    &.selected {
      border-color: $primary;

      button {
        color: $primary;
      }
    }

    &:nth-child(2) {
      padding: 0 sizeToRem(10);

      @include media-breakpoint-up(sm) {
        padding: 0;
      }
    }
  }
}

.incidents-header-button {
  line-height: normal;
  color: $dark;
  height: sizeToRem(40);
  background-color: transparent;
  font-size: sizeToRem(14);

  @include media-breakpoint-up(md) {
    height: sizeToRem(56);
    font-size: sizeToRem(16);
  }
}

// FORM

.incidents-form-container {
  display: flex;
  align-items: flex-start;
  margin: sizeToRem(18) 0 0;
  flex-wrap: wrap;

  input {
    background: transparent;
  }
}

.incidents-form-input-date-wrapper {
  display: flex;
}

.incidents-form-input-wrapper,
.incidents-form-input-date-wrapper {
  position: relative;

  .form-control.is-invalid {
    background-image: none;
  }

  .input-label {
    background-color: $grey-background;

    &::before {
      background-color: $grey-background;
    }
  }
}

.input-field:focus ~ .input-label::before {
  background-color: $grey-background !important;
}

.form-control:focus {
  background-color: transparent;
}

.incidents-form-input-wrapper,
.incidents-btn-submit,
.incidents-form-input-date-wrapper,
.incidents-dropdown-add-filter {
  margin-bottom: sizeToRem(44);
}

.incidents-form-select-wrapper,
.incidents-form-input-date-wrapper {
  margin-bottom: sizeToRem(25);
}

.incidents-form-input-btn {
  position: absolute;
  width: sizeToRem(26);
  height: sizeToRem(26);
  right: sizeToRem(16);
  padding: 0;
  margin: 0;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  background-image: url('../images/close.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;

  &.incidents-form-select-btn {
    top: calc(50% - #{sizeToRem(9)});
    right: sizeToRem(7);

    &::before {
      content: '';
      position: absolute;
      top: 50%;
      left: sizeToRem(-5);
      width: sizeToRem(1);
      height: sizeToRem(26);
      transform: translateY(-50%);
      background-color: $form-basic;
    }
  }
}

.incidents-form-input {
  height: sizeToRem(40);
  width: sizeToRem(220);
  margin-right: sizeToRem(10);

  .input-field {
    padding-right: sizeToRem(30);
    min-height: auto !important;
  }
}

.incidents-form-input-time-with-btn {
  position: relative;
  height: sizeToRem(40);

  .input-field {
    width: sizeToRem(87);
    padding-right: sizeToRem(30);
  }

  .incidents-form-input-btn {
    right: sizeToRem(22);
  }
}

.incidents-form-select-wrapper {
  min-width: sizeToRem(220);
  max-width: sizeToRem(500);
  position: relative;
  margin-right: sizeToRem(10);

  @include media-breakpoint-down(md) {
    max-width: 100%;
  }

  .custom-select-button {
    min-height: sizeToRem(41);
    border: none !important;

    label {
      position: absolute;
      top: 0;
      left: sizeToRem(12);
      font-size: sizeToRem(14);
      font-weight: 500;
      padding: 0 0.375rem;
      transform: translateY(-50%);
      color: $dark-lighter;
      z-index: 2;
      background-color: $grey-background;
    }
  }

  .custom-select-container {
    min-height: sizeToRem(41);
  }

  .custom-select-button__control {
    background-color: $grey-background;
    min-height: sizeToRem(41) !important;
    padding-right: sizeToRem(36);
    border-color: $form-basic !important;

    &.custom-select-button__control--menu-is-open {
      border-color: $primary !important;
    }
  }

  .custom-select-button__indicator {
    color: $form-basic !important;
  }

  .custom-select-button__value-container {
    padding: sizeToRem(6) 0 !important;
  }

  .custom-select-button__multi-value {
    border-radius: $border-radius;
    overflow: hidden;
    background-color: rgba($grey-base, 0.2);
  }

  .custom-select-button__multi-value__label {
    line-height: 1.15;
  }
}

.incidents-dropdown-add-filter {
  margin-right: sizeToRem(30);

  &::after {
    display: none; // to remove default dropdown arrow
  }
}

.incidents-dropdown-menu-item {
  color: $dark;
}

.incidents-btn-submit {
  height: sizeToRem(40);
}

.incidents-form-input-wrapper,
.incidents-form-input,
.incidents-form-select-wrapper {
  @include media-breakpoint-down(sm) {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }
}

.incidents-limit-info-container {
  display: flex;
  align-items: center;

  .incidents-limit-select {
    min-width: sizeToRem(120);
    margin-bottom: 0;

    .custom-select-button__control {
      padding-right: sizeToRem(16);
    }
  }
}

// incidents toast

.incidents-toast {
  width: sizeToRem(400);

  @include media-breakpoint-down(md) {
    width: sizeToRem(320);
  }

  /* stylelint-disable-next-line selector-class-pattern */
  .Toastify__toast--warning {
    background-color: $dark;
  }
}

// incidents no resources

.incidents-no-resources-image {
  width: sizeToRem(150);
  height: auto;
  margin-bottom: sizeToRem(40);

  @include media-breakpoint-up(md) {
    width: sizeToRem(250);
  }
}

.incidents-no-resources-title {
  text-align: center;

  @include media-breakpoint-up(md) {
    font-size: sizeToRem(36);
  }
}

// incidents export dropdown

.incidents-export-dropdown {
  .export-dropdown-toggle {
    @extend %column-filter-dropdown-toggle;
  }

  .dropdown-chevron {
    transition: transform 0.3s ease;
  }

  &.show .dropdown-chevron {
    transform: rotate(180deg);
  }

  .export-dropdown-menu {
    display: flex;
    flex-direction: column;
    transform: translate(-30px, 30px) !important;
    min-width: sizeToRem(112);
    right: unset !important;
    left: 0 !important;
  }
}

.dropdown-menu {
  --bs-tertiary-bg: #e9ecef !important;
}
