/* DotNetShared.AspNet.Toast — macOS Notification Center-style stack, top-right, newest on top.
   UI-library-agnostic on purpose (no MudBlazor/Bootstrap dependency — see Toast/README.md).
   Only responds to prefers-color-scheme, not an app's own manual theme toggle; a consumer with its
   own light/dark switch independent of the OS setting can override the --dns-toast-* vars below. */

.dns-toast-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.dns-toast {
  --dns-toast-bg: #ffffffee;
  --dns-toast-fg: #1c1c1e;
  --dns-toast-fg-muted: #6e6e73;
  --dns-toast-border: rgba(0, 0, 0, 0.08);
  --dns-toast-shadow: 0 8px 28px rgba(0, 0, 0, 0.18), 0 1px 3px rgba(0, 0, 0, 0.08);
  --dns-toast-hover-bg: rgba(0, 0, 0, 0.06);

  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--dns-toast-bg);
  color: var(--dns-toast-fg);
  border: 1px solid var(--dns-toast-border);
  border-radius: 14px;
  box-shadow: var(--dns-toast-shadow);
  padding: 12px 14px;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  pointer-events: auto;
  cursor: default;
  opacity: 0;
  transform: translateX(24px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dns-toast--visible { opacity: 1; transform: translateX(0) scale(1); }
.dns-toast--leaving { opacity: 0; transform: translateX(24px) scale(0.98); }
.dns-toast--clickable { cursor: pointer; }
.dns-toast--clickable:hover { box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.1); }

.dns-toast-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--dns-toast-fg-muted);
}
.dns-toast--success .dns-toast-icon { background: #34c759; }
.dns-toast--warning .dns-toast-icon { background: #ff9f0a; }
.dns-toast--error .dns-toast-icon { background: #ff3b30; }
.dns-toast--info .dns-toast-icon { background: #0a84ff; }

.dns-toast-body { flex: 1 1 auto; min-width: 0; }
.dns-toast-title { font-weight: 600; color: var(--dns-toast-fg); word-break: break-word; }
.dns-toast-desc { margin-top: 2px; color: var(--dns-toast-fg-muted); word-break: break-word; }

.dns-toast-close {
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dns-toast-fg-muted);
  font-size: 15px;
  line-height: 1;
  padding: 3px 5px;
  margin: -3px -5px 0 0;
  border-radius: 6px;
}
.dns-toast-close:hover { background: var(--dns-toast-hover-bg); color: var(--dns-toast-fg); }

@media (prefers-color-scheme: dark) {
  .dns-toast {
    --dns-toast-bg: #2c2c2eee;
    --dns-toast-fg: #f5f5f7;
    --dns-toast-fg-muted: #a1a1a6;
    --dns-toast-border: rgba(255, 255, 255, 0.08);
    --dns-toast-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    --dns-toast-hover-bg: rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 480px) {
  .dns-toast-region { top: 8px; right: 8px; left: 8px; width: auto; }
}
