/* Ventopia in-app toast — independent of toastr / Bootstrap .toast */
#vt-toast-root {
  position: fixed;
  z-index: 10060;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: visible;
  pointer-events: none;
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#vt-toast-root.vt-pos-br {
  right: 16px;
  bottom: 20px;
  left: auto;
  top: auto;
  align-items: stretch;
}

#vt-toast-root.vt-pos-tr {
  right: 12px;
  top: 14px;
  left: auto;
  bottom: auto;
  align-items: stretch;
}

@media (max-width: 767.98px) {
  #vt-toast-root.vt-pos-br {
    /* keep away from mobile bottom nav */
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    right: 10px;
    width: min(360px, calc(100vw - 20px));
  }
  #vt-toast-root.vt-pos-tr {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 10px;
    width: min(360px, calc(100vw - 20px));
  }
}

.vt-toast {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 0 12px;
  align-items: start;
  padding: 14px 14px 16px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  transform: translateX(18px);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  cursor: default;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.vt-toast.vt-show {
  transform: translateX(0);
  opacity: 1;
}

.vt-toast.vt-hide {
  transform: translateX(24px);
  opacity: 0;
}

.vt-toast.vt-clickable {
  cursor: pointer;
}

.vt-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.vt-toast.vt-success::before { background: linear-gradient(180deg, #10b981, #059669); }
.vt-toast.vt-warning::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.vt-toast.vt-error::before { background: linear-gradient(180deg, #ef4444, #dc2626); }
.vt-toast.vt-info::before,
.vt-toast.vt-notification::before { background: linear-gradient(180deg, #667eea, #764ba2); }

.vt-toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 8px 18px rgba(102, 126, 234, 0.28);
}

.vt-toast.vt-success .vt-toast-icon { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 18px rgba(16, 185, 129, 0.28); }
.vt-toast.vt-warning .vt-toast-icon { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 18px rgba(245, 158, 11, 0.28); }
.vt-toast.vt-error .vt-toast-icon { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28); }

.vt-toast-body {
  min-width: 0;
  padding-top: 2px;
}

.vt-toast-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.vt-toast-msg {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
  word-break: break-word;
}

.vt-toast-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.vt-toast-close:hover {
  background: rgba(148, 163, 184, 0.18);
  color: #0f172a;
}

.vt-toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(226, 232, 240, 0.85);
  overflow: hidden;
}

.vt-toast-progress > i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #667eea, #a855f7);
  animation: vt-progress-shrink linear forwards;
}

.vt-toast.vt-success .vt-toast-progress > i { background: linear-gradient(90deg, #10b981, #34d399); }
.vt-toast.vt-warning .vt-toast-progress > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.vt-toast.vt-error .vt-toast-progress > i { background: linear-gradient(90deg, #ef4444, #f87171); }

@keyframes vt-progress-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .vt-toast,
  .vt-toast-progress > i {
    transition: none !important;
    animation: none !important;
  }
  .vt-toast { opacity: 1; transform: none; }
}
