:root {
  --toast-color-success: #0abf30;
  --toast-color-error: #e24d4c;
  --toast-color-warning: #e9bd0c;
  --toast-color-info: #3498db;
}

@media screen and (max-width: 530px) {
  .notifications {
    width: 95%;
  }
  .notifications .toasting {
    width: 100%;
    font-size: 1rem;
    margin-left: 20px;
  }
}

.notifications {
  position: fixed;
  top: 30px;
  right: 20px;
  z-index:999;
}
.notifications :where(.toasting, .column) {
  display: flex;
  align-items: center;
}

.notifications .toasting {
  width: 400px;
  position: relative;
  overflow: hidden;
  list-style: none;
  /*border: 1px solid lightgray;*/
  border-radius: 4px;
  padding: 16px 17px;
  margin-bottom: 10px;
  justify-content: space-between;
  animation: show_toast 0.3s ease forwards;
  color: white;
}
.toasting.success {
  background: var(--toast-color-success);
}
.toasting.error {
  background: var(--toast-color-error);
}
.toasting.warning {
  background: var(--toast-color-warning);
}
.toasting.info {
  background: var(--toast-color-info);
}
@keyframes show_toast {
  0% { transform: translateX(100%); }
  40% { transform: translateX(-5%); }
  80% { transform: translateX(0%); }
  100% { transform: translateX(-10px); }
}

.notifications .toasting.hide {
  animation: hide_toast 0.3s ease forwards;
}
@keyframes hide_toast {
  0% { transform: translateX(-10px); }
  40% { transform: translateX(0%); }
  80% { transform: translateX(-5%); }
  100% { transform: translateX(calc(100% + 20px)); }
}

/*********************** Progress bar ***********************/
.toasting::before {
  position: absolute;
  content: "";
  height: 3px;
  width: 100%;
  bottom: 0px;
  left: 0px;
  animation: progress 5s linear forwards;
  background: white;
}
@keyframes progress {
  100% { width: 0%; }
}

/*********************** Icon ***********************/
.toasting .column i {
  font-size: 1.75rem;
}

/*********************** Message body ***********************/
.toasting .column span {
  font-size: 1.07rem;
  margin-left: 12px;
}

/*********************** Close button ***********************/
.toasting i:last-child {
  cursor: pointer;
  padding-right: 5px;
}
.toasting i:last-child:hover {
  background-color: lightgrey;
  border-radius: 50px;
  padding: 5px;
}

/*********************** Inverted colors ***********************/
.toasting.inverted {
  background: white;
  color: inherit;

  /* Progress bar */
  &.success::before {
    background: var(--toast-color-success);
  }
  &.error::before {
    background: var(--toast-color-error);
  }
  &.warning::before {
    background: var(--toast-color-warning);
  }
  &.info::before {
    background: var(--toast-color-info);
  }

  /* Icon */
  &.success .column i {
    color: var(--toast-color-success);
  }
  &.error .column i {
    color: var(--toast-color-error);
  }
  &.warning .column i {
    color: var(--toast-color-warning);
  }
  &.info .column i {
    color: var(--toast-color-info);
  }

  /* Close button */
  i:last-child {
    color: #aeb0d7;
  }
}
