/*
 * Toast oznámení (showToast v features/connection-search/form.js).
 * Světle žlutá karta v pravém dolním rohu jako panely webu dpmhk.cz: tučný černý nadpis i text,
 * volitelné tlačítko akce a křížek. Bez ikony, spodního proužku a stínů.
 *
 * Pravidla jdou přes #toast-container: šablona webu stylizuje každý <button> a <p>
 * a slabší selektor by prohrál.
 */
#toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none; /* prázdné místo kolem toastů neblokuje klikání */
}

#toast-container .toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
  padding: 14px 12px 14px 18px;
  overflow: hidden;
  border: 1px solid var(--spoje-yellow-border);
  border-radius: 16px;
  background: var(--spoje-yellow);
  box-shadow: none;
  color: #000;
  font-family: var(--spoje-font);
  text-align: left;
  pointer-events: auto;

  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#toast-container .toast.show {
  opacity: 1;
  transform: none;
}

#toast-container .toast.hide {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#toast-container .toast-body {
  flex: 1;
  min-width: 0;
}

#toast-container .toast-title {
  margin: 0 0 2px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #000;
}

#toast-container .toast-message {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #000;
  overflow-wrap: anywhere;
}

/* Reset stylu šablony pro <button> — jinak dědí její pozadí, okraje i rozměry */
#toast-container .toast-action {
  all: unset;
  box-sizing: border-box;
  flex: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: #000;
  color: var(--spoje-yellow);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#toast-container .toast-action:hover {
  background: #2b2b2b;
}

#toast-container .toast-close {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #3a3a3a;
  cursor: pointer;
}

#toast-container .toast-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
}

#toast-container .toast-action:focus-visible,
#toast-container .toast-close:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

#toast-container .toast-close svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  #toast-container {
    right: 12px;
    bottom: 16px;
    width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #toast-container .toast,
  #toast-container .toast.show,
  #toast-container .toast.hide {
    transition: opacity 0.2s ease;
    transform: none;
  }
}
