/* ============================================
   Toast Notification System
   Modern floating toasts with slide-in animation,
   accent stripe, and auto-dismiss progress bar
   ============================================ */

.sl-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 40px);
}

/* ---- Toast card ---- */
.sl-toast {
  --toast-accent: #3B82F6;
  --toast-bg: #f0f7ff;

  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 40px 16px 20px;
  background: #fff;
  border-radius: var(--radius-md, 12px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  pointer-events: auto;
  font-family: var(--font-sans, 'DM Sans', sans-serif);

  /* Entry state — off-screen right */
  opacity: 0;
  transform: translateX(100%) scale(0.96);
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sl-toast--visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.sl-toast--leaving {
  opacity: 0;
  transform: translateX(40%) scale(0.96);
  transition:
    opacity 0.25s ease-in,
    transform 0.25s ease-in;
}

/* ---- Accent stripe (left edge) ---- */
.sl-toast__stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--toast-accent);
  border-radius: var(--radius-md, 12px) 0 0 var(--radius-md, 12px);
}

/* ---- Icon ---- */
.sl-toast__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--toast-bg);
  color: var(--toast-accent);
  font-size: 16px;
}

/* ---- Body ---- */
.sl-toast__body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.sl-toast__title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--sl-charcoal, #1a1a1a);
  margin-bottom: 2px;
  line-height: 1.3;
}

.sl-toast__message {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--sl-gray, #5a5a5a);
}

.sl-toast__message p {
  margin: 0;
}

/* ---- Close button ---- */
.sl-toast__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #a0a0a0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast, 0.15s ease);
}

.sl-toast__close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #555;
}

/* ---- Progress bar (auto-dismiss countdown) ---- */
.sl-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--toast-accent);
  opacity: 0.3;
  transform-origin: left;
  transform: scaleX(0);
  border-radius: 0 0 0 var(--radius-md, 12px);
}

.sl-toast__progress--active {
  animation: toast-progress-shrink linear forwards;
}

@keyframes toast-progress-shrink {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

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

  .sl-toast {
    padding: 14px 36px 14px 16px;
    gap: 12px;
  }

  .sl-toast__icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}
