/* InduxToasts */

@layer utilities {

    :where(.toast-container) {
        position: fixed;
        bottom: 3vw;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        flex-direction: column-reverse;
        align-items: center;
        gap: calc(var(--spacing, 0.25rem) * 2);
        z-index: 100;
    }

    :where(.toast) {
        display: flex;
        max-width: 90vw;
        background-color: var(--color-popover-surface, oklch(100% 0 0));
        border: 1px solid var(--color-line, oklch(48.3% 0.006422 17.4 / 0.15));
        border-radius: calc(var(--radius, 0.5rem) * 2);
        box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
        overflow: hidden;
        opacity: 0;
        transform: translateY(1rem);
        transition:
            opacity 0.2s ease-out,
            transform 0.2s ease-out,
            height 0.2s ease-out,
            margin 0.2s ease-out,
            padding 0.2s ease-out;
    
        /* Content */
        :where(.toast-content) {
            display: flex;
            align-items: center;
            padding: 0.375rem 0.75rem;
            color: inherit;

            :where([x-icon]:first-child) {
                margin-right: 1ch
            }
        }
    
        /* Dismiss button */
        :where(.toast-dismiss-button) {
            position: relative;
            border-inline-start: 1px solid color-mix(in oklch, var(--color-content-stark, oklch(16.6% 0.026 267)) 20%, transparent);
            border-radius: 0;

            /* Icon */
            &::after {
                content: "";
                position: absolute;
                top: 50%;
                left: 50%;
                width: 50%;
                height: 50%;
                background-color: var(--color-field-inverse, oklch(16.6% 0.026 267));
                mask-image: var(--icon-toast-dismiss, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E"));
                mask-repeat: no-repeat;
                mask-size: 100% 100%;
                transform-origin: center;
                transform: translateX(-50%) translateY(-50%)
            }
        }
    }

    /* Brand, accent, positive, negative utility class overrides (see Utilities) */
    :where(.toast.brand, .toast.accent, .toast.positive, .toast.negative) {
        color: var(--color-field-inverse, oklch(16.6% 0.026 267));
        background-color: var(--color-field-surface, oklch(91.79% 0.0029 264.26));

        :where(.toast-dismiss-button) {
            border-inline-start: 1px solid color-mix(in oklch, var(--color-field-inverse, oklch(16.6% 0.026 267)) 20%, transparent);
        }
    }

    /* Entry animation */
    :where(.toast-entry) {
        opacity: 1;
        transform: translateY(0);
    }

    /* Exit animation */
    :where(.toast-exit) {
        opacity: 0;
        transform: translateY(1rem)
    }
}