/* ==========================================================================
   Toast notifications, shared by the playback page (index.html) and the fleet
   live map (fleet.html); created by public/js/toast.js.
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 16px; /* sits over the bottom panel (z-index), so collapsing it doesn't move the toast */
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000; /* above the loader and Leaflet */
  display: flex;
  flex-direction: column-reverse; /* newest toast nearest the bottom */
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  --toast-color: #dc2626;
  --toast-bg: #fef2f2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px 12px 14px;
  background: #fff;
  border-left: 4px solid var(--toast-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  animation: toast-in 0.25s ease-out;
}

.toast-warning { --toast-color: #d97706; --toast-bg: #fffbeb; }
.toast-info { --toast-color: #2563eb; --toast-bg: #eff6ff; }

.toast-out {
  animation: toast-out 0.2s ease-in forwards;
}

.toast-icon {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--toast-bg);
  color: var(--toast-color);
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.toast-message {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: #4b5563;
  overflow-wrap: anywhere;
}

.toast-close {
  flex: none;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9ca3af;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.toast-close:hover {
  background: #f3f4f6;
  color: #374151;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(12px); }
}
