/* =========================================================
   Alertas — estilo card (barra lateral + ícone)
   ========================================================= */

.glass-note-stack {
    --ga-card-bg: #ffffff;
    --ga-title: #111827;
    --ga-subtitle: #909092;
    --ga-close: #c3c2c7;
    --ga-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
    --ga-success: #49d761;
    --ga-info: #3286e9;
    --ga-warning: #fdc220;
    --ga-error: #e5484d;
    --ga-confirm: #909092;
    --ga-radius: 3px;

    position: fixed;
    top: 1.35rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: min(720px, calc(100vw - 2rem));
    pointer-events: none;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body.dark-mode .glass-note-stack {
    --ga-card-bg: #1f2937;
    --ga-title: #f9fafb;
    --ga-subtitle: #9ca3af;
    --ga-close: #6b7280;
    --ga-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --ga-confirm: #9ca3af;
}

.glass-note-stack .notification {
    pointer-events: auto;
    width: 100%;
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
    will-change: transform, opacity;
}

.glass-note-stack .notification__box {
    position: relative;
    width: 100%;
    min-height: 100px;
    background-color: var(--ga-card-bg);
    padding: 16px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
    border-left: 5px solid var(--ga-info);
    border-radius: var(--ga-radius);
    box-shadow: var(--ga-shadow);
    animation: glassNoteIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
}

.glass-note-stack .notification--out .notification__box {
    animation: glassNoteOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ---- Cores por nível ---- */
.glass-note-stack .notification--success .notification__box {
    border-left-color: var(--ga-success);
}
.glass-note-stack .notification--info .notification__box {
    border-left-color: var(--ga-info);
}
.glass-note-stack .notification--warning .notification__box {
    border-left-color: var(--ga-warning);
}
.glass-note-stack .notification--error .notification__box {
    border-left-color: var(--ga-error);
}
.glass-note-stack .notification--neutral .notification__box {
    border-left-color: var(--ga-confirm);
}

/* Confirmação / exclusão */
.glass-note-stack .notification--confirm .notification__box,
.glass-note-stack .notification--delete .notification__box,
.glass-note-stack .notification--confirm.is-danger .notification__box,
.glass-note-stack .notification--delete.is-danger .notification__box {
    border-left-color: var(--ga-confirm);
}

/* Ícone */
.glass-note-stack .notification__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow: none;
    align-self: center;
}

.glass-note-stack .notification__icon i,
.glass-note-stack .notification__icon svg {
    font-size: 28px;
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.glass-note-stack .notification--success .notification__icon { color: var(--ga-success); }
.glass-note-stack .notification--info .notification__icon { color: var(--ga-info); }
.glass-note-stack .notification--warning .notification__icon { color: var(--ga-warning); }
.glass-note-stack .notification--error .notification__icon { color: var(--ga-error); }
.glass-note-stack .notification--neutral .notification__icon { color: var(--ga-confirm); }
.glass-note-stack .notification--confirm .notification__icon,
.glass-note-stack .notification--delete .notification__icon { color: var(--ga-confirm); }

.glass-note-stack .notification--success .notification__icon i,
.glass-note-stack .notification--success .notification__icon svg { color: var(--ga-success); }
.glass-note-stack .notification--info .notification__icon i,
.glass-note-stack .notification--info .notification__icon svg { color: var(--ga-info); }
.glass-note-stack .notification--warning .notification__icon i,
.glass-note-stack .notification--warning .notification__icon svg { color: var(--ga-warning); }
.glass-note-stack .notification--error .notification__icon i,
.glass-note-stack .notification--error .notification__icon svg { color: var(--ga-error); }
.glass-note-stack .notification--confirm .notification__icon i,
.glass-note-stack .notification--delete .notification__icon i,
.glass-note-stack .notification--confirm .notification__icon svg,
.glass-note-stack .notification--delete .notification__icon svg {
    color: var(--ga-confirm);
}

/* Conteúdo (subject) */
.glass-note-stack .notification__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-right: 12px;
}

.glass-note-stack .notification__text-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ga-title);
    letter-spacing: 0;
    text-transform: none;
    word-break: break-word;
}

.glass-note-stack .notification__text-subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--ga-subtitle);
    letter-spacing: 0;
    word-break: break-word;
}

