$jenkins-dialog-padding: 1.25rem;

.jenkins-dialog {
  border-radius: var(--form-input-border-radius);
  border: none;
  background-color: var(--card-background);
  box-shadow: var(--dialog-box-shadow);
  animation: jenkins-dialog-animate-in 0.25s cubic-bezier(0, 0.68, 0.5, 1.5);
  overflow: hidden;
  padding: $jenkins-dialog-padding 0 0 0;
  display: flex;
  flex-direction: column;
  gap: $jenkins-dialog-padding;
  outline: none;

  &::backdrop {
    background: var(--dialog-backdrop-background);
    animation: jenkins-dialog-backdrop-animate-in 0.15s;
  }

  &__title {
    font-size: 1.125rem;
    font-weight: var(--font-bold-weight);
    padding: 0 $jenkins-dialog-padding;
    color: var(--text-color);
    overflow-wrap: anywhere;
  }

  &__contents {
    overflow-y: auto;
    overflow-wrap: break-word;
    padding: 0 $jenkins-dialog-padding;
    max-height: 75vh;
    font-size: 1rem;
    color: var(--text-color-secondary);

    &--modal {
      padding-bottom: $jenkins-dialog-padding;
      color: var(--text-color);
    }
  }

  &__input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 $jenkins-dialog-padding 1rem;
    color: var(--text-color-secondary);
  }

  &__buttons {
    padding: 0 $jenkins-dialog-padding $jenkins-dialog-padding;
    justify-content: right;
    flex-direction: row-reverse;

    .jenkins-button {
      min-width: 100px;
    }
  }

  &__subtitle {
    font-size: 1rem;
    font-weight: var(--font-bold-weight);
    color: var(--text-color-secondary);
    padding: 0;
    margin: 0 0 1rem;
  }

  &__close-button {
    position: absolute;
    top: $jenkins-dialog-padding - 0.5rem;
    right: $jenkins-dialog-padding - 0.5rem;
    aspect-ratio: 1;
    padding: 0;
    border-radius: 100%;
  }
}

@keyframes jenkins-dialog-backdrop-animate-in {
  from {
    opacity: 0;
  }
}

@keyframes jenkins-dialog-backdrop-animate-out {
  to {
    opacity: 0;
  }
}

@keyframes jenkins-dialog-animate-in {
  from {
    scale: 85%;
    opacity: 0;
  }
}
