/* Modal */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  outline: 0;
}

.modal-open {
  overflow: hidden;

  .modal {
    overflow-x: hidden;
    overflow-y: auto;
  }
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1rem auto;
  pointer-events: none;
}

.modal.fade .modal-dialog {
  transition: transform .3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

.modal.modal-static .modal-dialog {
  transform: scale(1.02);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: var(--hiq-modal-background-color);
  background-clip: padding-box;
  border: 1px solid var(--hiq-border-color);
  border-radius: var(--hiq-border-radius);
  outline: 0;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--hiq-border-color);

  .close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
  }
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: .75rem;
  border-top: 1px solid var(--hiq-border-color);

  > * {
    margin: .25rem;
  }
}

.modal-dialog-scrollable {
  display: flex;
  max-height: calc(100% - 1rem);

  .modal-content {
    max-height: calc(100vh - 1rem);
    overflow: hidden;
  }

  .modal-header,
  .modal-footer {
    flex-shrink: 0;
  }

  .modal-body {
    overflow-y: auto;
  }
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);

  &::before {
    display: block;
    height: calc(100vh - 1rem);
    content: "";
  }
}

.modal-dialog-centered.modal-dialog-scrollable {
  flex-direction: column;
  justify-content: center;
  height: 100%;

  &::before {
    content: none;
  }
}

.modal-dialog-centered.modal-dialog-scrollable .modal-content {
  max-height: none;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: #000;

  &.fade {
    opacity: 0;
  }

  &.show {
    opacity: .5;
  }
}

@media (--hiq-upper-font-range) {
  .modal-lg,
  .modal-xl {
    max-width: 800px;
  }
}

[class*=jviewport-height] iframe {
  width: 100%;
  height: 100%;
}

.modal-dialog.jviewport-width {
  &10 {
    width: 10vw;
  }

  &20 {
    width: 20vw;
    max-width: none;
  }

  &30 {
    width: 30vw;
    max-width: none;
  }

  &40 {
    width: 40vw;
    max-width: none;
  }

  &50 {
    width: 50vw;
    max-width: none;
  }

  &60 {
    width: 60vw;
    max-width: none;
  }

  &70 {
    width: 70vw;
    max-width: none;
  }

  &80 {
    width: 80vw;
    max-width: none;
  }

  &90 {
    width: 90vw;
    max-width: none;
  }

  &100 {
    width: 100vw;
    max-width: none;
  }
}

.jviewport-height {
  &10 {
    height: 10vh;
  }

  &20 {
    height: 20vh;
  }

  &30 {
    height: 30vh;
  }

  &40 {
    height: 40vh;
  }

  &50 {
    height: 50vh;
  }

  &60 {
    height: 60vh;
  }

  &70 {
    height: 70vh;
  }

  &80 {
    height: 80vh;
  }

  &90 {
    height: 90vh;
  }

  &100 {
    height: 100vh;
  }
}
