/**
 * smile_v2 — Toast notification system.
 * Ported from design_handoff_smile_toast/prototype/toast-styles.css.
 *
 * Theme tokens (--ink, --burgundy, etc.) come from smile-v2-tokens.css.
 * Only toast-specific tokens are redefined here.
 */

:root {
  --toast-w: 380px;
  --toast-error: #D4302B;
  --toast-error-bg: #FBEAE8;
  --toast-warning: #B8924F;
  --toast-warning-bg: #FBF3E6;
  --toast-info: #2B2826;
  --toast-info-bg: #F0EAE2;
  --toast-shadow: 0 16px 40px -16px rgba(43, 40, 38, 0.28), 0 4px 12px -6px rgba(43, 40, 38, 0.12);
}

/* Container — fixed stack */
.smile-toasts {
  position: fixed;
  top: 80px;
  right: 16px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: var(--toast-w);
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
@media (max-width: 600px) {
  .smile-toasts {
    top: 72px;
    left: 16px;
    right: 16px;
    width: auto;
    align-items: stretch;
  }
}

/* Toast card */
.smile-toast {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--line, #E8DFD6);
  border-radius: var(--r-md, 12px);
  padding: 14px 14px 14px 18px;
  box-shadow: var(--toast-shadow);
  overflow: hidden;
  animation: smile-toast-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top right;
}
.smile-toast.is-leaving {
  animation: smile-toast-out 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Accent strip izquierda 3px */
.smile-toast::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--burgundy, #6B2C2C);
}
.smile-toast--success::before { background: var(--success, #2E5C3F); }
.smile-toast--error::before   { background: var(--toast-error); }
.smile-toast--warning::before { background: var(--toast-warning); }
.smile-toast--info::before    { background: var(--toast-info); }

/* Icon */
.smile-toast__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.smile-toast__icon svg { width: 17px; height: 17px; }
.smile-toast--success .smile-toast__icon { background: var(--success-bg, #E8F0E5); color: var(--success, #2E5C3F); }
.smile-toast--error   .smile-toast__icon { background: var(--toast-error-bg); color: var(--toast-error); }
.smile-toast--warning .smile-toast__icon { background: var(--toast-warning-bg); color: var(--toast-warning); }
.smile-toast--info    .smile-toast__icon { background: var(--toast-info-bg); color: var(--toast-info); }

/* Image preview 40×40 */
.smile-toast__img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2, #FAF7F2);
  border: 1px solid var(--line, #E8DFD6);
  margin-top: 1px;
}
.smile-toast__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Body */
.smile-toast__body { min-width: 0; padding-top: 1px; }
.smile-toast__title {
  font-family: var(--f-body, "Inter", -apple-system, sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink, #2B2826);
  letter-spacing: -0.005em;
}
.smile-toast__title em {
  font-family: var(--f-display, "Playfair Display", Georgia, serif);
  font-style: italic;
  font-weight: 500;
  color: var(--burgundy, #6B2C2C);
}
.smile-toast__desc {
  font-family: var(--f-body, "Inter", -apple-system, sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-2, #6B6360);
  margin-top: 3px;
}
.smile-toast__action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-family: var(--f-body, "Inter", sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--burgundy, #6B2C2C);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}
.smile-toast__action:hover { color: var(--burgundy, #6B2C2C); opacity: 0.78; text-decoration: none; }
.smile-toast__action svg { width: 13px; height: 13px; }

/* Close */
.smile-toast__close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--ink-3, #A39A92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  margin: -2px -2px 0 0;
}
.smile-toast__close:hover { background: var(--surface-2, #FAF7F2); color: var(--ink, #2B2826); }
.smile-toast__close svg { width: 14px; height: 14px; }

/* Progress timer */
.smile-toast__timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: currentColor;
  opacity: 0.14;
  transform-origin: left;
  animation: smile-toast-timer linear forwards;
}
.smile-toast--success .smile-toast__timer { color: var(--success, #2E5C3F); }
.smile-toast--error   .smile-toast__timer { color: var(--toast-error); }
.smile-toast--warning .smile-toast__timer { color: var(--toast-warning); }
.smile-toast--info    .smile-toast__timer { color: var(--toast-info); }
.smile-toast:hover .smile-toast__timer,
.smile-toast.is-paused .smile-toast__timer { animation-play-state: paused; }

@keyframes smile-toast-in {
  from { opacity: 0; transform: translateX(24px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes smile-toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); max-height: 200px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(24px) scale(0.98); max-height: 0; margin-bottom: -10px; padding-top: 0; padding-bottom: 0; }
}
@media (max-width: 600px) {
  @keyframes smile-toast-in {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes smile-toast-out {
    from { opacity: 1; transform: translateY(0); max-height: 200px; }
    to   { opacity: 0; transform: translateY(-16px); max-height: 0; margin-bottom: -10px; padding-top: 0; padding-bottom: 0; }
  }
  .smile-toast { padding: 13px 12px 13px 16px; }
}
@keyframes smile-toast-timer {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .smile-toast { animation: smile-toast-fade 0.2s ease both; }
  .smile-toast.is-leaving { animation: smile-toast-fade-out 0.2s ease both; }
  .smile-toast__timer { animation: none; display: none; }
  @keyframes smile-toast-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes smile-toast-fade-out { from { opacity: 1; } to { opacity: 0; } }
}

/* Suppress leofeature's banner so we don't double-notify. The module's JS
   still runs but its DOM is invisible. Removed entirely when we uninstall. */
.leo-notification { display: none !important; }
