/*
 * @mikestools/toast - notification stack.
 * Theme via --mt-toast-* custom properties on any ancestor; values below are
 * var() FALLBACKS, so consumer overrides win. Default fallbacks are
 * light-dark() pairs - declare color-scheme on the page for the intended side.
 */

.mt-toast-container {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: var(--mt-toast-gap, 8px);
  padding: var(--mt-toast-margin, 16px);
  pointer-events: none; /* the gaps must not block the page */
  max-width: min(var(--mt-toast-width, 360px), 100vw);
  box-sizing: border-box;
}

.mt-toast-top-right { top: 0; right: 0; }
.mt-toast-top-left { top: 0; left: 0; }
/* Bottom stacks grow upward so the newest toast lands nearest the edge. */
.mt-toast-bottom-right { bottom: 0; right: 0; flex-direction: column-reverse; }
.mt-toast-bottom-left { bottom: 0; left: 0; flex-direction: column-reverse; }

.mt-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  background: var(--mt-toast-bg, light-dark(#ffffff, #1c2230));
  color: var(--mt-toast-fg, light-dark(#1f2430, #e3e7f1));
  border: 1px solid var(--mt-toast-border, light-dark(#c4c9d4, #3a4356));
  border-left: 4px solid var(--mt-toast-accent, light-dark(#4468c4, #4c7dff));
  border-radius: var(--mt-toast-radius, 8px);
  box-shadow: var(--mt-toast-shadow, 0 6px 20px rgba(0, 0, 0, 0.25));
  font: inherit;
}

.mt-toast-success { --mt-toast-accent: var(--mt-toast-success, light-dark(#1e9e50, #2fca6d)); }
.mt-toast-warning { --mt-toast-accent: var(--mt-toast-warn, light-dark(#c88a00, #f5c518)); }
.mt-toast-error { --mt-toast-accent: var(--mt-toast-error, light-dark(#c43333, #ff5c5c)); }

.mt-toast-message {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.mt-toast-action {
  flex: none;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: var(--mt-toast-accent, light-dark(#4468c4, #4c7dff));
}

.mt-toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.15em;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 4px;
}

.mt-toast-close:hover {
  background: var(--mt-toast-close-hover-bg, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
}

/* Leave animation - duration mirrored by LEAVE_MS in toast.ts. */
@media (prefers-reduced-motion: no-preference) {
  .mt-toast {
    transition: opacity 180ms ease, translate 180ms ease;
  }

  .mt-toast-leave {
    opacity: 0;
    translate: 0 -6px;
  }
}
