/*
SPDX-FileCopyrightText: German Aerospace Center (DLR) <cosmoscout@dlr.de>
SPDX-License-Identifier: MIT
*/

#notifications {
  grid-area: notifications;
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to top, rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 1) 50px);
}

.notification {
  position: absolute;
  opacity: 0;
  width: calc(100% - 50px);
  font-size: 1rem;
  transform: translate(330px, 5px);
  color: var(--cs-color-primary);
  background: linear-gradient(to right, rgba(20, 20, 20, 0.8), rgba(20, 20, 20, 0.4));
  line-height: 15px;
  border-radius: 5px;
  transition: transform 500ms cubic-bezier(0.305, 1.535, 0.570, 1.000);
  animation: fadeout 500ms 7500ms linear;
}

.notification.clickable:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 1.0), rgba(0, 0, 0, 0.8));
}

.notification.show:nth-child(1) {
  transform: translate(30px, 5px);
}

.notification.show:nth-child(2) {
  transform: translate(30px, 85px);
}

.notification.show:nth-child(3) {
  transform: translate(30px, 165px);
}

.notification.show:nth-child(4) {
  transform: translate(30px, 245px);
}

.notification.show:nth-child(5) {
  transform: translate(30px, 325px);
}

.notification.show {
  opacity: 1;
}

.notification.fadeout {
  opacity: 0;
}

.notification i {
  font-size: 2.5rem;
  left: 5px;
  animation: flash 1000ms ease-in-out, wiggle 1200ms linear;
}

.notification-title,
.notification-content {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.notification-title {
  font-size: 1.7rem;
  line-height: 2rem;
}

@keyframes fadeout {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

@-webkit-keyframes flash {
  0% {
    color: var(--cs-color-primary);
    opacity: 0;
  }

  50% {
    color: var(--cs-color-primary);
    opacity: 0.8;
    text-shadow: 0 0 0 var(--cs-color-primary);
  }

  60% {
    color: #fff;
    opacity: 1;
    text-shadow: 0 0 30px var(--cs-color-primary);
  }

  100% {
    color: var(--cs-color-primary);
    text-shadow: 0 0 0 var(--cs-color-primary);
  }
}

@-webkit-keyframes wiggle {
  0% {
    transform: rotate3d(0, 0, 1, 0deg);
  }

  51% {
    transform: rotate3d(0, 0, 1, 0deg);
  }

  58% {
    transform: rotate3d(0, 0, 1, 15deg);
  }

  65% {
    transform: rotate3d(0, 0, 1, -15deg);
  }

  72% {
    transform: rotate3d(0, 0, 1, 10deg);
  }

  79% {
    transform: rotate3d(0, 0, 1, -10deg);
  }

  86% {
    transform: rotate3d(0, 0, 1, 5deg);
  }

  93% {
    transform: rotate3d(0, 0, 1, -5deg);
  }

  100% {
    transform: rotate3d(0, 0, 1, 0deg);
  }
}