@keyframes notyf-fade-in {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notyf-fade-out {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.notyf {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    color: var(--text-950);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    pointer-events: none;
    box-sizing: border-box;
    padding: 25px;

    &__wrapper {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        pointer-events: none;
        gap: var(--space-sm);
    }

    &__toast {
        backdrop-filter: blur(10px);
        display: flex;
        align-items: center;
        gap: var(--space-md);
        pointer-events: auto;
        position: relative;
        animation: notyf-fade-in 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
        max-width: 340px;
        margin-bottom: 12px;
        padding: var(--space-md) var(--space-md);
        border-radius: var(--border1);
        font-weight: 500;
        font-size: var(--p);
        line-height: 1.5;
        overflow: hidden;
        z-index: 9999;

        &::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.1);
            z-index: -1;
        }

        &--disappear {
            animation: notyf-fade-out 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
        }

        &--dismissible {
            .notyf__wrapper {
                padding-right: 30px;
            }
        }

        &.notyf__toast--success {
            color: var(--text);
            border: 1px solid var(--success-light);
            background: rgba(51, 134, 65, 0.345) !important;

            .notyf__icon {
                background-color: var(--success-light);
            }
        }

        &.notyf__toast--error {
            background: rgba(241, 73, 73, 0.345) !important;
            color: var(--text);
            border: 1px solid var(--error-light);

            .notyf__icon {
                background-color: var(--error-light);
            }
        }

        &.notyf__toast--warning {
            background: rgba(255, 192, 70, 0.345) !important;
            color: var(--text);
            border: 1px solid var(--warning-light);

            .notyf__icon {
                background-color: var(--warning-light);
            }
        }

        &.notyf__toast--info {
            background: rgba(55, 145, 145, 0.345) !important;
            color: var(--text);
            border: 1px solid var(--info-light);

            .notyf__icon {
                background-color: var(--info-light);
            }
        }
    }

    &__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        min-width: 24px;
        border-radius: 50%;
        position: relative;

        &--success {
            &:after {
                content: "";
                position: absolute;
                width: 9px;
                height: 5px;
                border-left: 2px solid var(--success);
                border-bottom: 2px solid var(--success);
                transform: rotate(-45deg);
                top: 9px;
                left: 7px;
            }
        }

        &--error {

            &:after,
            &:before {
                content: "";
                position: absolute;
                width: 12px;
                height: 2px;
                background-color: var(--error);
                border-radius: 2px;
                top: 50%;
                left: 50%;
            }

            &:after {
                transform: translate(-50%, -50%) rotate(45deg);
            }

            &:before {
                transform: translate(-50%, -50%) rotate(-45deg);
            }
        }

        &--warning {
            &:after {
                content: "!";
                color: var(--error);
                font-weight: 700;
                font-size: 14px;
            }
        }

        &--info {
            &:after {
                content: "i";
                color: var(--info);
                font-weight: 700;
                font-size: 14px;
                position: relative;
                top: -1px;
            }
        }
    }

    &__message {
        flex: 1;
        font-weight: 500;
    }

    &__dismiss {
        position: absolute;
        top: 10px;
        right: 10px;
        height: 16px;
        width: 16px;
        z-index: 1;

        &-btn {
            background-color: transparent;
            border: none;
            cursor: pointer;
            outline: none;
            opacity: 0.4;
            transition: opacity 0.2s ease;
            height: 100%;
            width: 100%;
            position: relative;
            pointer-events: auto;

            &:after,
            &:before {
                content: "";
                position: absolute;
                height: 12px;
                width: 2px;
                border-radius: 2px;
                background-color: var(--text-500);
                left: 50%;
                top: 50%;
            }

            &:after {
                transform: translate(-50%, -50%) rotate(-45deg);
            }

            &:before {
                transform: translate(-50%, -50%) rotate(45deg);
            }

            &:hover {
                opacity: 0.8;
            }
        }
    }
}

/* Small screens */
@media only screen and (max-width: 480px) {
    .notyf {
        padding: 10px;

        &__toast {
            max-width: 100%;
            width: 100%;
            margin: 0 auto 10px;
            padding: 12px 14px;
        }

        &__dismiss {
            top: 8px;
            right: 8px;
        }
    }
}