
.alert-cont {
    position: fixed;
    top: 10px;
    right: 0;
    height: 100%;
    z-index: 100000;
    pointer-events: none;
}

.js-alert {
    max-width: 420px;
    min-width: 420px;
    position: sticky;
    border-radius: 4px;
    border-left: 8px solid var(--color-b);
    overflow: hidden;
    background: var(--color-c);
    pointer-events: auto;
}

.js-alert .alert-content {
    padding: 0 40px;
    margin-bottom: 20px;
}

.js-alert .fa-exclamation-circle {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: var(--color-d);
}

.js-alert .msg {
    float: left;
    padding: 20px;
    font-size: 18px;
    color: var(--color-a);
}

.js-alert .close-btn {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    padding: 100% 18px;
    cursor: pointer;
    background: var(--color-c);
}

.close-btn:hover {
    background: var(--color-b);
}

.close-btn .fa-times {
    font-size: 22px;
    line-height: 40px;
    color: var(--color-a);
}

/* animate */
.js-alert.show {
    animation: show_slide .5s ease forwards;
}

@keyframes show_slide {
    0% {
        transform: translateX(100%);
    }

    40% {
        transform: translateX(-10px);
    }

    80% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-5px);
    }
}

.js-alert.hide_alert {
    animation: hide_slide .5s ease forwards;
}

.js-alert.hidden {
    display: none;
    transition: opacity 1s ease-out;
    opacity: 0;
}


@keyframes hide_slide {
    0% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(0%);
    }

    80% {
        transform: translateX(-10px);
    }
    100% {
        visibility: hidden;
        transform: translateX(100%);
    }
}

/*  colours */

.js-alert {
    --color-a: #ffffff;
    --color-b: #5a5c69;
    --color-c: #858796;
    --color-d: #ffffff;
    --color-e: #ffffff;
}

.js-alert-warning {
    --color-a: #000000;
    --color-b: #f1ad38;
    --color-c: #f6c23e;
    --color-d: #000000;
    --color-e: #000000;
}

.js-alert-danger {
    --color-b: #b9120e;
    --color-c: #e74a3b;
}

.js-alert-success {
    --color-b: #347e39;
    --color-c: #1cc88a;
}

.js-alert-info {
    --color-b: #3344D6;
    --color-c: #36b9cc;
}

.time-bar div {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    animation: roundtime calc(var(--duration) * 1s) linear forwards;
    transform-origin: left center;
    bottom: 0px;
    position: absolute;
}

@keyframes roundtime {
    to {
        /* More performant than animating `width` */
        transform: scaleX(0);
    }
}
