/* ══════════════════════════════════════════════════════════
   GUIANEO TOAST SYSTEM — Premium notifications
   ══════════════════════════════════════════════════════════ */

/* ── Container ── */
.gnv-toast-container {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 380px;
  max-width: calc(100vw - 48px);
}

/* Mobile: posicionado acima da PWA nav bar (68px altura) */
@media (max-width: 768px) {
  .gnv-toast-container {
    bottom: 76px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

/* ── Toast base ── */
.gnv-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 13px 14px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, .06),
    0 4px 20px rgba(0, 0, 0, .09);
  overflow: hidden;
  pointer-events: all;
  cursor: default;
  font-family: 'Poppins', system-ui, sans-serif;

  /* Estado inicial (fora de tela) */
  opacity: 0;
  transform: translateX(18px);
  transition:
    opacity .22s ease,
    transform .28s cubic-bezier(.16, 1, .3, 1),
    box-shadow .15s ease;
  will-change: transform, opacity;
}

.gnv-toast--in {
  opacity: 1;
  transform: translateX(0);
}

.gnv-toast--out {
  opacity: 0;
  transform: translateX(22px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

/* Mobile: slide de baixo */
@media (max-width: 768px) {
  .gnv-toast         { transform: translateY(14px); }
  .gnv-toast--out    { transform: translateY(14px); }
  .gnv-toast--in     { transform: translateY(0); }
}

.gnv-toast:hover {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .08),
    0 10px 28px rgba(0, 0, 0, .12);
}

/* ── Stripe lateral de cor ── */
.gnv-toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

/* ── Ícone ── */
.gnv-toast__icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .88rem;
  margin-top: 1px;
}

/* ── Conteúdo ── */
.gnv-toast__body {
  flex: 1;
  min-width: 0;
}

.gnv-toast__title {
  font-size: .875rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.45;
  margin: 0;
}

.gnv-toast__title a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gnv-toast__msg {
  font-size: .8rem;
  color: #6b7280;
  line-height: 1.55;
  margin: 3px 0 0;
}

.gnv-toast__action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
  padding: 5px 10px;
  font-size: .77rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.gnv-toast__action:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* ── Botão fechar ── */
.gnv-toast__close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .68rem;
  line-height: 1;
  padding: 0;
  margin-top: 3px;
  transition: background .12s, color .12s;
}
.gnv-toast__close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ── Barra de progresso ── */
.gnv-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 14px;
  transition-timing-function: linear;
}

/* ══════════════════════════════
   Variantes por tipo
══════════════════════════════ */

/* SUCCESS */
.gnv-toast--success::before          { background: #22c55e; }
.gnv-toast--success .gnv-toast__icon { background: #f0fdf4; color: #16a34a; }
.gnv-toast--success .gnv-toast__progress { background: #22c55e; }

/* ERROR */
.gnv-toast--error::before            { background: #ef4444; }
.gnv-toast--error .gnv-toast__icon   { background: #fef2f2; color: #dc2626; }
.gnv-toast--error .gnv-toast__progress  { background: #ef4444; }

/* WARNING */
.gnv-toast--warning::before          { background: #f59e0b; }
.gnv-toast--warning .gnv-toast__icon { background: #fffbeb; color: #d97706; }
.gnv-toast--warning .gnv-toast__progress { background: #f59e0b; }

/* INFO */
.gnv-toast--info::before             { background: #3b82f6; }
.gnv-toast--info .gnv-toast__icon    { background: #eff6ff; color: #1d4ed8; }
.gnv-toast--info .gnv-toast__progress   { background: #3b82f6; }

/* LOADING */
.gnv-toast--loading::before          { background: #9ca3af; }
.gnv-toast--loading .gnv-toast__icon { background: #f9fafb; color: #6b7280; }

/* ══════════════════════════════
   Modo escuro
══════════════════════════════ */
@media (prefers-color-scheme: dark) {
  .gnv-toast {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, .08);
    box-shadow:
      0 1px 3px rgba(0, 0, 0, .3),
      0 4px 20px rgba(0, 0, 0, .45);
  }
  .gnv-toast__title        { color: #f9fafb; }
  .gnv-toast__title a      { color: #60a5fa; }
  .gnv-toast__msg          { color: #9ca3af; }
  .gnv-toast__close        { color: #6b7280; }
  .gnv-toast__close:hover  { background: rgba(255, 255, 255, .07); color: #d1d5db; }
  .gnv-toast__action       { color: #60a5fa; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.25); }
  .gnv-toast__action:hover { background: rgba(59,130,246,.2); border-color: rgba(59,130,246,.4); color: #93c5fd; }

  .gnv-toast--success .gnv-toast__icon { background: rgba(34, 197, 94, .12);  color: #4ade80; }
  .gnv-toast--error   .gnv-toast__icon { background: rgba(239, 68, 68, .12);  color: #f87171; }
  .gnv-toast--warning .gnv-toast__icon { background: rgba(245, 158, 11, .12); color: #fbbf24; }
  .gnv-toast--info    .gnv-toast__icon { background: rgba(59, 130, 246, .12); color: #60a5fa; }
  .gnv-toast--loading .gnv-toast__icon { background: rgba(156, 163, 175, .1); color: #9ca3af; }
}
