@use '../styles/mat-selectors' as ms;
@use '@angular/material' as mat;

.aca-manage-rules {
  @include mat.button-overrides(
    (
      outlined-outline-color: var(--adf-theme-foreground-text-color-064)
    )
  );

  #{ms.$mat-slide-toggle}:is(mat-slide-toggle) #{ms.$mat-switch}:enabled #{ms.$mat-switch-track}::after {
    background: var(--mdc-switch-selected-track-color);
  }

  #{ms.$mat-slide-toggle} #{ms.$mat-switch} #{ms.$mat-switch-handle}::before {
    background: var(--mdc-switch-selected-pressed-handle-color);
  }

  &__toolbar {
    color: var(--adf-theme-foreground-text-color-064);
    height: 64px;
    font-size: var(--theme-body-1-font-size);
    white-space: normal;
    background-color: inherit;
    border: none;
    padding: 0;
  }

  &__actions-bar {
    padding: 0 30px;
    display: flex;
    align-items: center;

    .aca-page-title {
      margin-left: 18px;
    }

    &__title {
      display: flex;
      align-items: center;
      flex: 1;
      font-size: var(--theme-body-1-font-size);
    }

    &__buttons {
      display: flex;
      align-items: stretch;
      gap: 12px;
    }

    &__toggle {
      font-weight: 600;
      font-size: 14px;
    }

    &__vertical-divider {
      height: 50%;
      margin: 0 12px;
    }
  }

  &__container {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 3fr;
    padding: 20px;
    gap: 12px;
    overflow-y: auto;
    flex: 1;

    &__rule-details {
      border: 1px solid var(--theme-border-color);
      border-radius: 12px;
      overflow-y: auto;

      &__header {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        overflow-x: auto;
        justify-content: space-between;
        padding: 12px 20px;
        border-bottom: 1px solid var(--theme-border-color);
        background-color: var(--theme-background-color);
        column-gap: 20px;

        &__title {
          display: flex;
          flex-direction: column;
          gap: 4px;
          word-wrap: break-word;
          min-width: 100px;

          &__name {
            font-size: 1.2em;
            font-weight: bold;
          }

          &__description {
            font-size: 0.8em;
            font-style: italic;
          }
        }

        .aca-manage-rules__container__rule-details__header__buttons {
          display: flex;
          flex-direction: row;
          align-items: stretch;
          gap: 4px;

          button {
            color: var(--theme-text-color);

            &#delete-rule-btn {
              padding: 0 8px;
              margin: 0;
              min-width: unset;

              mat-icon {
                margin: 0;
                padding: 0;
                width: 24px;
                height: 24px;
                font-size: 24px;
              }
            }
          }
        }
      }
    }
  }
}
