/*!
 * Toastify js 1.7.0
 * https://github.com/apvarun/toastify-js
 * @license MIT licensed
 *
 * Copyright (C) 2018 Varun A P
 */

/* Mosaic Toaster's toast, drawn over Toastify's markup.
 *
 * toastHelper.js picks the tone by passing a background colour, which Toastify writes as an
 * inline `background`. That script is behaviour and stays as it is, so the tone is read back from
 * the inline style here: `!important` replaces the colour with Mosaic's surface, and the
 * attribute selectors map each helper's colour to Mosaic's tone and glyph (lucide, as Mosaic's
 * Toaster uses). An unknown colour falls back to info. */
.toastify {
    --toast-tone: var(--mos-color-ink-muted);
    --toast-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 16v-4'/><path d='M12 8h.01'/></svg>");
    display: flex;
    align-items: center;
    gap: var(--mos-space-sm);
    box-sizing: border-box;
    max-width: min(26rem, calc(100vw - var(--mos-space-xl)));
    padding: var(--mos-space-sm) var(--mos-space-md);
    border-radius: var(--mos-radius-lg);
    background: var(--mos-color-surface-2) !important;
    box-shadow: var(--mos-shadow-lg);
    color: var(--mos-color-ink);
    font-family: var(--mos-font-sans);
    font-size: var(--mos-text-md-size);
    font-weight: var(--mos-weight-medium);
    line-height: var(--mos-text-md-leading);
    overflow-wrap: break-word;
    position: fixed;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    cursor: pointer;
    text-decoration: none;
    z-index: 2147483647;
}

/* showSuccessToast #6fba6c, showWarningToast #ff8f34, showErrorToast #da4444 */
.toastify[style*="111, 186, 108"] {
    --toast-tone: var(--mos-color-success);
    --toast-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m9 12 2 2 4-4'/></svg>");
}
.toastify[style*="255, 143, 52"] {
    --toast-tone: var(--mos-color-warning);
    --toast-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/><path d='M12 9v4'/><path d='M12 17h.01'/></svg>");
}
.toastify[style*="218, 68, 68"] {
    --toast-tone: var(--mos-color-danger);
    --toast-icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='m15 9-6 6'/><path d='m9 9 6 6'/></svg>");
}

.toastify::before {
    content: "";
    flex: none;
    width: 1rem;
    height: 1rem;
    background-color: var(--toast-tone);
    -webkit-mask: var(--toast-icon) center / contain no-repeat;
    mask: var(--toast-icon) center / contain no-repeat;
}

.toastify.on {
    opacity: 1;
}

/* Toastify's close is a span holding "✖"; drawn as Mosaic's ghost icon button with its cross. */
.toast-close {
    position: relative;
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin-inline-end: calc(var(--mos-space-xs) * -1);
    padding: 0;
    border-radius: var(--mos-radius-pill);
    color: var(--mos-color-ink-muted);
    font-size: 0;
    opacity: 1;
    transition: background-color var(--mos-duration-fast) var(--mos-ease-in-out);
}
.toast-close:hover {
    background-color: var(--mos-color-surface-3);
}
.toast-close::before,
.toast-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.625rem;
    height: 1.5px;
    background-color: currentColor;
}
.toast-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}
.toast-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.toastify-right {
    right: var(--mos-space-md);
}

.toastify-left {
    left: 15px;
}

.toastify-top {
    top: -150px;
}

.toastify-bottom {
    bottom: -150px;
}

.toastify-rounded {
    border-radius: 25px;
}

.toastify-avatar {
    width: 1.5em;
    height: 1.5em;
    margin: 0 5px;
    border-radius: 2px;
}

.toastify-center {
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    max-width: fit-content;
}

@media only screen and (max-width: 360px) {
    .toastify-right, .toastify-left {
        margin-left: auto;
        margin-right: auto;
        left: 0;
        right: 0;
        max-width: fit-content;
    }
}
