/* Sistema de notificações robustas com animações e suporte a múltiplos tipos */

.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 380px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 768px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Base da notificação */
.notification {
  pointer-events: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  padding: 14px 16px;
  opacity: 0;
  transform: translateX(400px) translateY(-20px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  word-wrap: break-word;
  overflow-wrap: break-word;
  animation: none;
}

.notification--visible {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

.notification--exiting {
  opacity: 0;
  transform: translateX(400px) scale(0.9);
}

@media (max-width: 768px) {
  .notification {
    border-radius: 6px;
    padding: 12px 14px;
  }
}

/* Estrutura interna */
.notification-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .notification-content {
    gap: 10px;
  }
}

.notification-icon-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
}

.notification-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.notification-icon--spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.notification-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notification-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

.notification-message {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  opacity: 0.85;
  word-break: break-word;
}

.notification-close-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  transition: background-color 0.2s;
  color: inherit;
  opacity: 0.5;
  margin: -4px -4px 0 0;
}

.notification-close-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  opacity: 0.8;
}

.notification-close-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Variações de tipo */
.notification--success {
  border-left: 4px solid #22c55e;
}

.notification--success .notification-icon-wrapper {
  color: #22c55e;
}

.notification--error {
  border-left: 4px solid #ef4444;
}

.notification--error .notification-icon-wrapper {
  color: #ef4444;
}

.notification--warning {
  border-left: 4px solid #f59e0b;
}

.notification--warning .notification-icon-wrapper {
  color: #f59e0b;
}

.notification--info {
  border-left: 4px solid #3b82f6;
}

.notification--info .notification-icon-wrapper {
  color: #3b82f6;
}

.notification--pending {
  border-left: 4px solid #8b5cf6;
}

.notification--pending .notification-icon-wrapper {
  color: #8b5cf6;
}

/* Ações */
.notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.notification-action-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.notification-action-btn--default {
  background-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.87);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.notification-action-btn--default:hover {
  background-color: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}

.notification-action-btn--primary {
  background-color: #3b82f6;
  color: white;
}

.notification-action-btn--primary:hover {
  background-color: #2563eb;
}

.notification-action-btn--success {
  background-color: #22c55e;
  color: white;
}

.notification-action-btn--success:hover {
  background-color: #16a34a;
}

.notification-action-btn--danger {
  background-color: #ef4444;
  color: white;
}

.notification-action-btn--danger:hover {
  background-color: #dc2626;
}

.notification-action-btn:active {
  transform: scale(0.98);
}

/* Temas escuros */
@media (prefers-color-scheme: dark) {
  .notification {
    background: #1f2937;
    color: #f3f4f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .notification-close-btn {
    opacity: 0.4;
  }

  .notification-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 0.7;
  }

  .notification-message {
    opacity: 0.7;
  }

  .notification-action-btn--default {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.2);
  }

  .notification-action-btn--default:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

/* Redução de movimento (respeitar preferência de acessibilidade) */
@media (prefers-reduced-motion: reduce) {
  .notification {
    transition: opacity 0.3s ease;
  }

  .notification--spin {
    animation: none;
  }
}
