/* Toast Notifications - Slide-in notifications for real-time events */

.toast {
  position: fixed;
  inset-block-start: var(--block-space);
  inset-inline-end: var(--block-space);
  z-index: 1000;
  max-width: 320px;
  width: calc(100vw - var(--block-space) * 2);
}

.toast__inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75em;
  padding: 1em;
  background: var(--color-surface);
  border-radius: 0.75em;
  box-shadow:
    0 0 0 1px oklch(0% 0 0 / 8%),
    0 0.5em 1em oklch(0% 0 0 / 12%),
    0 1em 2em oklch(0% 0 0 / 8%);
  transform: translateX(calc(100% + var(--block-space)));
  opacity: 0;
  transition:
    transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 200ms ease;
}

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

.toast--hiding .toast__inner {
  transform: translateX(calc(100% + var(--block-space)));
  opacity: 0;
  transition:
    transform 200ms ease-in,
    opacity 200ms ease;
}

.toast__icon {
  flex-shrink: 0;
  width: 2.5em;
  height: 2.5em;
  display: grid;
  place-items: center;
  background: var(--color-positive);
  border-radius: 50%;
}

.toast__icon img {
  width: 1.25em;
  height: 1.25em;
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 0.25em;
  color: var(--color-text);
}

.toast__message {
  font-size: 0.875rem;
  color: var(--color-text-subtle);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast__actions {
  display: flex;
  gap: 0.5em;
  margin-block-start: 0.75em;
}

.toast__action {
  font-size: 0.8125rem;
  padding: 0.375em 0.75em;
  border-radius: 99rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms ease;
}

.toast__action--primary {
  background: var(--color-positive);
  color: white;
}

.toast__action--primary:hover {
  background: oklch(from var(--color-positive) calc(l - 0.05) c h);
}

.toast__dismiss {
  flex-shrink: 0;
  padding: 0.25em;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 150ms ease;
  border-radius: 0.25em;
}

.toast__dismiss:hover {
  opacity: 1;
}

.toast__dismiss:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

/* Lead-specific toast styling */
.toast--lead .toast__icon {
  background: var(--color-positive);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .toast__inner {
    box-shadow:
      0 0 0 1px oklch(100% 0 0 / 8%),
      0 0.5em 1em oklch(0% 0 0 / 30%),
      0 1em 2em oklch(0% 0 0 / 20%);
  }
}
