@use "../../assets/mixins" as *;

.pl-dialog-modal {
  --padding-top: 24px;
  --border-radius: 16px;
  --title-padding: 24px 24px 0 24px;

  min-height: 400px;
  max-height: calc(100vh - 48px);
  max-width: calc(100% - 48px);
  min-width: 448px;

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
  background-color: #fff;
  padding-top: var(--padding-top);
  display: flex;
  flex-direction: column;

  box-shadow: 0 2px 8px rgba(36, 34, 61, 0.12);
  border-radius: var(--border-radius);

  &.has-title {
    --padding-top: 0;
  }

  &.has-content {
    --title-padding: 24px;
  }

  &__title {
    display: flex;
    align-items: center;
    font-family: var(--font-family-base);
    font-size: 28px;
    font-style: normal;
    font-weight: 500;
    line-height: 32px;
    letter-spacing: -0.56px;
    padding: var(--title-padding);
  }

  &__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 24px 40px;
    min-height: 0;
    line-height: 20px;
    @include scrollbar();

    &.no-content-gutters {
      padding: 0 0;
    }

    &.no-top-content-gutter {
      padding-top: 0;
    }
  }

  &__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 88px;
    padding: 0 24px;

    button {
      min-width: 160px;
    }

    &.has-top-border {
      border-top: 1px solid var(--border-color-div-grey);
    }
  }

  .alert-error {
    background-color: var(--txt-error);
    color: #fff;
    font-weight: 500;
    padding: 12px;
    border-radius: 6px;
  }

  .alert-warning {
    background-color: #fee0a3;
    font-weight: 500;
    padding: 12px;
    border-radius: 6px;
  }

  &__shadow {
    position: absolute;
    z-index: var(--z-dialog);
    top: var(--title-bar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.64);
  }

  .close-modal-btn {
    position: absolute;
    top: 4px;
    right: 4px;
  }
}
