@import "../../styles/variables.scss";

$modal-padding-small: $m-spacing;
$modal-padding-large: $l-spacing;

.enter {
    &.overlay {
      opacity: 0;
      .modalWrapper {
        opacity: 0;
        transform: translateY(25px);
      }
    }
}

.enterActive{
  &.overlay {
    .modalWrapper {
      opacity: 1;
      transform: translateY(0);
      transition: all 250ms ease-in-out;
      transition-delay: 100ms;
    }
    opacity: 1;
    transition: all 150ms ease-out;
  }
}

:global(.exiting) .enter {
    &.overlay {
      opacity: 0;
    }
}

:global(.exiting) .enterActive{
  &.overlay {
    opacity: 1;
    transition: all 0ms ease-out;;
    transition-delay: 150ms;
  }
}

.exit {
  &.overlay {
    .modalWrapper {
      opacity: 1;
      margin-top: 0;
    }
    opacity: 1;
  }
}

.exitActive {
  &.overlay {
    .modalWrapper {
      opacity: 0;
      transform: translateY(-25px);
      transition: all 250ms ease-out;
    }
    opacity: 0;
    transition: all 250ms ease-out;
    transition-delay: 150ms;
  }
}

:global(.entering) .exit {
  &.overlay {
    opacity: 1;
  }
}

:global(.entering) .exitActive {
  &.overlay {
    opacity: 0;
    transition: all;
    transition-delay: 150ms;
  }
}

.hidden {
  display: none;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  background: $overlay-background;
}

.fixed {
  position: fixed;
}

.modal {
  display: flex;
  flex-direction: column;
  max-height: 99vh;
  border-radius: $base-border-radius;
  box-shadow: $base-box-shadow;
  position: relative;
  background: $brand-white;
  padding: $modal-padding-small;

  @media only screen and (min-width: 48em) {
    padding: $modal-padding-large;
  }
}

.unfixed {
  .modal {
    max-height: 100%;
  }
}

.unfixed {
  z-index: 15;
}

.closeWrapper {
  position: relative;
  text-align: right;
}

.closeIcon {
  cursor: pointer;
  right: 0;
  color: $brand-grey;
  font-size: 1.2em;

  &:hover {
    color: $brand-blue;
  }
}

.modalMain {
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: -$modal-padding-small;
  margin-right: -$modal-padding-small;
  padding-left: $modal-padding-small;
  padding-right: $modal-padding-small;

  @media only screen and (min-width: 48em) {
    margin-left: -$modal-padding-large;
    margin-right: -$modal-padding-large;
    padding-left: $modal-padding-large;
    padding-right: $modal-padding-large;
  }
}

.iconHeader {
  color: $brand-purple;
  margin: $xxl-spacing auto;
  font-size: 2.5rem;
  text-align: center;
}

.loadingHeader {
  margin: 0 auto;
  margin-bottom: $m-spacing;
  font-size: 4em;
}

.modalWrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  //margin-bottom: $s-spacing;
}

.small, .medium, .large {
  width: 100%;
  margin: $s-spacing;
}

.small {
  max-width: 30rem;
}

.medium {
  max-width: 38rem;
}

.large {
  max-width: 55rem;
}

.innerWrapper {
  height: 100%;
  max-height: 95%;
}

.headerContent {
  line-height: $base-line-height;
  margin: 0 auto;
  padding: $xxl-spacing 0 0 0;
  text-align: center;
}

.headerWrapper {
}

.heading {
  padding-bottom: $m-spacing;
}

.message {
  text-align: center;
}

.description {
  padding: $xl-spacing 0 $xxl-spacing;
  text-align: center;
  margin: 0 auto;
  max-width: 38rem;
}

.body {
  padding-bottom: $xl-spacing;
  line-height: $base-line-height;
}

.bodyWrapper {
}

.footer {
  display: flex;
  flex-direction: row;

  @media only screen and (min-width: 35em) {
    display: block;
    text-align: right;
  }

  button {
    flex: 1;
  }
}

.footerWrapper {
  border-top: $base-border;
  padding: $modal-padding-small $modal-padding-small 0;
  margin-left: -$modal-padding-small;
  margin-right: -$modal-padding-small;

  @media only screen and (min-width: 48em) {
    padding: $modal-padding-large $modal-padding-large 0;
    margin-left: -$modal-padding-large;
    margin-right: -$modal-padding-large;
  }
}
