/* ===== BPS TOAST NOTIFICATION SYSTEM ===== */

/* Container — fixed top-right, stacks toasts vertically */
.bps-toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 48px);
}

/* ── Individual Toast ── */
.bps-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.35);
  pointer-events: auto;
  position: relative;
  overflow: hidden;
  transform: translateX(120%);
  opacity: 0;
  animation: bpsToastSlideIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: default;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bps-toast:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.bps-toast.bps-toast--removing {
  animation: bpsToastSlideOut 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* ── Slide animations ── */
@keyframes bpsToastSlideIn {
  0%   { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes bpsToastSlideOut {
  0%   { transform: translateX(0); opacity: 1; max-height: 120px; margin-bottom: 0; }
  100% { transform: translateX(120%); opacity: 0; max-height: 0; margin-bottom: -12px; padding-top: 0; padding-bottom: 0; }
}

/* ── Icon ── */
.bps-toast__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  animation: bpsToastIconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes bpsToastIconPop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

.bps-toast__icon svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

/* ── Body ── */
.bps-toast__body {
  flex: 1;
  min-width: 0;
}

.bps-toast__title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 2px;
  color: #1a202c;
}

.bps-toast__message {
  font-size: 13px;
  line-height: 1.5;
  color: #4a5568;
  word-break: break-word;
}

/* ── Clickable link area ── */
.bps-toast__link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.bps-toast__link:hover .bps-toast__hint {
  opacity: 1;
}

.bps-toast__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #a0aec0;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bps-toast__hint svg {
  width: 12px;
  height: 12px;
  fill: #a0aec0;
  transition: transform 0.25s ease;
}

.bps-toast__link:hover .bps-toast__hint svg {
  transform: translateX(3px);
}

/* ── Close button ── */
.bps-toast__close {
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
  margin-top: 1px;
}

.bps-toast__close:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.1);
}

.bps-toast__close svg {
  width: 12px;
  height: 12px;
  fill: #718096;
}

/* ── Progress bar (auto-dismiss timer) ── */
.bps-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  animation: bpsToastProgress linear forwards;
}

@keyframes bpsToastProgress {
  0%   { width: 100%; }
  100% { width: 0%; }
}

/* Pause progress on hover */
.bps-toast:hover .bps-toast__progress {
  animation-play-state: paused;
}

/* ── Left accent border ── */
.bps-toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

/* ===== TYPE VARIANTS ===== */

/* ── Success ── */
.bps-toast--success::before { background: #1E3A8A; }
.bps-toast--success .bps-toast__icon { background: linear-gradient(135deg, #1E3A8A, #15306E); }
.bps-toast--success .bps-toast__title { color: #166534; }
.bps-toast--success .bps-toast__progress { background: linear-gradient(90deg, #1E3A8A, #86efac); }

/* ── Error ── */
.bps-toast--error::before { background: #e53e3e; }
.bps-toast--error .bps-toast__icon { background: linear-gradient(135deg, #e53e3e, #c53030); }
.bps-toast--error .bps-toast__title { color: #991b1b; }
.bps-toast--error .bps-toast__progress { background: linear-gradient(90deg, #e53e3e, #fca5a5); }

/* ── Warning ── */
.bps-toast--warning::before { background: #eab308; }
.bps-toast--warning .bps-toast__icon { background: linear-gradient(135deg, #eab308, #ca8a04); }
.bps-toast--warning .bps-toast__title { color: #854d0e; }
.bps-toast--warning .bps-toast__progress { background: linear-gradient(90deg, #eab308, #fde68a); }

/* ── Info ── */
.bps-toast--info::before { background: #3b82f6; }
.bps-toast--info .bps-toast__icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bps-toast--info .bps-toast__title { color: #1e40af; }
.bps-toast--info .bps-toast__progress { background: linear-gradient(90deg, #3b82f6, #93c5fd); }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .bps-toast-container {
    right: 12px;
    left: 12px;
    top: 72px;
    max-width: none;
    width: auto;
  }

  .bps-toast {
    padding: 12px 16px;
    border-radius: 12px;
  }
}
