﻿
:root {
    --notification-background: #313e2c;
    --notification-background-error: #510303;
    --notification-primary: #aaec8a;
    --notification-primary-error: #FF4848;
    --background: #FAF9FF;
}

.notification {
    position: absolute;
    width: 50%;
    left: 0;
    right: 0;
    bottom: 40px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 6px;
    background-color: var( --notification-background);
    color: var(--notification-primary);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(30px);
    opacity: 0;
    visibility: hidden;
    animation: fade-in 3s linear;
}

.notification-error {
    position: absolute;
    width: 50%;
    left: 0;
    right: 0;
    bottom: 40px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 6px;
    background-color: var( --notification-background-error);
    color: var(--notification-primary-error);
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(30px);
    opacity: 0;
    visibility: hidden;
    animation: fade-in 3s linear;
}

.notification__icon {
    height: 26px;
    width: 26px;
    margin-right: 4px;
}

.notification__body {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 16px 8px;
}

.notification__progress {
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: calc(100% - 8px);
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient( to right, var(--notification-background), var(--notification-primary) );
    border-radius: inherit;
    animation: progress 2.5s 0.3s linear;
}

.notification__progress__error {
    position: absolute;
    left: 4px;
    bottom: 4px;
    width: calc(100% - 8px);
    height: 3px;
    transform: scaleX(0);
    transform-origin: left;
    background: linear-gradient( to right, var(--notification-background-error), var(--notification-primary-error) );
    border-radius: inherit;
    animation: progress 2.5s 0.3s linear;
}

@keyframes fade-in {
    5% {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    95% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progress {
    to {
        transform: scaleX(1);
    }
}
