/* Modern Toastr redesign – place after/to replace toastr.css */

/* Theme tokens */
:root { --toast-blur: 0px; } /* was 10px */
:root {
    --toast-font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;

    --toast-width: clamp(280px, 32vw, 380px);
    --toast-radius: 14px;
    --toast-gap: 10px;
    --toast-padding: 12px 16px 12px 52px;
    /* room for icon */
    --toast-shadow: 0 10px 30px rgba(0, 0, 0, .20);
    --toast-blur: 10px;

    /* Light defaults */
    --toast-fg: #0f172a;
    /* slate-900 */
    --toast-bg: rgba(255, 255, 255, .92);
    --toast-stroke: rgba(15, 23, 42, .10);

    /* Dark tokens */
    --toast-fg-dark: #f8fafc;
    /* slate-50 */
    --toast-bg-dark: rgba(17, 24, 39, .86);
    --toast-stroke-dark: rgba(248, 250, 252, .06);

    /* Accents */
    --toast-accent-info: #0ea5e9;
    /* sky-500 */
    --toast-accent-success: #22c55e;
    /* green-500 */
    --toast-accent-warning: #f59e0b;
    /* amber-500 */
    --toast-accent-error: #ef4444;
    /* red-500 */
    --toast-accent-neutral: #64748b;
    /* slate-500 */

    --toast-icon-size: 22px;
    --toast-progress-height: 3px;
}

/* If you want jQuery fadeIn/fadeOut to handle it */
#toast-container.toast-top-right    > div,
#toast-container.toast-bottom-right > div,
#toast-container.toast-top-left     > div,
#toast-container.toast-bottom-left  > div,
#toast-container.toast-top-center   > div,
#toast-container.toast-bottom-center> div {
  animation: none !important;
}

@media (prefers-color-scheme: dark) {
    :root {
        --toast-bg: var(--toast-bg-dark);
        --toast-fg: var(--toast-fg-dark);
        --toast-stroke: var(--toast-stroke-dark);
    }
}

/* Container */
#toast-container {
    position: fixed;
    z-index: 2147483647;
    /* sit above everything */
    pointer-events: none;
    padding: 12px;
}

/* Base toast */
#toast-container>div {
    font-family: var(--toast-font-family);
    width: var(--toast-width);
    margin: 0 0 var(--toast-gap);
    padding: var(--toast-padding);
    border-radius: var(--toast-radius);
    background: var(--toast-bg);
    color: var(--toast-fg);
    box-shadow: var(--toast-shadow);
    backdrop-filter: blur(var(--toast-blur));
    -webkit-backdrop-filter: blur(var(--toast-blur));
    border: 1px solid var(--toast-stroke);
    position: relative;
    overflow: clip;
    pointer-events: auto;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;

    /* default accent (overridden by type) */
    --toast-accent: var(--toast-accent-neutral);
}

/* Remove legacy icon images */
#toast-container>.toast-info,
#toast-container>.toast-success,
#toast-container>.toast-warning,
#toast-container>.toast-error {
    background-image: none !important;
}

/* Types set accent color */
#toast-container>.toast-info {
    --toast-accent: var(--toast-accent-info);
}

#toast-container>.toast-success {
    --toast-accent: var(--toast-accent-success);
}

#toast-container>.toast-warning {
    --toast-accent: var(--toast-accent-warning);
}

#toast-container>.toast-error {
    --toast-accent: var(--toast-accent-error);
}

/* Left accent bar */
#toast-container>div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast-accent);
    background: linear-gradient(180deg,
            color-mix(in srgb, var(--toast-accent) 85%, transparent),
            var(--toast-accent));
}

/* Icon via mask (modern browsers) */
@supports (-webkit-mask: none) or (mask: none) {
    #toast-container>div::after {
        content: "";
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: var(--toast-icon-size);
        height: var(--toast-icon-size);
        background-color: var(--toast-accent);
        opacity: .95;
        /* info icon default */
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M11 17h2v-6h-2v6zm1-8a1.25 1.25 0 1 0 0-2.5A1.25 1.25 0 0 0 12 9z"/><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z"/></svg>') no-repeat center / contain;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M11 17h2v-6h-2v6zm1-8a1.25 1.25 0 1 0 0-2.5A1.25 1.25 0 0 0 12 9z"/><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z"/></svg>') no-repeat center / contain;
    }

    #toast-container>.toast-success::after {
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') no-repeat center / contain;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') no-repeat center / contain;
    }

    #toast-container>.toast-warning::after {
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M1 21h22L12 2 1 21zm12-3h-2v2h2v-2zm0-8h-2v6h2V10z"/></svg>') no-repeat center / contain;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M1 21h22L12 2 1 21zm12-3h-2v2h2v-2zm0-8h-2v6h2V10z"/></svg>') no-repeat center / contain;
    }

    #toast-container>.toast-error::after {
        -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M12 10.586 16.95 5.636l1.414 1.414L13.414 12l4.95 4.95-1.414 1.414L12 13.414l-4.95 4.95-1.414-1.414L10.586 12 5.636 7.05 7.05 5.636 12 10.586z"/></svg>') no-repeat center / contain;
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23000" viewBox="0 0 24 24"><path d="M12 10.586 16.95 5.636l1.414 1.414L13.414 12l4.95 4.95-1.414 1.414L12 13.414l-4.95 4.95-1.414-1.414L10.586 12 5.636 7.05 7.05 5.636 12 10.586z"/></svg>') no-repeat center / contain;
    }
}

