/* ======================================================
   <!-- Toast -->
/* ====================================================== */
@import '@uixkit/core/_global/scss/mixins';
@import '@uixkit/core/_global/scss/functions';
@import '@uixkit/core/_global/scss/variables';

.uix-toasts__wrapper {
    --uix-toast-zindex: 90001;
    --uix-toast-border-radius: 0.375rem;

    --uix-toasts-offset-top: 35px;
    --uix-toasts-offset-bottom: 15px;
    --uix-toasts-offset-bothsides: 15px;
    --uix-toasts-container-gap: 0.5rem;
    --uix-toasts-container-width: 350px;
    --uix-toasts-progress-height: 3px;
    --uix-toasts-progress-bg: rgba(228, 228, 228, 0.6);
    
    

    width: var(--uix-toasts-container-width);
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: var(--uix-toast-zindex);
    pointer-events: none;
    transition: .1s ease-in-out;

    &--bottom-left {
        left: var(--uix-toasts-offset-bothsides);
    }

    &--bottom-right {
        left: auto;
        right: var(--uix-toasts-offset-bothsides);
    }

    &--bottom-center {
        left: 50%;
        transform: translateX(-50%);
    }

    &--top-left {
        left: var(--uix-toasts-offset-bothsides);
        bottom: auto;
        top: var(--uix-toasts-offset-top);
    }

    &--top-right {
        left: auto;
        right: var(--uix-toasts-offset-bothsides);
        top: var(--uix-toasts-offset-top);
    }

    &--top-center {
        left: 50%;
        transform: translateX(-50%);
        top: var(--uix-toasts-offset-top);
    }

    &--vertical-center {
        left: 50%;
        transform: translate(-50%, -50%);
        top: 50%;
        margin-top: 5%;
    }  

    .uix-toasts {
        position: relative;
        width: 100%;
        bottom: var(--uix-toasts-offset-bottom);
        display: flex;
        flex-flow: column-reverse nowrap;


        &::before {
            content: '';
            top: -80px;
            bottom: 0;
            left: -8px;
            right: -8px;
            position: absolute;
            background-color: transparent;
            pointer-events: none;
        }

    }

    .toast-container {
        margin-bottom: var(--uix-toasts-container-gap);

        /* Use clip-path instead of opacity to achieve a fade effect, avoiding the problem of transparency overlay */
        clip-path: inset(0 0 0 0);
        transform: translateY(0);

        /* Rendering of 3D transformations */
        backface-visibility: hidden;
        transform-style: preserve-3d;
        
        /* init animation */
        &.animate-ready {
            pointer-events: none;
            clip-path: inset(0 0 100% 0);
            transform: translateY(10px);
        }

        /* enter animation */
        &.animate-in {
            clip-path: inset(0 0 0 0);
            transform: translateY(0);
        }

        /* exit animation */
        &.hide-start {
            clip-path: inset(0 0 100% 0);
            transform: translateY(-10px);
        }

    }

    /* cascading divs */
    &.uix-toasts__wrapper--cascading {

        .toast-container {
            margin-bottom: 0;
        }

        .uix-toasts {
            &:hover {
                .toast-container {
                    transform: perspective(100px) translateZ(0) !important;
                }
            }
        }
    }



    /* progress */
    .toast-progress {
        position: absolute;
        width: 100%;
        bottom: 0px;
        left: 0px;
        height: var(--uix-toasts-progress-height);
        background: transparent;
        border-radius: 0 0 var(--uix-toast-border-radius) var(--uix-toast-border-radius);
        overflow: hidden;

        .progress-bar {
            background: var(--uix-toasts-progress-bg);
            width: 100%;
            height: 100%;
            transition: all .1s;
        }
    }



}
  
/* Bootstrap toast here */
.toast-container {
    width: 100%;
    height: auto;
    position: relative;
    transition: all .25s;
    pointer-events: auto;

    [data-close] {
        background: none;
    }

    [data-close]:focus {
        box-shadow: none;
    }

    [data-close] svg {
        vertical-align: top;

        path {
            transition: .3s ease-in-out;
        }
    }

    [data-close]:hover svg path {
        fill: #f00;
    }

    &.hide-start {
        opacity: 0;
    }
    
    &.hide-end {
        display: none;
    }


}