/**
 * 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;
}

.toast {
    /* Ported back from Bootstrap 5's toast styling */
    width: 350px;
}

#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;
    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, .toast-header .close {
        color: var(--text-color-dark);
    }

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

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

/* Styles borrowed from Bootstrap 5 for backport */

.top-0 {
  top: 0 !important;
}

.top-50 {
  top: 50% !important;
}

.bottom-0 {
  bottom: 0 !important;
}

.left-0 {
  left: 0 !important;
}

.left-50 {
  left: 50% !important;
}

.right-0 {
  right: 0 !important;
}

.translate-middle {
  transform: translate(-50%, -50%) !important;
}

.translate-middle-x {
  transform: translateX(-50%) !important;
}

.translate-middle-y {
  transform: translateY(-50%) !important;
}
