@import './variables.css';

.modal {
  width: 440px;
  background-color: var(--white);
  outline: none;
  box-shadow: 0 1px 4px 0 var(--shadowColor);
  margin-bottom: 40vh; /* push the modal up above vertical center */

  transform: translateY(-6px);
  transition: all 100ms ease-in-out;

  border-radius: var(--borderRadius);

  & .modal-header {
    width: 100%;
    background-color: var(--primaryColor);
    color: var(--white);
    padding: var(--mediumGutter);
    border-top-left-radius: var(--borderRadius);
    border-top-right-radius: var(--borderRadius);
  }

  & .modal-body {
    padding: var(--mediumGutter);
    border: 1px solid var(--gray);
    border-top: none;
    border-bottom-left-radius: var(--borderRadius);
    border-bottom-right-radius: var(--borderRadius);
  }
}

.modal-overlay {
  z-index: 1000;
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.5);
}

.ReactModalPortal {
  & > div {
    opacity: 0;
  }
}

.ReactModalPortal .ReactModal__Overlay {
  background-color: rgba(255, 255, 255, 0.5);

  &--after-open {
    opacity: 1;

    & .modal {
      transform: translateY(0);
    }
  }

  &--before-close {
    opacity: 0;
  }
}
