/**
 * shadcn / 21st.dev Promise Toast Styles
 * Follows demo.tsx & promise-toast.tsx specifications
 */
:root {
  --destructive-foreground: #b91c1c;
  --info: #3b82f6;
  --info-foreground: #1d4ed8;
  --success: #10b981;
  --success-foreground: #047857;
  --warning: #f59e0b;
  --warning-foreground: #b45309;
  --popover: #ffffff;
  --popover-foreground: #09090b;
  --border: #e4e4e7;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --card: #ffffff;
  --card-foreground: #09090b;
}

.dark {
  --destructive-foreground: #f87171;
  --info: #3b82f6;
  --info-foreground: #60a5fa;
  --success: #10b981;
  --success-foreground: #34d399;
  --warning: #f59e0b;
  --warning-foreground: #fbbf24;
  --popover: #09090b;
  --popover-foreground: #fafafa;
  --border: #27272a;
  --muted: #27272a;
  --muted-foreground: #a1a1aa;
}

.shadcn-toast-viewport {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 1000200 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 10px !important;
  max-width: 380px !important;
  width: calc(100vw - 32px) !important;
  pointer-events: none !important;
}

.shadcn-toast-card {
  pointer-events: auto;
  user-select: none;
  background-color: var(--popover, #ffffff);
  color: var(--popover-foreground, #09090b);
  border: 1px solid var(--border, #e4e4e7);
  border-radius: 8px; /* rounded-lg */
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  padding: 12px 14px;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 14px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  box-sizing: border-box;
}

.shadcn-toast-card.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.shadcn-toast-card.is-leaving {
  transform: translateY(12px) scale(0.96);
  opacity: 0;
}

.shadcn-toast-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.shadcn-toast-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.shadcn-toast-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shadcn-toast-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.shadcn-toast-icon.is-success svg {
  color: var(--success, #10b981);
}

.shadcn-toast-icon.is-error svg {
  color: var(--destructive-foreground, #b91c1c);
}

.shadcn-toast-icon.is-info svg {
  color: var(--info, #3b82f6);
}

.shadcn-toast-icon.is-warning svg {
  color: var(--warning, #f59e0b);
}

.shadcn-toast-icon.is-loading svg {
  color: var(--muted-foreground, #71717a);
  animation: shadcnToastSpin 0.9s linear infinite;
}

@keyframes shadcnToastSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.shadcn-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shadcn-toast-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--popover-foreground, #09090b);
}

.shadcn-toast-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-foreground, #71717a);
  margin: 0;
  word-break: break-word;
}

.shadcn-toast-close {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 2px !important;
  margin: -2px -2px 0 4px !important;
  color: var(--muted-foreground, #71717a) !important;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
  box-shadow: none !important;
}

.shadcn-toast-close:hover {
  color: var(--popover-foreground, #09090b) !important;
  background-color: var(--muted, #f4f4f5) !important;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .shadcn-toast-viewport {
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}
