/*
 * © 2026 Marco Antônio — criador e autor deste software. Todos os direitos reservados.
 * Software proprietário: proibido copiar, distribuir, revender ou modificar sem
 * autorização por escrito do autor. Protegido pela Lei 9.609/98 (Lei do Software).
 */
/* static/css/notificacoes.css */

#noc-toast-container {
    position: fixed;
    /* Posiciona na parte inferior */
    bottom: 24px;
    /* Afasta 100px da margem direita para não cobrir os botões flutuantes */
    right: 100px;
    z-index: 999999;
    display: flex;
    /* Faz os novos alertas empilharem de baixo para cima */
    flex-direction: column-reverse;
    gap: 6px;
    pointer-events: none; /* Para não bloquear cliques no mapa atrás dele */
}

.noc-toast {
    width: 290px;
    background: rgba(20, 22, 26, 0.94);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    padding: 8px 12px 9px 15px;
    color: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,0.45);
    /* Animação vindo da direita */
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    will-change: transform, opacity;
    position: relative;
    overflow: hidden;
    pointer-events: auto; /* Permite clicar na notificação se necessário */
}

.noc-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* =======================================
   BORDA DE DESTAQUE LATERAL
======================================= */
.noc-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
}

/* =======================================
   BARRA DE PROGRESSO DE TEMPO (NOVIDADE)
======================================= */
.noc-toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform-origin: left;
    /* A animação usará a variável CSS definida pelo JS, fallback para 3s */
    animation: shrinkToast var(--toast-duration, 3s) linear forwards;
}

@keyframes shrinkToast {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* =======================================
   CORES POR SEVERIDADE E EFEITOS
======================================= */

/* SUCESSO */
.noc-toast.success::before { background-color: var(--neon-green, #28a745); box-shadow: 0 0 10px var(--neon-green, #28a745); }
.noc-toast.success::after { background-color: var(--neon-green, #28a745); }

/* AVISO */
.noc-toast.warning::before { background-color: #fdcb6e; box-shadow: 0 0 10px #fdcb6e; }
.noc-toast.warning::after { background-color: #fdcb6e; }

/* ERRO CRÍTICO (Adicionado efeito de Pulso de Emergência) */
.noc-toast.error { animation: toast-pulse-red 2s infinite; }
.noc-toast.error::before { background-color: var(--neon-red, #dc3545); box-shadow: 0 0 10px var(--neon-red, #dc3545); }
.noc-toast.error::after { background-color: var(--neon-red, #dc3545); }

@keyframes toast-pulse-red {
    0% { box-shadow: 0 8px 22px rgba(0,0,0,0.45), 0 0 0 0 rgba(220, 53, 69, 0.35); }
    70% { box-shadow: 0 8px 22px rgba(0,0,0,0.45), 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 8px 22px rgba(0,0,0,0.45), 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* =======================================
   TIPOGRAFIA
======================================= */
.noc-toast-title {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.noc-toast.error .noc-toast-title { color: var(--neon-red, #dc3545); }
.noc-toast.success .noc-toast-title { color: var(--neon-green, #28a745); }
.noc-toast.warning .noc-toast-title { color: #fdcb6e; }

.noc-toast-message {
    margin-top: 2px;
    font-size: 10px;
    color: rgba(255,255,255,0.65);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =======================================
   TRATAMENTO MOBILE APRIMORADO
======================================= */
@media screen and (max-width: 768px) {
    #noc-toast-container {
        bottom: auto;
        top: 20px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: column;
        width: 90vw;
        align-items: center;
    }
    .noc-toast {
        width: 100%;
        max-width: 350px;
    }
}