.glass-note-stack .notification__text-subtitle b,
.glass-note-stack .notification__text-subtitle strong {
    color: var(--ga-title);
    font-weight: 600;
}

/* Fechar (X) */
.glass-note-stack .notification__close-btn {
    position: static;
    flex-shrink: 0;
    width: auto;
    height: auto;
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--ga-close);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease, transform 0.15s ease;
}

.glass-note-stack .notification__close-btn:hover {
    color: #8b8a90;
    background: transparent;
    transform: scale(1.05);
}

.glass-note-stack .notification__close-btn i,
.glass-note-stack .notification__close-btn svg {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* Botões de confirmação (Cancelar / Excluir) */
.glass-note-stack .notification__btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 8px;
    min-width: 0;
    margin: 0 0 0 auto;
    padding: 0;
    border: none;
    background: transparent;
    overflow: visible;
}

.glass-note-stack .notification__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--ga-radius);
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.glass-note-stack .notification__btn + .notification__btn {
    border-top: none;
}

.glass-note-stack .notification__btn:not(.is-primary):hover {
    background: #f3f4f6;
    color: #374151;
}

/* Confirmar / Excluir — texto vermelho */
.glass-note-stack .notification--confirm .notification__btn.is-primary,
.glass-note-stack .notification--delete .notification__btn.is-primary,
.glass-note-stack .notification.is-danger .notification__btn.is-primary,
.glass-note-stack .notification__btn.is-primary {
    background: #fff;
    border-color: color-mix(in srgb, var(--vermelho, #d65b5b) 35%, #e5e7eb);
    color: var(--vermelho, #d65b5b);
    font-weight: 700;
}

.glass-note-stack .notification--confirm .notification__btn.is-primary:hover,
.glass-note-stack .notification--delete .notification__btn.is-primary:hover,
.glass-note-stack .notification.is-danger .notification__btn.is-primary:hover,
.glass-note-stack .notification__btn.is-primary:hover {
    background: color-mix(in srgb, var(--vermelho, #d65b5b) 8%, #fff);
    color: var(--vermelho, #b91c1c);
}

body.dark-mode .glass-note-stack .notification__btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #9ca3af;
}

body.dark-mode .glass-note-stack .notification__btn.is-primary {
    background: rgba(214, 91, 91, 0.12);
    border-color: rgba(214, 91, 91, 0.35);
    color: var(--vermelho, #d65b5b);
}

/* Barra de progresso discreta */
.glass-note-stack .notification__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    background: color-mix(in srgb, var(--ga-info) 55%, transparent);
    transform-origin: left center;
    animation: glassProgressLinear linear forwards;
}

.glass-note-stack .notification--success .notification__progress {
    background: color-mix(in srgb, var(--ga-success) 55%, transparent);
}
.glass-note-stack .notification--warning .notification__progress {
    background: color-mix(in srgb, var(--ga-warning) 55%, transparent);
}
.glass-note-stack .notification--error .notification__progress {
    background: color-mix(in srgb, var(--ga-error) 55%, transparent);
}
.glass-note-stack .notification--confirm .notification__progress,
.glass-note-stack .notification--delete .notification__progress {
    background: color-mix(in srgb, var(--ga-confirm) 55%, transparent);
}

.glass-note-stack .notification__box:hover .notification__progress {
    animation-play-state: paused;
}

@keyframes glassProgressLinear {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@keyframes glassNoteIn {
    0% {
        opacity: 0;
        transform: translateY(-16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glassNoteOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@media (max-width: 640px) {
    .glass-note-stack {
        top: 0.75rem;
        width: calc(100vw - 1.25rem);
    }

    .glass-note-stack .notification__box {
        min-height: 88px;
        padding: 12px 14px;
        gap: 12px;
    }

    .glass-note-stack .notification__icon i,
    .glass-note-stack .notification__icon svg,
    .glass-note-stack .notification__close-btn i,
    .glass-note-stack .notification__close-btn svg {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

    .glass-note-stack .notification__text-title {
        font-size: 1rem;
    }

    .glass-note-stack .notification__text-subtitle {
        font-size: 0.85rem;
    }

    .glass-note-stack .notification__btns {
        flex-direction: column;
        align-items: stretch;
    }
}
