/**
 * Sistema Unificado de Notificações - Estilos Globais
 * 
 * Baseado no design system do dashboard, mas funcionando
 * em todas as páginas do SaaS.
 */

/* ===== NOTIFICAÇÃO BASE ===== */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--color-neutral-850, #1A1A1A);
    color: var(--color-text-primary, #EAEAEA);
    padding: 16px 20px;
    border-radius: var(--border-radius-md, 8px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3), 
        0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000002; /* Acima de todos os modais (var(--z-modal) = 10000000, confirm modal = 10000001) */
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    min-width: 280px;
    max-width: 400px;
    font-family: var(--font-family-base, 'Open Sans', sans-serif);
    font-size: 14px;
    line-height: 1.5;
}

/* ===== ANIMAÇÕES ===== */
.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.hide {
    opacity: 0;
    transform: translateX(400px);
}

/* ===== TIPOS DE NOTIFICAÇÃO ===== */
.notification-success {
    border-left: 4px solid #4caf50;
    background: linear-gradient(135deg, 
        var(--color-neutral-850, #1A1A1A) 0%, 
        rgba(76, 175, 80, 0.1) 100%);
}

.notification-error {
    border-left: 4px solid #f44336;
    background: linear-gradient(135deg, 
        var(--color-neutral-850, #1A1A1A) 0%, 
        rgba(244, 67, 54, 0.1) 100%);
}

.notification-warning {
    border-left: 4px solid #ff9800;
    background: linear-gradient(135deg, 
        var(--color-neutral-850, #1A1A1A) 0%, 
        rgba(255, 152, 0, 0.1) 100%);
}

.notification-info {
    border-left: 4px solid #2196f3;
    background: linear-gradient(135deg, 
        var(--color-neutral-850, #1A1A1A) 0%, 
        rgba(33, 150, 243, 0.1) 100%);
}

/* ===== COMPONENTES INTERNOS ===== */
.notification-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notification-success .notification-icon {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.notification-error .notification-icon {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
}

.notification-warning .notification-icon {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
}

.notification-info .notification-icon {
    color: #2196f3;
    background: rgba(33, 150, 243, 0.1);
}

.notification-message {
    flex: 1;
}

/* ===== BARRA DE PROGRESSO ===== */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    transform-origin: left;
    animation: notification-progress 3s linear forwards;
}

.notification-success .notification-progress {
    background: #4caf50;
}

.notification-error .notification-progress {
    background: #f44336;
}

.notification-warning .notification-progress {
    background: #ff9800;
}

.notification-info .notification-progress {
    background: #2196f3;
}

@keyframes notification-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .notification {
        top: 70px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
    
    .notification.hide {
        transform: translateY(-100px);
    }
}

/* ===== ESTADOS INTERATIVOS ===== */
.notification:hover {
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.4), 
        0 12px 32px rgba(0, 0, 0, 0.3);
    transform: translateX(-5px);
}

/* ===== COMPATIBILIDADE COM DASHBOARD ===== */
/* Manter compatibilidade com toast existente do dashboard */
.dashboard-toast {
    /* Herda estilos da notificação base */
    /* Mantém especificidade para não quebrar dashboard */
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
    .notification {
        transition: opacity 0.2s ease;
        transform: none;
    }
    
    .notification.show {
        transform: none;
    }
    
    .notification.hide {
        transform: none;
    }
    
    .notification-progress {
        animation: none;
    }
}

/* ===== MODAL DE CONFIRMAÇÃO ===== */
.notification-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000001; /* Acima de todos os outros modais (var(--z-modal) = 10000000) */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.notification-confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.notification-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.notification-confirm-content {
    position: relative;
    background: var(--color-neutral-850, #1A1A1A);
    border: 1px solid var(--color-neutral-400, #404040);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.notification-confirm-modal.show .notification-confirm-content {
    transform: scale(1) translateY(0);
}

/* Header do modal */
.notification-confirm-header {
    padding: 24px 24px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-confirm-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

/* Ícones coloridos por tipo */
.notification-confirm-content[data-type="warning"] .notification-confirm-icon {
    color: #ff9800;
}

.notification-confirm-content[data-type="danger"] .notification-confirm-icon {
    color: #f44336;
}

.notification-confirm-content[data-type="info"] .notification-confirm-icon {
    color: #2196f3;
}

.notification-confirm-content[data-type="success"] .notification-confirm-icon {
    color: #4caf50;
}

/* Botão de confirmação para tipo warning (laranja) */
.notification-confirm-btn-confirm[data-type="warning"] {
    background: #ff9800;
    color: white;
    border: none;
}

.notification-confirm-btn-confirm[data-type="warning"]:hover {
    background: #f57c00;
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.notification-confirm-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary, #EAEAEA);
}

/* Body do modal */
.notification-confirm-body {
    padding: 0 24px;
}

.notification-confirm-message {
    margin: 0 0 12px 0;
    color: var(--color-text-primary, #EAEAEA);
    line-height: 1.6;
    font-size: 14px;
}

.notification-confirm-details {
    margin-top: 12px;
    padding: 12px;
    background: var(--color-bg-hover, #2A2A2A);
    border: 1px solid var(--color-neutral-400, #404040);
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-text-muted, #A0A0A0);
}

/* Footer do modal */
.notification-confirm-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Botões */
.notification-confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.notification-confirm-btn-cancel {
    background: var(--color-bg-primary, #0D0D0D);
    color: var(--color-text-primary, #EAEAEA);
    border: 1px solid var(--color-bg-hover, #2A2A2A);
}

.notification-confirm-btn-cancel:hover {
    background: var(--color-bg-hover, #2A2A2A);
    border-color: var(--color-navimarkets-blue, #0270E2);
}

.notification-confirm-btn-confirm {
    background: var(--color-navimarkets-blue, #0270E2);
    color: white;
    border: none;
}

.notification-confirm-btn-confirm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Botão de exclusão (vermelho com glow) */
.notification-confirm-btn-confirm[data-type="danger"],
.notification-confirm-btn-confirm.danger {
    background: #f44336;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.3);
}

.notification-confirm-btn-confirm[data-type="danger"]:hover,
.notification-confirm-btn-confirm.danger:hover {
    background: #d32f2f;
    box-shadow: 0 0 25px rgba(244, 67, 54, 0.5);
    transform: translateY(-1px);
}

/* Responsivo */
@media (max-width: 640px) {
    .notification-confirm-content {
        width: 95%;
        margin: 12px;
    }
    
    .notification-confirm-header,
    .notification-confirm-body,
    .notification-confirm-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .notification-confirm-footer {
        flex-direction: column;
    }
    
    .notification-confirm-btn {
        width: 100%;
    }
}

/* Foco para navegação por teclado */
.notification-confirm-btn:focus {
    outline: 2px solid var(--color-navimarkets-blue, #0270E2);
    outline-offset: 2px;
}

/* ===== DARK MODE COMPATIBILITY ===== */
@media (prefers-color-scheme: dark) {
    .notification {
        /* Já otimizado para dark mode */
        /* Usa variáveis CSS que se adaptam automaticamente */
    }
}
