﻿/* GlitchyToast (glitchytoast.js): full-width messages stacked at the top of the window */

/* the stack: fixed to the top; toasts inside are in normal flow, so they stack themselves. Toasts sliding out to the right
   are clipped here instead of widening the page */
.glitchy-toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    overflow: hidden;
}

.glitchy-toast-full-width {
    position: relative;
    width: 100%;
    min-height: 75px;
    box-sizing: border-box;
    padding: 0 50px 0 20px; /* room on the right for the close button */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-width: 2px;
    border-style: solid;
    overflow: hidden;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out, height 0.3s ease-in-out;
}

/* closing: slide out to the right by the toast's own width (always fully out of the window), then fold its space away */
.glitchy-toast-full-width.glitchy-toast-closing {
    transform: translateX(100%);
    opacity: 0;
}

.glitchy-toast-full-width.glitchy-toast-folding {
    min-height: 0;
    border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
    .glitchy-toast-full-width { transition: none; }
}

.glitchy-toast-success { background-color: green; border-color: darkgreen; }
.glitchy-toast-error { background-color: red; border-color: orangered; }
.glitchy-toast-warning { background-color: darkorange; border-color: orange; }

.glitchy-toast-message-error,
.glitchy-toast-message-success,
.glitchy-toast-message-warning {
    font-size: 16px;
    padding: 0.5rem 0 0.5rem 20px;
    text-align: center;
}

.glitchy-toast-control-error,
.glitchy-toast-control-success,
.glitchy-toast-control-warning {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    color: white;
    font: inherit;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.glitchy-toast-control-error { background-color: darkred; }
.glitchy-toast-control-success { background-color: darkgreen; }
.glitchy-toast-control-warning { background-color: orange; }

.glitchy-toast-control-error:hover,
.glitchy-toast-control-success:hover,
.glitchy-toast-control-warning:hover {
    opacity: 0.9;
}
