/*!
 * nice-toast-js 1.0.0
 * Made with create-jquery-plugin
 *
 * Created by hasan ahani <hasanahani.ir@gmail.com>
 *
 * @license MIT
 */

$vt-namespace : 'nice-toast';
$success:       #20D489;
$info:          #00A3FF;
$warning:       #FFC700;
$error:         #F1416C;


$colors : (
  'default'   : $info,
  'success'   : $success,
  'info'      : $info,
  'warning'   : $warning,
  'error'     : $error,
) !default;

.nice-toast-wrapper{
  position: fixed;
  padding: 4px;
  width: 600px;
  box-sizing: border-box;
  display: flex;
  min-height: 100%;
  color: #fff;
  flex-direction: column;
  pointer-events: none;
  z-index: 9999;

  &[class*=' top']{
    top: 1em;
  }

  &[class*=' bottom']{
    bottom: 1em;
    flex-direction: column-reverse;
  }
  &[class$=left]{
    left: 1em;

    .nice-toast{
      margin-right: auto;
    }
  }
  &[class$=right]{
    right: 1em;

    .nice-toast{
      margin-left: auto;
    }
  }

  &[class$=center]{
    left: 50%;
    margin-left: -300px;

    .nice-toast{
      margin-left: auto;
      margin-right: auto;
    }
  }


}

.nice-toast{
  display: inline-flex;
  position: relative;
  max-height: 800px;
  min-height: 64px;
  box-sizing: border-box;
  margin-bottom: 1rem;
  box-shadow: rgba(0, 0, 0, 0.1) 0 1px 10px 0,
              rgba(0, 0, 0, 0.05) 0 2px 15px 0;
  justify-content: space-between;
  font-family: inherit, Lato, Helvetica, Roboto, Arial, sans-serif;
  max-width: 600px;
  min-width: 326px;
  pointer-events: auto;
  transform: translateZ(0px);
  padding: 22px 24px;
  border-radius: 8px;
  overflow: hidden;


}

.nice-toast-icon{
  align-items: center;
  width: 20px;
  height: 100%;
  margin: auto 18px auto 0;
  background: transparent;
  outline: none;
  border-width: initial;
  border-style: none;
  border-color: initial;
  border-image: initial;
  padding: 0;
  transition: all 0.3s ease 0s;
}

.nice-toast-content{
  line-height: 24px;
  font-size: 16px;
  word-break: break-word;
  white-space: pre-wrap;
  user-select: none;
  width: 100%;
}

.nice-toast-progress{
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  z-index: 10000;
  background-color: hsla(0,0%,100%,.7);
  transform-origin: left;
  animation: scale-x-frames linear 1 forwards
}


@-webkit-keyframes scale-x-frames {
  0% {
    -webkit-transform: scaleX(1);
    transform: scaleX(1)
  }

  to {
    -webkit-transform: scaleX(0);
    transform: scaleX(0)
  }
}

@keyframes scale-x-frames {
  0% {
    -webkit-transform: scaleX(1);
    transform: scaleX(1)
  }

  to {
    -webkit-transform: scaleX(0);
    transform: scaleX(0)
  }
}

.nice-toast-close{
  font-weight: 700;
  font-size: 24px;
  line-height: 24px;
  cursor: pointer;
  align-items: center;
  color: rgb(255, 255, 255);
  opacity: 0.3;
  background: transparent;
  outline: none;
  border-width: initial;
  border-style: none;
  border-color: initial;
  border-image: initial;
  padding: 0 0 0 10px;
  transition: visibility 0s ease 0s, opacity 0.2s linear 0s;
  &:hover{

    opacity: 1;
  }
}


@each $color, $value in $colors {
  .nice-toast-#{$color} {
    background-color: $value;
  }
}



$trans-cubic-bezier: cubic-bezier(0.215, 0.61, 0.355, 1);
@mixin timing-function {
  animation-timing-function: $trans-cubic-bezier;
}

@keyframes bounceInRight {
  from,
  60%,
  75%,
  90%,
  to {
    @include timing-function;
  }
  from {
    opacity: 0;
    transform: translate3d(3000px, 0, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(-25px, 0, 0);
  }
  75% {
    transform: translate3d(10px, 0, 0);
  }
  90% {
    transform: translate3d(-5px, 0, 0);
  }
  to {
    transform: none;
  }
}

@keyframes bounceOutRight {
  40% {
    opacity: 1;
    transform: translate3d(-20px, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(1000px, 0, 0);
  }
}

@keyframes bounceInLeft {
  from,
  60%,
  75%,
  90%,
  to {
    @include timing-function;
  }
  0% {
    opacity: 0;
    transform: translate3d(-3000px, 0, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(25px, 0, 0);
  }
  75% {
    transform: translate3d(-10px, 0, 0);
  }
  90% {
    transform: translate3d(5px, 0, 0);
  }
  to {
    transform: none;
  }
}

@keyframes bounceOutLeft {
  20% {
    opacity: 1;
    transform: translate3d(20px, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(-2000px, 0, 0);
  }
}

@keyframes bounceInUp {
  from,
  60%,
  75%,
  90%,
  to {
    @include timing-function;
  }
  from {
    opacity: 0;
    transform: translate3d(0, 3000px, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(0, -20px, 0);
  }
  75% {
    transform: translate3d(0, 10px, 0);
  }
  90% {
    transform: translate3d(0, -5px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bounceOutUp {
  20% {
    transform: translate3d(0, -10px, 0);
  }
  40%,
  45% {
    opacity: 1;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, -2000px, 0);
  }
}

@keyframes bounceInDown {
  from,
  60%,
  75%,
  90%,
  to {
    @include timing-function;
  }
  0% {
    opacity: 0;
    transform: translate3d(0, -3000px, 0);
  }
  60% {
    opacity: 1;
    transform: translate3d(0, 25px, 0);
  }
  75% {
    transform: translate3d(0, -10px, 0);
  }
  90% {
    transform: translate3d(0, 5px, 0);
  }
  to {
    transform: none;
  }
}

@keyframes bounceOutDown {
  20% {
    transform: translate3d(0, 10px, 0);
  }
  40%,
  45% {
    opacity: 1;
    transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 2000px, 0);
  }
}

@keyframes bounceOutDown {
  20% {
    transform: translate3d(0, 10px, 0);
  }
  40%,
  45% {
    opacity: 1;
    transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 2000px, 0);
  }
}
.nice-toast-bounce-enter-active, .nice-toast-bounce-leave-active{
  transition-property: transform, opacity;
  animation-duration: 750ms;
  animation-delay: 0ms;
}
.top-left ,.bottom-left{
  .nice-toast-bounce-leave-active{
    animation-name: bounceOutLeft;
  }
  .nice-toast-bounce-enter-active{
    animation-name: bounceInLeft;
  }
}
.top-right,.bottom-right {
  .nice-toast-bounce-leave-active{
    animation-name: bounceOutRight;
  }

  .nice-toast-bounce-enter-active{
    animation-name: bounceInRight;
  }
}
.top-center{
  .nice-toast-bounce-leave-active{
    animation-name: bounceOutUp;
  }
  .nice-toast-bounce-enter-active{
    animation-name: bounceInDown;
  }
}
.bottom-center{
  .nice-toast-bounce-leave-active{
    animation-name: bounceOutDown;
  }

  .nice-toast-bounce-enter-active{
    animation-name: bounceInUp;
  }
}

.nice-toast-bounce-move {
  transition-timing-function: ease-in-out;
  transition-property: all;
  transition-duration: 400ms;
}
