/* ================================================================
   Toast Component — Glass Panel
   Componente de notificação customizado para o projeto Caverna da TI
   ================================================================ */

   .toast-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 40px);
    pointer-events: none;
}

/* ── Toast base ─────────────────────────────────────────────── */
.toast-notification {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 40px 16px 18px;
    border-radius: var(--radius-lg, 14px);
    border: 1px solid;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-notification.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(30px) scale(0.96);
    }
}

/* ── Badge de ícone ─────────────────────────────────────────── */
.toast-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-badge svg {
    width: 18px;
    height: 18px;
}

/* ── Conteúdo ───────────────────────────────────────────────── */
.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.toast-msg {
    font-size: 12.5px;
    margin-top: 3px;
    line-height: 1.45;
}

/* ── Botão fechar ───────────────────────────────────────────── */
.toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.15s ease;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close svg {
    width: 12px;
    height: 12px;
}

/* ── Barra de progresso ─────────────────────────────────────── */
.toast-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.toast-bar {
    height: 100%;
    width: 100%;
    border-radius: 0 0 0 var(--radius-lg, 14px);
    transition: width linear;
}

/* ================================================================
   Variantes — Dark Mode
   ================================================================ */

[data-theme="dark"] .toast-notification.toast-success {
    background: #0a1f17;
    border-color: #14503d;
}

[data-theme="dark"] .toast-notification.toast-success .toast-badge {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
}

[data-theme="dark"] .toast-notification.toast-success .toast-title {
    color: #6ee7b7;
}

[data-theme="dark"] .toast-notification.toast-success .toast-msg {
    color: #9ca3af;
}

[data-theme="dark"] .toast-notification.toast-success .toast-close {
    color: #6ee7b7;
}

[data-theme="dark"] .toast-notification.toast-success .toast-track {
    background: rgba(5, 150, 105, 0.1);
}

[data-theme="dark"] .toast-notification.toast-success .toast-bar {
    background: #059669;
}

[data-theme="dark"] .toast-notification.toast-error {
    background: #1a0a0a;
    border-color: #5c1f1f;
}

[data-theme="dark"] .toast-notification.toast-error .toast-badge {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

[data-theme="dark"] .toast-notification.toast-error .toast-title {
    color: #fca5a5;
}

[data-theme="dark"] .toast-notification.toast-error .toast-msg {
    color: #9ca3af;
}

[data-theme="dark"] .toast-notification.toast-error .toast-close {
    color: #fca5a5;
}

[data-theme="dark"] .toast-notification.toast-error .toast-track {
    background: rgba(220, 38, 38, 0.1);
}

[data-theme="dark"] .toast-notification.toast-error .toast-bar {
    background: #dc2626;
}

[data-theme="dark"] .toast-notification.toast-warning {
    background: #1a150a;
    border-color: #5c3f0a;
}

[data-theme="dark"] .toast-notification.toast-warning .toast-badge {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .toast-notification.toast-warning .toast-title {
    color: #fcd34d;
}

[data-theme="dark"] .toast-notification.toast-warning .toast-msg {
    color: #9ca3af;
}

[data-theme="dark"] .toast-notification.toast-warning .toast-close {
    color: #fcd34d;
}

[data-theme="dark"] .toast-notification.toast-warning .toast-track {
    background: rgba(217, 119, 6, 0.1);
}

[data-theme="dark"] .toast-notification.toast-warning .toast-bar {
    background: #d97706;
}

[data-theme="dark"] .toast-notification.toast-info {
    background: #0a1528;
    border-color: #1a4882;
}

[data-theme="dark"] .toast-notification.toast-info .toast-badge {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .toast-notification.toast-info .toast-title {
    color: #93bbfd;
}

[data-theme="dark"] .toast-notification.toast-info .toast-msg {
    color: #9ca3af;
}

[data-theme="dark"] .toast-notification.toast-info .toast-close {
    color: #93bbfd;
}

[data-theme="dark"] .toast-notification.toast-info .toast-track {
    background: rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .toast-notification.toast-info .toast-bar {
    background: #2563eb;
}

/* ================================================================
   Variantes — Light Mode
   ================================================================ */

[data-theme="light"] .toast-notification.toast-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

[data-theme="light"] .toast-notification.toast-success .toast-badge {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}

[data-theme="light"] .toast-notification.toast-success .toast-title {
    color: #065f46;
}

[data-theme="light"] .toast-notification.toast-success .toast-msg {
    color: #4b5563;
}

[data-theme="light"] .toast-notification.toast-success .toast-close {
    color: #065f46;
}

[data-theme="light"] .toast-notification.toast-success .toast-track {
    background: rgba(5, 150, 105, 0.08);
}

[data-theme="light"] .toast-notification.toast-success .toast-bar {
    background: #059669;
}

[data-theme="light"] .toast-notification.toast-error {
    background: #fef2f2;
    border-color: #fecaca;
}

[data-theme="light"] .toast-notification.toast-error .toast-badge {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

[data-theme="light"] .toast-notification.toast-error .toast-title {
    color: #991b1b;
}

[data-theme="light"] .toast-notification.toast-error .toast-msg {
    color: #4b5563;
}

[data-theme="light"] .toast-notification.toast-error .toast-close {
    color: #991b1b;
}

[data-theme="light"] .toast-notification.toast-error .toast-track {
    background: rgba(220, 38, 38, 0.06);
}

[data-theme="light"] .toast-notification.toast-error .toast-bar {
    background: #dc2626;
}

[data-theme="light"] .toast-notification.toast-warning {
    background: #fffbeb;
    border-color: #fde68a;
}

[data-theme="light"] .toast-notification.toast-warning .toast-badge {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

[data-theme="light"] .toast-notification.toast-warning .toast-title {
    color: #92400e;
}

[data-theme="light"] .toast-notification.toast-warning .toast-msg {
    color: #4b5563;
}

[data-theme="light"] .toast-notification.toast-warning .toast-close {
    color: #92400e;
}

[data-theme="light"] .toast-notification.toast-warning .toast-track {
    background: rgba(217, 119, 6, 0.06);
}

[data-theme="light"] .toast-notification.toast-warning .toast-bar {
    background: #d97706;
}

[data-theme="light"] .toast-notification.toast-info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

[data-theme="light"] .toast-notification.toast-info .toast-badge {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

[data-theme="light"] .toast-notification.toast-info .toast-title {
    color: #1e40af;
}

[data-theme="light"] .toast-notification.toast-info .toast-msg {
    color: #4b5563;
}

[data-theme="light"] .toast-notification.toast-info .toast-close {
    color: #1e40af;
}

[data-theme="light"] .toast-notification.toast-info .toast-track {
    background: rgba(37, 99, 235, 0.06);
}

[data-theme="light"] .toast-notification.toast-info .toast-bar {
    background: #2563eb;
}

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .toast-wrapper {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .toast-notification {
        padding: 14px 36px 14px 14px;
        gap: 12px;
    }

    .toast-badge {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .toast-badge svg {
        width: 16px;
        height: 16px;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-msg {
        font-size: 12px;
    }
}