/**
* c-notification
*/
@import url('../../styles/variables.css');

.c-notification {
  position: fixed;
  display: flex;
  z-index: 9999;
}

.c-notification-topRight {
  top: 80px;
  right: 40px;
  flex-direction: column;
}

.c-notification-bottomRight {
  bottom: 80px;
  right: 40px;
  flex-direction: column-reverse;
}

.c-notification-topLeft {
  top: 80px;
  left: 40px;
  flex-direction: column;
}

.c-notification-bottomLeft {
  bottom: 80px;
  left: 40px;
  flex-direction: column-reverse;
}

.c-notice__wrapper {
  position: relative;
  margin-bottom: 16px;
  padding: 1.6em;
  background-color: #fff;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  display: flex;
  flex-direction: row;
  width: 360px;

  & .c-notification__icon > .c-icon {
    font-size: 2em;
    padding-right: 10px;
    color: var(--primary-color);

    &.success {
      color: var(--success-color);
    }

    &.warning {
      color: var(--warning-color);
    }

    &.error {
      color: var(--danger-color);
    }

    &.info {
      color: var(--primary-color);
    }
  }
}

.c-notice__header {
  padding: 0 1.2em 0.6em 0;
  line-height: 1;
  font-size: 1.2em;
  font-weight: bold;
  color: #444;
}

.c-notice__body {
  padding: 0 1.2em 0 0;
}

.c-notice__close {
  position: absolute;
  right: 1em;
  top: 1em;
}

/**
 * notification transition
 */

.notification-enter-active,
.notification-leave-active {
  transition: all 0.5s;
}

.notification-enter,
.notification-leave-to {
  opacity: 0;
}

.c-notification-bottomLeft .notification-enter-to.notification-enter-active,
.c-notification-topLeft .notification-enter-to.notification-enter-active {
  animation-name: NotificationLeftFadeIn;
}

.c-notification .notification-enter-to {
  animation-duration: 0.24s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
}

.notification-enter-to {
  opacity: 0;
  animation-play-state: paused;
}

.notification-enter-to,
.notification-leave-to {
  animation-duration: 0.24s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
}

.notification-leave-to {
  animation-duration: 0.2s;
  animation-play-state: paused;
}

.notification-enter-to.notification-enter-active {
  animation-name: NotificationFadeIn;
  animation-play-state: running;
}

.notification-leave-to.notification-leave-active {
  animation-name: NotificationFadeOut;
  animation-play-state: running;
}

@keyframes NotificationFadeIn {
  0% {
    opacity: 0;
    left: 400px;
  }

  to {
    left: 0;
    opacity: 1;
  }
}

@keyframes NotificationLeftFadeIn {
  0% {
    opacity: 0;
    right: 400px;
  }

  to {
    right: 0;
    opacity: 1;
  }
}

@keyframes NotificationFadeOut {
  0% {
    opacity: 1;
    margin-bottom: 16px;
    padding-top: 16px 24px;
    padding-bottom: 16px 24px;
    max-height: 100px;
  }

  to {
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    max-height: 0;
  }
}
