/**
 * Copyright (c) 2021 Peyton Gasink
 * Distributed under MIT License.
 
 * This file contains all the styling for the toasts. It may cause
 * conflicting styles if simultaneously using Bootstrap toasts not generated by
 * Bootstrap Toaster, which is not recommended.
 */

.status-icon {
    font-size: 1.1rem;
}

#toastContainer {
    /*
        Variables dedicated to light and dark theme colors. The light theme ones are only used
        for JavaScript overrides, and are duplicates of Bootstrap's settings.
    */
    --header-color-light: #6c757d;
    --text-color-light: #212529;
    --header-bg-color-light: rgba(255,255,255,.85);
    --body-bg-color-light: rgba(255,255,255,.85);
    --header-color-dark: #f8f9fa;
    --text-color-dark: #f8f9fa;
    --header-bg-color-dark: rgba(30,40,45,.85);
    --body-bg-color-dark: rgba(30,40,45,.85);
    max-height: 100vh;
    /* Override Bootstrap 5's pointer-events:none on .toast-container, so overflow-y: scroll works */
    pointer-events: auto;
    overflow-y: scroll;
    /* Hide scrollbar in Firefox */
    scrollbar-width: none;
    /* Render in front of Bootstrap toasts */
    z-index: 1060;
}

/* Hide scrollbar in all webkit-based browsers. */
#toastContainer::-webkit-scrollbar {
    display: none;
}

#toastContainer .toast {
    margin: 0.8rem;
}

/* Force toast container to top center on mobile. */
@media only screen and (max-width: 576px) {
    #toastContainer {
        width: 100%;
        top: 0 !important;
        bottom: auto !important;
        left: 0 !important;
        transform: none !important;
    }

    #toastContainer .toast {
        margin: 0.8rem auto;
    }
}

@media (prefers-color-scheme: dark){
    .toast, .toast-header {
        color: var(--text-color-dark);
    }

    /* Copy of Bootstrap 5's .btn-close-white */
    .toast-header .btn-close {
        filter: invert(1) grayscale(100%) brightness(200%);
    }

    .toast {
        background-color: var(--body-bg-color-dark);
    }

    .toast-header {
        background-color: var(--header-bg-color-dark);
    }
}
