/*los flashes son mensajes que tira flask con la función flash(message, category). 
estos estilos los hacen aparecen como notificaciones*/

#flashes {
    position: fixed;
    top: 20px;
    left: calc(50% + (var(--sidebar-width) + var(--content-gap)) / 2);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: transparent;
    z-index: 30;
}
[class*="flash-"] {
    position: relative;
    visibility: hidden;
    width: 500px;
    padding: 10px;
    display: flex;
    border-radius: 2px;
    box-shadow: #777777c5 0px 0px 3px 0px;
    background-color: white;
    color: #242424;
    height: 50px;
    align-items: center;
    transform: translateY(-20vh);
}
[class*="flash-"] .close {
    cursor: pointer;
    background-color: #11466f;
    position: absolute;
    mask: url(/static/images/close.svg) no-repeat center;
    mask-size: 80%;
    height: 30px;
    width: 30px;
    top: 50%;
    left: 95%;
    transform: translate(-50%, -50%);
    transition: filter linear 100ms;

    &:active {
        filter: brightness(0.9);
    }
}
[class*="flash-"]::after {
    position: absolute;
    left: 0px;
    content: "";
    width: 0%;
    height: 5px;
    background-color: #11466f;
    top: 100%;
    transform: translateY(-100%);
    z-index: 20;
}
[class*="flash-"]:not(.flash-important).flash-animation::after {
    animation: flash-bar 4s linear forwards;
}
.flash-success {
    background-color: rgb(61, 207, 61);
    color: #fff;
    .close {
        background-color: #fff;
    }
}
.flash-success.flash-animation::after {
    background-color: #ffffff;
}
.flash-important {
    font-weight: bold;
}
.flash-error {
    background-color: #ff2d2d;
    color: #fff;
    .close {
        background-color: #fff;
    }
}
.flash-error.flash-animation::after {
    background-color: #ffffff;
}

[class*="flash-"].flash-animation {
    visibility: visible;
    animation: flash 200ms ease-out forwards;
}
.flash-leave {
    animation: flash-leave 400ms ease-out forwards;
}
@keyframes flash-leave {
    0% {
        transform: translateY(0vh);
    }
    100% {
        transform: translateY(-40vh);
    }
}
@keyframes flash-bar {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}
@keyframes flash {
    0% {
        opacity: 0;
        transform: translateY(-40vh);
    }
    75% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
        transform: translateY(0vh);
    }
}

@media (max-width:850px) {
    #flashes {
        left: 50%;
    }
    [class*="flash-"] {
        width: 80vw;
    }
}