/* ==========================================================================
   Modern toast notifications (overrides toastr.min.css)
   Load AFTER toastr.min.css
   ========================================================================== */

#toast-container {
    --toast-bg: #111111;
    --toast-text: #ffffff;
    --toast-muted: #a1a1aa;
    --toast-border: rgba(255, 255, 255, 0.08);
    --toast-success: #22c55e;
    --toast-error: #ef4444;
    --toast-warning: #f59e0b;
    --toast-info: #3b82f6;
    pointer-events: none;
}

#toast-container.toast-bottom-right {
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* ---- Card ---- */
#toast-container > div.toast {
    --toast-accent: var(--toast-info);
    position: relative;
    width: 360px;
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 14px 40px 14px 60px;
    border: 1px solid var(--toast-border);
    border-radius: 14px;
    background-color: var(--toast-bg);
    background-image: none;
    color: var(--toast-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    opacity: 1;
    overflow: hidden;
    pointer-events: auto;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 12px 32px -8px rgba(0, 0, 0, 0.45);
    animation: toastSlideIn 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

#toast-container > div.toast:hover {
    opacity: 1;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.2),
        0 16px 40px -8px rgba(0, 0, 0, 0.55);
    cursor: default;
}

/* Accent strip on the left edge */
#toast-container > div.toast::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast-accent);
}

/* Icon badge */
#toast-container > div.toast::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    border-radius: 50%;
    background-color: var(--toast-accent);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--toast-accent) 22%, transparent);
}

/* ---- Types ---- */
#toast-container > div.toast-success {
    --toast-accent: var(--toast-success);
}
#toast-container > div.toast-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

#toast-container > div.toast-error {
    --toast-accent: var(--toast-error);
}
#toast-container > div.toast-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E");
}

#toast-container > div.toast-warning {
    --toast-accent: var(--toast-warning);
}
#toast-container > div.toast-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='7' x2='12' y2='13'/%3E%3Cline x1='12' y1='17.5' x2='12' y2='17.5'/%3E%3C/svg%3E");
}

#toast-container > div.toast-info {
    --toast-accent: var(--toast-info);
}
#toast-container > div.toast-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='11' x2='12' y2='17'/%3E%3Cline x1='12' y1='6.5' x2='12' y2='6.5'/%3E%3C/svg%3E");
}

/* ---- Text ---- */
#toast-container > div.toast .toast-title {
    color: var(--toast-text);
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

#toast-container > div.toast .toast-message {
    color: var(--toast-text);
    font-weight: 500;
    word-wrap: break-word;
}

#toast-container > div.toast .toast-title + .toast-message {
    color: var(--toast-muted);
    font-weight: 400;
}

#toast-container > div.toast .toast-message a,
#toast-container > div.toast .toast-message label {
    color: var(--toast-accent);
}

/* ---- Close button ---- */
#toast-container > div.toast .toast-close-button {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 26px;
    height: 26px;
    margin-top: -13px;
    float: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--toast-muted);
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    text-shadow: none;
    opacity: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#toast-container > div.toast .toast-close-button:hover,
#toast-container > div.toast .toast-close-button:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--toast-text);
    opacity: 1;
    outline: none;
}

/* ---- Progress bar ---- */
#toast-container > div.toast .toast-progress {
    left: 4px;
    height: 3px;
    background-color: var(--toast-accent);
    opacity: 0.6;
}

/* ---- Animation ---- */
@keyframes toastSlideIn {
    from {
        transform: translateX(calc(100% + 24px));
    }
    to {
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    #toast-container > div.toast {
        animation: none;
    }
}

/* ---- Mobile ---- */
@media (max-width: 575.98px) {
    #toast-container.toast-bottom-right {
        right: 16px;
        left: 16px;
        bottom: 16px;
        align-items: stretch;
    }

    #toast-container > div.toast {
        width: 100%;
        max-width: none;
    }
}
