/* stylelint-disable a11y/media-prefers-reduced-motion */

.modal-overlay {
  height: 100vh;
  width: 100vw;
  position: fixed;
  inset-block-start: 0;
  inset-inline-end: 0;
  inset-block-end: 0;
  inset-inline-start: 0;
  display: none;
  z-index: 990;
  background-color: rgba(18, 52, 77, 0.5);
  align-items: center;
  justify-content: center;
  transition: all 0.3s linear;
}

.modal {
  position: relative;
  display: flex;
  max-height: 70vh;
  background: $color-milk;
  box-shadow: 0px 2px 18px rgba(18, 52, 77, 0.2);
  border-radius: 4px;
  z-index: 999;
  animation: 'modal-entry' 0.5s 1;

  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;

  .modal-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;

    .content {
      padding-block-end: 32px;
      padding-inline: 32px;
      padding-block-start: 0px;
      overflow: visible;
      box-sizing: border-box;
    }
  }

  .close-btn {
    background-color: transparent;
    background-image: none;
    border: 1px solid transparent;
    color: $color-elephant-800;
    padding-inline: 6px;
    padding-block: 4px;
    min-width: 16px;
    height: 24px;
    position: absolute;
    inset-block-start: 8px;
    inset-inline-end: 8px;
    transition: all 0.3s;
    z-index: 1;

    &:hover,
    &:focus {
      background-color: $color-smoke-50;
      border-radius: 4px;
      border-color: $color-smoke-50;
      cursor: pointer;
    }
  }
}

.standard {
  width: 512px;
}

.small {
  width: 424px;
}

.large {
  width: 800px;
}

.modal-overlay.slider {
  justify-content: flex-end;

  .modal {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0px;
    width: 600px;
    animation: 'modal-entry-right' 0.5s 1;

    .close-btn {
      height: 24px;
      width: 24px;
      box-sizing: border-box;
      inset-block-start: 0px;
      inset-inline-end: 600px;
      background-color: $color-elephant-900;
      border-end-start-radius: 2px;
      border-end-end-radius: 0px;
      border-start-end-radius: 0px;
      border-start-start-radius: 2px;
      padding: 0px;
      margin: 0px;
      line-height: 24px;
      text-align: center;

      &:hover,
      &:focus,
      &:focus-visible {
        background-color: $color-elephant-900;
        border-end-start-radius: 2px;
        border-end-end-radius: 0px;
        border-start-end-radius: 0px;
        border-start-start-radius: 2px;
        border-color: $color-elephant-900;
        outline: 0px;
      }

      &:focus,
      &:focus-visible {
        border: 1px solid $color-azure-800;
        box-shadow: $color-azure-800 0px 0px 0px 1px;
      }

      fw-icon {
        height: 12px;
        width: 12px;
      }
    }

    &.small,
    &.standard,
    &.large {
      width: 600px;
    }
  }
}

.visible {
  display: flex;
}

@keyframes modal-entry {
  0% {
    transform: translateY(-10px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes modal-entry-right {
  0% {
    transform: translateX(calc(100% - 520px));
  }

  100% {
    transform: translateX(0);
  }
}