/* Fallback emoji icon if mask unsupported */
@supports not ((-webkit-mask: none) or (mask: none)) {
    #toast-container>.toast-info::after {
        content: "ℹ️";
    }

    #toast-container>.toast-success::after {
        content: "✔️";
    }

    #toast-container>.toast-warning::after {
        content: "⚠️";
    }

    #toast-container>.toast-error::after {
        content: "✖️";
    }

    #toast-container>div::after {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        line-height: 1;
    }
}

/* Title + message */
.toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 28px 2px 0;
}

.toast-message {
    font-size: 0.9rem;
    margin: 0;
    opacity: .95;
    word-wrap: break-word;
}

.toast-message a {
    color: var(--toast-accent);
    text-decoration: underline;
}

.toast-message a:hover {
    opacity: .9;
}

/* Close button */
.toast-close-button,
button.toast-close-button {
    position: absolute;
    right: 8px;
    top: 8px;
    float: none;
    background: transparent;
    border: 0;
    color: inherit;
    opacity: .6;
    font-size: 18px;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    cursor: pointer;
    text-shadow: none;
}

.toast-close-button:hover,
.toast-close-button:focus {
    opacity: 1;
    background: color-mix(in srgb, var(--toast-accent) 16%, transparent);
    outline: none;
}

.toast-close-button::before {
    content: "✕";
    font-weight: 700;
}

/* Progress bar inherits accent */
.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: var(--toast-progress-height);
    background: var(--toast-accent);
    opacity: .7;
}

/* Hover elevate */
#toast-container>div:hover {
    box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
    transform: translateY(-2px);
}

/* Positions + entry animations */
.toast-top-right {
    top: 12px;
    right: 12px;
}

.toast-top-left {
    top: 12px;
    left: 12px;
}

.toast-bottom-right {
    bottom: 12px;
    right: 12px;
}

.toast-bottom-left {
    bottom: 12px;
    left: 12px;
}

.toast-top-center,
.toast-bottom-center,
.toast-top-full-width,
.toast-bottom-full-width {
    left: 0;
    right: 0;
}

#toast-container.toast-top-center>div,
#toast-container.toast-bottom-center>div {
    margin-left: auto;
    margin-right: auto;
    width: var(--toast-width);
}

#toast-container.toast-top-full-width>div,
#toast-container.toast-bottom-full-width>div {
    width: min(96%, 720px);
    margin-left: auto;
    margin-right: auto;
}

@keyframes toast-in-right {
    from {
        transform: translateX(16px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-in-left {
    from {
        transform: translateX(-16px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-in-down {
    from {
        transform: translateY(-12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-in-up {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#toast-container.toast-top-right>div,
#toast-container.toast-bottom-right>div {
    animation: toast-in-right .28s cubic-bezier(.22, 1, .36, 1);
}

#toast-container.toast-top-left>div,
#toast-container.toast-bottom-left>div {
    animation: toast-in-left .28s cubic-bezier(.22, 1, .36, 1);
}

#toast-container.toast-top-center>div {
    animation: toast-in-down .28s cubic-bezier(.22, 1, .36, 1);
}

#toast-container.toast-bottom-center>div {
    animation: toast-in-up .28s cubic-bezier(.22, 1, .36, 1);
}

/* RTL */
#toast-container>div.rtl {
    direction: rtl;
    padding: 12px 52px 12px 16px;
}

#toast-container>div.rtl::after {
    right: 16px;
    left: auto;
}

.rtl .toast-close-button {
    left: 8px;
    right: auto;
}

/* Compact density option: add class "compact" to #toast-container when needed */
#toast-container.compact>div {
    --toast-width: clamp(260px, 28vw, 340px);
    --toast-radius: 10px;
    --toast-padding: 10px 14px 10px 46px;
    --toast-icon-size: 18px;
    font-size: 0.9rem;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    #toast-container>div {
        animation: none !important;
        transform: none !important;
    }

    #toast-container>div:hover {
        transform: none !important;
    }
}

/* Small screens */
@media (max-width: 480px) {
    :root {
        --toast-width: min(92vw, 380px);
    }

    #toast-container {
        padding: 8px;
    }

    #toast-container.toast-top-right,
    #toast-container.toast-top-left,
    #toast-container.toast-bottom-right,
    #toast-container.toast-bottom-left {
        left: 0;
        right: 0;
    }

    #toast-container>div {
        margin-left: auto;
        margin-right: auto;
    }
}