/* ========================================
   Toast / Snackbar (Radix UI)
   ======================================== */

.oppb-toast-viewport {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  outline: none;
  z-index: var(--z-toast);
  pointer-events: none;
}

.oppb-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.oppb-toast[data-state="open"] {
  animation: oppbToastSlideIn 220ms ease-out;
}

.oppb-toast[data-state="closed"] {
  animation: oppbToastSlideOut 180ms ease-in forwards;
}

.oppb-toast[data-swipe="move"] {
  transform: translateX(var(--radix-toast-swipe-move-x));
}

.oppb-toast[data-swipe="cancel"] {
  transform: translateX(0);
  transition: transform 180ms ease-out;
}

.oppb-toast[data-swipe="end"] {
  animation: oppbToastSwipeOut 180ms ease-out forwards;
}

.oppb-toast__content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.oppb-toast__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.oppb-toast__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.oppb-toast__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}

.oppb-toast__description {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.oppb-toast__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.oppb-toast__close:hover {
  background: var(--color-surface-secondary);
  color: var(--color-text);
}

.oppb-toast__close-icon {
  width: 16px;
  height: 16px;
}

.oppb-toast--success {
  border-color: color-mix(in srgb, var(--color-success) 35%, var(--color-border));
}

.oppb-toast--success .oppb-toast__icon {
  color: var(--color-success);
}

.oppb-toast--error {
  border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border));
}

.oppb-toast--error .oppb-toast__icon {
  color: var(--color-danger);
}

.oppb-toast--info {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}

.oppb-toast--info .oppb-toast__icon {
  color: var(--color-primary);
}

@keyframes oppbToastSlideIn {
  from {
    opacity: 0;
    transform: translateX(calc(100% + 24px));
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes oppbToastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(calc(100% + 24px));
  }
}

@keyframes oppbToastSwipeOut {
  from {
    transform: translateX(var(--radix-toast-swipe-end-x));
  }

  to {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
  }
}
