@import "../settings/variables";

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.modal-component {
  animation: fade-in 0.3s;
  display: flex;
  height: 100vh;
  position: absolute;
  transition: opacity;
  width: 100vw;
  z-index: 0;

  &--fade-out {
    animation: fade-out 0.3s;
  }

  &__body {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-width: 640px;
    padding: 0 48px;
    margin: spacing(xl) 0;
    overflow: auto;
  }

  &__buttons {
    display: flex;
    flex: 0 0 auto;
    margin-left: spacing(lg);

    > * + * {
      margin-left: spacing(sm);
    }
  }

  &__cancel {
    color: $core-gray-50;
    cursor: pointer;
    position: absolute;
    right: 48px;
    top: 34px;
  }

  &__container {
    display: flex;
    flex-direction: row;
    left: 50vw;
    position: absolute;
    top: 50vh;
    transform: translate(-50%, -50%);
    z-index: 2;

    &--top {
      top: 5vh;
      transform: translate(-50%, 0);
    }
  }

  &__content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
  }

  &__fade {
    transition: 300ms;
    opacity: 0;

    &--visible {
      opacity: 1;
    }
  }

  &__footer {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-top: spacing(xl);
    padding: 0 48px 32px;

    &__notation {
      flex-grow: 1;
    }
  }

  &__header {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    position: relative;
    padding: 32px 82px 24px 48px;
  }

  &__scrim {
    background: $modal-overlay-background;
    height: 100vh;
    left: 0;
    position: absolute;
    top: 0;
    width: 100vw;
    z-index: 1;
  }

  &__warning-icon {
    color: $core-yellow-50;
    margin-right: spacing(sm);
  }
}
