/* ── LeLibrary Toast System ─────────────────────────────── */
/* Standalone toast notifications. Include on any page.      */
/* Usage: LeToast.show('Message', 'error'|'success'|'info') */

:root {
  --toast-bg: #161619;
  --toast-border: #222228;
  --toast-text: #d4d4d8;
  --toast-muted: #71717a;
  --toast-amber: #f59e0b;
  --toast-red: #ef4444;
  --toast-green: #22c55e;
  --toast-blue: #3b82f6;
  --toast-font: 'Space Grotesk', -apple-system, sans-serif;
  --toast-mono: 'DM Mono', 'Menlo', monospace;
}

.letoast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

@media (max-width: 480px) {
  .letoast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
}

.letoast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--toast-bg);
  border: 1px solid var(--toast-border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.2);
  font-family: var(--toast-font);
  font-size: 0.85rem;
  color: var(--toast-text);
  min-width: 280px;
  max-width: 420px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: letoastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.letoast.removing {
  animation: letoastOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes letoastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes letoastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}

.letoast-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.letoast.error .letoast-icon {
  background: rgba(239, 68, 68, 0.12);
  color: var(--toast-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.letoast.success .letoast-icon {
  background: rgba(34, 197, 94, 0.12);
  color: var(--toast-green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.letoast.info .letoast-icon {
  background: rgba(245, 158, 11, 0.12);
  color: var(--toast-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.letoast-text {
  flex: 1;
  line-height: 1.45;
  color: var(--toast-text);
}

.letoast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--toast-muted);
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: all 0.15s;
}

.letoast-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--toast-text);
}

/* Progress bar */
.letoast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 10px 10px;
  transition: width linear;
}

.letoast.error .letoast-bar { background: var(--toast-red); }
.letoast.success .letoast-bar { background: var(--toast-green); }
.letoast.info .letoast-bar { background: var(--toast-amber); }

/* Hover pauses the timer */
.letoast:hover .letoast-bar {
  animation-play-state: paused !important;
}
