@import "../../mixins/colors.scss";

@keyframes overlayEnter {
  0% {
    background-color: hsla(0, 0%, 0%, 0);
  }
  100% {
    background-color: hsla(0, 0%, 0%, 0.4);
  }
}

@keyframes overlayExit {
  0% {
    background-color: hsla(0, 0%, 0%, 0.4);
  }
  100% {
    background-color: hsla(0, 0%, 0%, 0);
  }
}

@keyframes contentEnter {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  30% {
    transform: translateY(-50px);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

@keyframes contentExit {
  0% {
    transform: none;
    opacity: 1;
  }
  100% {
    transform: translateY(-50px);
    opacity: 0;
  }
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: hsla(0, 0%, 0%, 0);
  overflow: auto;
  display: flex;
  justify-content: center;
  overflow-y: auto;

  &.entering,
  &.entered {
    animation: overlayEnter 300ms ease-out forwards;
  }

  &.exiting,
  &.exited {
    animation: overlayExit 200ms ease-in forwards;
  }
}

.content {
  position: relative;
  border: none;
  border-radius: 6px;
  max-width: 100%;
  background-color: white;
  margin: auto;

  .entering &,
  .entered & {
    animation: contentEnter 500ms ease-out forwards;
  }

  .exiting &,
  .exited & {
    animation: contentExit 200ms ease-in forwards;
  }

  &.medium {
    width: 660px;
  }

  &.xsmall {
    width: 440px;
  }

  &.large {
    width: 990px;
  }
}

.hr {
  width: calc(100% + 60px);
  border-bottom: 1px solid chaser-color("Mid Neutral 3");
  margin-left: -30px;
}

.bodyContent {
  &.none {
    width: calc(100% + 60px);
    margin-left: -30px;
    margin-bottom: -30px;
  }

  &.medium {
    padding: 0px;
  }
}

.closeIcon {
  cursor: pointer;
  position: absolute;
  top: 11px;
  right: 10px;
}

.footer {
  border-top: 1px solid chaser-color("Light Neutral 1");
  background: chaser-color("Light Neutral 3");
  width: 100%;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;

  &.left {
    > *:first-child:last-child {
      margin-left: auto;
    }
  }
}
