/* ==========================================================================
   Toast Notification Styles
   ========================================================================== */

/* Toasts drop out from under the bar above them. They used to slide in from the
   right into the bottom right corner, where in the app they landed on the
   native tab bar and under the thumb, covering the part of the page the player
   was just working on.

   -100%, not -150%: the toast starts with its bottom edge exactly on the
   chrome's, so it slides out from under the bar instead of flying over it
   first (#725). */
@keyframes toast-fade-in {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#toast-container {
    position: fixed;
    /* Under the chrome, not over it (#725): a toast at the top edge covered the
       logo and the main nav for its five seconds. `toast()` measures the bars
       that are pinned up there — navbar + info bar, the native top bar in the
       app, the page's tab strip once it has docked — and hands the bottom edge
       over in `--app-toast-top`; the 0.5rem here is the gap below it. The
       fallback is where the docked tab strip sticks (`--sub-tab-sticky-top`),
       plus the little the info bar reaches past it on a wide screen. */
    top: calc(var(--app-toast-top, 6.5rem) + 0.5rem);
    left: 0;
    right: 0;
    z-index: 300;
    display: flex;
    /* Not `column-reverse`: anchored at the top, a second toast belongs below
       the first, growing downwards away from the edge. */
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    position: relative;
    width: 300px;
    max-width: calc(100% - 2rem);
    box-shadow: 0 6px 14px 2px rgba(var(--app-black-rgb), 0.3);
    animation: toast-fade-in 0.3s ease-out;
    pointer-events: auto;
}

/* Tighter than Bootstrap's 0.75rem: a one-line message below the info bar
   should take as little height as it can. */
.toast .toast-body {
    padding: 0.4rem 0.75rem;
}

.toast.error {
    background-color: var(--app-toast-error);
}
