/* ─────────────────────────────────────────────────────────────────────── */
/* Toast Component — Notifications (bottom right)                           */
/* ─────────────────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────────────── */
/* Toast Container                                                           */
/* ─────────────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Toast                                                                     */
/* ─────────────────────────────────────────────────────────────────────── */

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background-color: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in 0.25s ease;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.success {
  border-color: var(--st-accepted);
  background-color: var(--st-accepted-bg);
  color: var(--st-accepted);
}

.toast.error {
  border-color: var(--t-bug);
  background-color: var(--t-bug-bg);
  color: var(--t-bug);
}

.toast.warning {
  border-color: var(--st-progress);
  background-color: var(--st-progress-bg);
  color: var(--st-progress);
}

.toast.info {
  border-color: var(--accent);
  background-color: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Toast Icon                                                                */
/* ─────────────────────────────────────────────────────────────────────── */

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 14px;
}

.toast.success .toast-icon::before {
  content: "✓";
  font-weight: 600;
}

.toast.error .toast-icon::before {
  content: "✕";
  font-weight: 600;
}

.toast.warning .toast-icon::before {
  content: "⚠";
}

.toast.info .toast-icon::before {
  content: "ℹ";
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Toast Content                                                             */
/* ─────────────────────────────────────────────────────────────────────── */

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.toast-title {
  font-weight: 500;
  font-size: 13px;
}

.toast-message {
  font-size: 12px;
  opacity: 0.9;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Toast Close Button                                                        */
/* ─────────────────────────────────────────────────────────────────────── */

.toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition-colors);
  font-size: 14px;
}

.toast-close:hover {
  opacity: 1;
}

.toast-close::before {
  content: "✕";
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Toast Progress Bar                                                        */
/* ─────────────────────────────────────────────────────────────────────── */

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background-color: currentColor;
  border-radius: 0 0 var(--radius) 0;
  animation: toast-progress 4s linear forwards;
}

@keyframes toast-progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Responsive                                                                */
/* ─────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }

  .toast {
    max-width: unset;
  }
}
