/* Sistema de Notificações Toast */

/* Animação de rotação para ícone loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.toast-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  pointer-events: none !important;
  max-width: 420px !important;
  width: 100% !important;
}

@media (max-width: 480px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  pointer-events: all;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--removing {
  opacity: 0;
  transform: translateX(400px) scale(0.9);
}

/* Tipos de toast */
.toast--loading {
  border-left: 4px solid #3b82f6;
}

.toast--success {
  border-left: 4px solid #10b981;
}

.toast--error {
  border-left: 4px solid #ef4444;
}

.toast--warning {
  border-left: 4px solid #f59e0b;
}

.toast--info {
  border-left: 4px solid #6366f1;
}

/* Ícone */
.toast__icon {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}

.toast--loading .toast__icon {
  color: #3b82f6;
}

.toast--loading .toast__icon i,
.toast--loading .toast__icon .fa-circle-notch {
  animation: spin 1s linear infinite !important;
  display: inline-block !important;
}

.toast--success .toast__icon {
  color: #10b981;
}

.toast--error .toast__icon {
  color: #ef4444;
}

.toast--warning .toast__icon {
  color: #f59e0b;
}

.toast--info .toast__icon {
  color: #6366f1;
}

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

.toast__title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  line-height: 1.4;
}

.toast__message {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 0 0;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Botões */
.toast__action,
.toast__close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
}

.toast__action:hover,
.toast__close:hover {
  background-color: #f3f4f6;
}

.toast__action {
  color: #3b82f6;
  margin-left: 8px;
}

.toast__action:hover {
  background-color: #eff6ff;
}

.toast__close {
  margin-left: 4px;
}

/* Animação de loading */
@keyframes toast-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.toast--loading {
  animation: toast-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Dark mode (opcional) */
@media (prefers-color-scheme: dark) {
  .toast {
    background: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  .toast__title {
    color: #f9fafb;
  }

  .toast__message {
    color: #d1d5db;
  }

  .toast__action,
  .toast__close {
    color: #9ca3af;
  }

  .toast__action:hover,
  .toast__close:hover {
    background-color: #374151;
  }

  .toast__action {
    color: #60a5fa;
  }

  .toast__action:hover {
    background-color: #1e3a8a;
  }
}
