/* --- SISTEMA DE NOTIFICAÇÕES --- */

.notification-container {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-2xl);
  transform: translateX(100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.notification-container:not(.hidden) {
  transform: translateX(0);
}

.notification-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* --- HEADER --- */
.notification-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg);
}

.notification-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-header h3::before {
  content: 'notifications';
  font-size: 24px;
  color: var(--primary);
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-badge {
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  animation: pulse 2s ease-in-out infinite;
}

/* --- LISTA DE NOTIFICAÇÕES --- */
.notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.notification-empty {
  text-align: center;
  color: var(--text-light);
  padding: 60px 20px;
  font-style: italic;
  font-size: 1rem;
}

.notification-empty::before {
  content: 'notifications_none';
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.3;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.notification-item:hover {
  transform: translateX(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.notification-item.unread {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: var(--radius-full);
  animation: pulse 2s ease-in-out infinite;
}

.notification-item.read {
  opacity: 0.8;
}

.notification-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-message {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  font-size: 0.95rem;
}

.notification-time {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
}

.notification-item .notification-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.notification-item:hover .notification-actions {
  opacity: 1;
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-light);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* --- CONFIGURAÇÕES --- */
.notification-settings {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.notification-settings h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
}

.settings-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* --- TOAST DE NOTIFICAÇÃO --- */
.toast.notification-toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s ease;
}

.toast.notification-toast.high-priority {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.toast.notification-toast.medium-priority {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.toast.notification-toast.low-priority {
  border-left-color: #6b7280;
  background: rgba(107, 114, 128, 0.1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* --- BOTÃO TOGGLE --- */
.notification-toggle {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  z-index: 999;
  font-weight: 600;
}

.notification-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-xl);
}

.notification-toggle:active {
  transform: scale(0.95);
}

.notification-toggle.has-unread::after {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--gradient-error);
  border-radius: var(--radius-full);
  border: 3px solid white;
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: var(--shadow-sm);
}

/* --- RESPONSIVE --- */
@media (max-width: 480px) {
  .notification-container {
    width: 100%;
    right: 0;
  }
  
  .notification-toggle {
    top: auto;
    bottom: 20px;
    right: 20px;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .notification-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .notification-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* --- ANIMAÇÕES --- */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.notification-item.unread {
  animation: pulse 2s ease-in-out;
}

.notification-badge {
  animation: pulse 1.5s ease-in-out infinite;
}

/* --- DARK MODE --- */
@media (prefers-color-scheme: dark) {
  .toast.notification-toast.high-priority {
    background: rgba(239, 68, 68, 0.2);
  }
  
  .toast.notification-toast.medium-priority {
    background: rgba(59, 130, 246, 0.2);
  }
  
  .toast.notification-toast.low-priority {
    background: rgba(107, 114, 128, 0.2);
  }
}

/* --- FOCUS E ACESSIBILIDADE --- */
.notification-toggle:focus,
.btn-icon:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.notification-item:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* --- ESTADOS DE CARREGAMENTO --- */
.notification-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-secondary);
}

.notification-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin-left: 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
