﻿.spbuk-toast {
    position: fixed;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: start;
    user-select: none;
    max-width: 100%;
    background-color: transparent;
    pointer-events: none;
}

.spbuk-toast-content {
    position: relative;
    display: flex;
    overflow: hidden;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    width: 360px;
    max-width: 100%;
    background-color: #FFFFFF;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)
}

.spbuk-toast-title {
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.4;
    color: #000;
    margin: 0;
    padding: 0;
}

.spbuk-toast-message {
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    color: #000;
    margin: 0;
    padding: 0;
    flex: 1;
}

.show-toast {
    animation: toast-show 0.3s;
}

.hide-toast {
    animation: toast-hide 0.3s;
}

@keyframes toast-show {
    0% {
        transform: rotateZ(0);
    }

    40% {
        transform: rotateZ(-3deg);
    }

    80% {
        transform: rotateZ(3deg);
    }
}

@keyframes toast-hide {
    0% {
        transform: rotateZ(0);
    }

    40% {
        transform: rotateZ(-3deg);
    }

    80% {
        transform: rotateZ(3deg);
    }
}

.spbuk-toast-timer-bar {
    background-color: #28a745;
    animation: timer-bar-animation linear forwards;
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
}

@keyframes timer-bar-animation {
    0% {
        width: 100%;
    }

    100% {
        width: 0%;
    }
}

.spbuk-toast-top-left {
    top: 1rem;
    left: 1rem;
    bottom: auto;
    right: auto;
}

.spbuk-toast-top-right {
    top: 1rem;
    right: 1rem;
    bottom: auto;
    left: auto;
}

.spbuk-toast-bottom-left {
    bottom: 1rem;
    left: 1rem;
    top: auto;
    right: auto;
}

.spbuk-toast-bottom-right {
    bottom: 1rem;
    right: 1rem;
    top: auto;
    left: auto;
}

.spbuk-toast-top-center {
    left: 50%;
    transform: translateX(-50%);
}

.spbuk-toast-bottom-center {
    left: 50%;
    transform: translateX(-50%);
}


.spbuk-toast-icon {
    position: relative;
    width: 2em;
    height: 2em;
    border: 0.25em solid rgba(0, 0, 0, 0);
    border-radius: 50%;
    border-color: #000;
    font-family: inherit;
    line-height: 2em;
    cursor: default;
    user-select: none;
}

    .spbuk-toast-icon .spbuk-toast-icon-content {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 1.5em;
    }


.spbuk-toast-icon-animation {
    animation: icon-content-animation .5s;
}

.spbuk-toast-icon-border-animation {
    animation: icon-border-animation .5s;
}

@keyframes icon-content-animation {
    0% {
        transform: rotateZ(45deg);
        opacity: 0;
    }

    25% {
        transform: rotateZ(-25deg);
        opacity: 0.4;
    }

    50% {
        transform: rotateZ(15deg);
        opacity: 0.8;
    }

    75% {
        transform: rotateZ(-5deg);
        opacity: 1;
    }

    100% {
        transform: rotateX(0);
        opacity: 1;
    }
}

@keyframes icon-border-animation {
    0% {
        transform: rotateX(100deg);
        opacity: 0;
    }

    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}


.spbuk-toast-error .spbuk-toast-icon {
    border-color: #dc3545;
    color: #dc3545;
}

.spbuk-toast-error .spbuk-toast-timer-bar {
    background-color: #dc3545;
}

.spbuk-toast-error .spbuk-toast-title {
    color: #dc3545;
}


.spbuk-toast-success .spbuk-toast-icon {
    border-color: #28a745;
    color: #28a745;
}

.spbuk-toast-success .spbuk-toast-timer-bar {
    background-color: #28a745;
}

.spbuk-toast-success .spbuk-toast-title {
    color: #28a745;
}


.spbuk-toast-info .spbuk-toast-icon {
    border-color: #17a2b8;
    color: #17a2b8;
}

.spbuk-toast-info .spbuk-toast-timer-bar {
    background-color: #17a2b8;
}

.spbuk-toast-info .spbuk-toast-title {
    color: #17a2b8;
}


.spbuk-toast-warning .spbuk-toast-icon {
    border-color: #ffc107;
    color: #ffc107;
}

.spbuk-toast-warning .spbuk-toast-timer-bar {
    background-color: #ffc107;
}

.spbuk-toast-warning .spbuk-toast-title {
    color: #ffc107;
}
