/* Toast Notifications */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  /* El contenedor no tapa clics de la página; cada toast sí los recibe. */
  pointer-events: none;
}

.toast-notification {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg-white, #ffffff);
  border-radius: var(--radius-md, 4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 14px;
  line-height: 1.4;
  border-left: 4px solid;
  word-break: break-word;
}

.toast-exit {
  animation: slideOutRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Color variants based on message.tags */

.toast-info {
  border-left-color: var(--color-primary, #2563eb);
  background: linear-gradient(
    135deg,
    var(--color-bg-white, #ffffff) 0%,
    var(--color-primary-soft, #eff6ff) 100%
  );
  color: var(--color-text, #000000);
}

.toast-success {
  border-left-color: #10b981;
  background: linear-gradient(
    135deg,
    var(--color-bg-white, #ffffff) 0%,
    #f0fdf4 100%
  );
  color: #059669;
}

.toast-warning {
  border-left-color: #f59e0b;
  background: linear-gradient(
    135deg,
    var(--color-bg-white, #ffffff) 0%,
    #fffbeb 100%
  );
  color: #d97706;
}

.toast-error,
.toast-danger {
  border-left-color: #ef4444;
  background: linear-gradient(
    135deg,
    var(--color-bg-white, #ffffff) 0%,
    #fef2f2 100%
  );
  color: #dc2626;
}

.toast-content {
  flex: 1;
  margin-top: 1px;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #6b7280);
  transition: color 0.2s;
  margin-top: 1px;
}

.toast-close:hover {
  color: var(--color-text, #000000);
}

.toast-close svg {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .toast-notification,
  .toast-exit {
    animation: none;
  }
}
