/* =====================================================
   SISTEMA DE NOTIFICAÇÕES - DESIGN MODERNO E LIMPO
   ===================================================== */

/* Container principal das notificações (AMBAS AS CLASSES) */
.notifications-container,
.notification-container,
#notification-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 999999 !important;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Notificação individual - Design Moderno */
.notification {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 0;
    box-shadow: 
        0 10px 40px -10px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    pointer-events: all;
    transform: translateX(420px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    border-radius: 16px 0 0 16px;
}

/* Tipos de notificação com cores */
.notification.success::before {
    background: linear-gradient(180deg, #22c55e, #16a34a);
}

.notification.error::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.notification.warning::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.notification.info::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

/* Animação de entrada */
.notification.show,
.notification[style*="translateX(0)"] {
    transform: translateX(0) !important;
    opacity: 1 !important;
}

/* Header da notificação */
.notification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

/* Ícone moderno */
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.notification.success .notification-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.notification.error .notification-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.notification.warning .notification-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.notification.info .notification-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Título */
.notification-title {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

/* Botão fechar */
.notification-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: #475569;
    background: #f1f5f9;
}

/* Mensagem */
.notification-message {
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-left: 52px;
    margin-top: -4px;
}

/* Barra de progresso animada */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e2e8f0;
    overflow: hidden;
}

.notification-progress::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    animation: progress-shrink 5s linear forwards;
}

.notification.success .notification-progress::after {
    background: linear-gradient(90deg, #22c55e, #10b981);
}

.notification.error .notification-progress::after {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.notification.warning .notification-progress::after {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

@keyframes progress-shrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* Animação de shake para urgente */
.notification.urgent {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.notification-btn.primary {
    background: #6366f1;
    color: white;
}

.notification-btn.primary:hover {
    background: #5048e5;
    transform: translateY(-1px);
}

.notification-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Toggle do painel de notificações */
.notifications-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 380px;
    max-height: 500px;
    background: linear-gradient(145deg, 
        rgba(30, 30, 50, 0.95) 0%, 
        rgba(25, 25, 40, 0.98) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 
        0 25px 50px -10px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 9999;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.notifications-panel.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.notifications-panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notifications-panel-title {
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.notifications-panel-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.notifications-panel-item {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.notifications-panel-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.notifications-panel-item.unread {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

/* Configurações do som */
.notification-sound-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.notification-sound-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Controle de volume */
#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    background: #5048e5;
    transform: scale(1.2);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #6366f1;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

#volume-slider::-moz-range-thumb:hover {
    background: #5048e5;
    transform: scale(1.2);
}

.notification-sound-toggle input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #6366f1;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.notification-sound-toggle input[type="checkbox"]:checked {
    background: #6366f1;
}

.notification-sound-toggle input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: -2px;
    left: 1px;
}

/* Responsividade */
@media (max-width: 768px) {
    .notifications-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .notifications-trigger {
        padding: 10px;
        font-size: 1.1rem;
        margin-right: 10px;
    }
    
    .notification {
        margin-bottom: 8px;
        padding: 15px;
    }
    
    .notifications-panel {
        left: 10px;
        right: 10px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .notifications-trigger {
        padding: 8px;
        font-size: 1rem;
        margin-right: 8px;
    }
    
    .notifications-count {
        min-width: 16px;
        height: 16px;
        font-size: 0.6rem;
        top: -4px;
        right: -4px;
    }
}

@media (max-width: 360px) {
    .notifications-trigger {
        padding: 6px;
        font-size: 0.9rem;
        margin-right: 6px;
    }
    
    .notifications-count {
        min-width: 14px;
        height: 14px;
        font-size: 0.55rem;
    }
}

/* Animação de entrada */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estados especiais */
.notification.priority-high {
    border-left: 4px solid #ef4444;
    animation: pulse-urgent 1s ease-in-out 3;
}

@keyframes pulse-urgent {
    0%, 100% { box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4); }
    50% { box-shadow: 0 20px 40px -10px rgba(239, 68, 68, 0.4); }
}