/* Toasts (toast_controller.js) - structure only. The colors come from the bundle:
   --toast-success / --toast-error / --toast-warning / --toast-info (+ -text), see toast-user.css.
   Optional per bundle: --toast-background, --toast-foreground, --toast-border, --toast-icon,
   --toast-progress (default: solid type color, white text, no border, black progress bar). */

.app-toasts {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: min(300px, calc(100vw - 24px));
    pointer-events: none;
}

.app-toast {
    --toast-color: var(--toast-info, #0077b6);
    --toast-text: var(--toast-info-text, #fff);
    /* look of the previous toastr toasts: 300px, icon left, 80 % opacity (100 % on hover) */
    position: relative;
    overflow: hidden;
    padding: 15px 30px 15px 50px;
    border-radius: var(--toast-radius, 3px);
    border-left: var(--toast-border, 0);
    background: var(--toast-background, var(--toast-color));
    color: var(--toast-foreground, var(--toast-text));
    box-shadow: 0 0 12px #999;
    line-height: 1.35;
    pointer-events: auto;
    opacity: 0.8;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
    animation: app-toast-in 0.3s ease;
}
.app-toast:hover { opacity: 1; box-shadow: 0 0 12px #000; }
.app-toast.is-hiding { opacity: 0; transform: translateX(24px); }

/* type icon (bootstrap-icons glyphs; codepoints from bootstrap-icons.json) */
.app-toast::before {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-family: bootstrap-icons !important;
    font-size: 22px;
    color: var(--toast-icon, currentColor);
    line-height: 1;
    content: "\f431"; /* bi-info-circle */
}
.app-toast-success::before { content: "\f26b"; } /* bi-check-circle */
.app-toast-error::before   { content: "\f623"; } /* bi-x-circle */
.app-toast-warning::before { content: "\f33b"; } /* bi-exclamation-triangle */

.app-toast-success { --toast-color: var(--toast-success, #4f772d); --toast-text: var(--toast-success-text, #fff); }
.app-toast-error   { --toast-color: var(--toast-error, #c1121f);   --toast-text: var(--toast-error-text, #fff); }
.app-toast-warning { --toast-color: var(--toast-warning, #d95f02); --toast-text: var(--toast-warning-text, #fff); }
.app-toast-info    { --toast-color: var(--toast-info, #0077b6);    --toast-text: var(--toast-info-text, #fff); }

.app-toast-title { margin-bottom: 2px; font-weight: 700; }
.app-toast-message { overflow-wrap: anywhere; }
.app-toast-message a { color: inherit; font-weight: bold; text-decoration: underline; }
.app-toast-message a:hover { color: #ccc; }

.app-toast-close {
    position: absolute;
    top: 4px;
    right: 8px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    text-shadow: 0 1px 0 #fff;
    cursor: pointer;
}
.app-toast-close:hover, .app-toast-close:focus-visible { color: #000; opacity: 0.4; outline: none; }

.app-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    background: var(--toast-progress, #000);
    opacity: 0.4;
    transform-origin: left;
}

@keyframes app-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes app-toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast.is-hiding { transition: none; animation: none; }
}
