/**
 * 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.
 */

.toast{
    font-size: 0.9em;
    opacity: 0.96;
    border: 1px solid #5482AC;
    box-shadow: 0.4rem 0.4rem 0.4rem rgba(0,0,0,.35);
}

.toast .loader{
    display:block;
    width: 1.5em;
    height: 1.5em;
}

.status-icon {
    font-size: 1.3rem;
}

.toast-header{
    border:0 !important;
    border-radius: 0em 1em 0em 0em;
    font-size: 1.1em;
}

.toast-header .text-danger{
    /* We already style danger text so over-ride */
    background: none;
    padding-left: 0;
    margin-bottom: 0;
}


.toast-body{
    padding-top: 0.2em;
}

.text-success{
    color: #95FFC3;
}

#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: #FFFFFF;
    --text-color-light: #FFFFFF;
    --header-bg-color-light: #003362;
    --body-bg-color-light: #003362;

    --header-color-dark: #FFFFFF;
    --text-color-dark: #FFFFFF;
    --header-bg-color-dark: #003362;
    --body-bg-color-dark: #003362;
    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;
    /*margin-top: 7em;*/ /* desktop margin to drop under header */
}

/* Hide scrollbar in all webkit-based browsers. */
#toastContainer::-webkit-scrollbar {
    display: none;
}

#toastContainer .toast {
    margin: 0.8rem;
    border-radius: 0em 1em 0em 1em;
}

/* 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;
        /*margin-top: 5em;*/ /* mobile margin to drop under header */
    }

    #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);
    }
}
