/* ============================================================
   selection_picker.css — saving events into selections, on every page (base.html): the "Запази в"
   dialog (playlists/partials/picker.html, selection_picker.js), the sign-in one (signin.html), the
   "Запазено · Промени" note and a card taken out of your own selection (base.js). In the
   selections' colours; the dialogs are sheets from the bottom on phones.
   ============================================================ */

.selp {
  width: min(440px, calc(100vw - 32px)); max-width: none; max-height: min(640px, calc(100vh - 48px));
  margin: auto; /* the site's reset zeroes it, and a modal dialog centres with it */
  padding: 0; border: 0; border-radius: 22px; background: #ffffff; color: #1b1b24;
  box-shadow: 0 24px 60px rgba(27, 16, 51, 0.28); font-family: inherit; overflow: hidden;
}
.selp::backdrop { background: rgba(20, 10, 40, 0.45); }
.selp [hidden] { display: none !important; }
.selp__inner {
  display: flex; flex-direction: column; gap: 14px; box-sizing: border-box;
  max-height: inherit; padding: 18px 20px 20px; overflow-y: auto;
}
.selp__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.selp__title { margin: 0; font-size: 19px; line-height: 24px; font-weight: 800; color: #1b1b24; }
.selp__close {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: #f4effb; color: #4b2a8a; cursor: pointer;
}
.selp__close:hover { background: #ebe2f8; }
.selp__close svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.selp__part { display: flex; flex-direction: column; gap: 14px; }
.selp div[data-pl-state] { display: grid; gap: 14px; } /* "Направи публична": the text, then the buttons */
.selp__note { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: #5b5070; }

.selp__lists { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.selp__item {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 8px 14px; box-sizing: border-box;
  border: 1px solid #e3d9f2; border-radius: 14px; background: #ffffff; color: #1b1b24;
  font: inherit; text-align: left; cursor: pointer;
}
.selp__item:hover { border-color: #c4afea; background: #faf7fe; }
.selp__item[aria-pressed="true"] { border-color: #6b3bb5; background: #f4effb; }
.selp__item[aria-busy="true"] { cursor: progress; }
.selp__check {
  display: grid; place-items: center; width: 24px; height: 24px; box-sizing: border-box;
  border: 2px solid #c4afea; border-radius: 8px; color: transparent;
}
.selp__check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.selp__item[aria-pressed="true"] .selp__check { border-color: #6b3bb5; background: #6b3bb5; color: #ffffff; }
.selp__name { font-size: 15px; line-height: 20px; font-weight: 700; overflow-wrap: anywhere; }
.selp__count { font-size: 12.5px; line-height: 16px; font-weight: 600; color: #6e6388; white-space: nowrap; }

.selp__new { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid #efe9f7; }
.selp__lists[hidden] + .selp__note + .selp__new,
.selp__lists:empty + .selp__note + .selp__new { padding-top: 0; border-top: 0; }
.selp__hint { margin: 0; font-size: 12.5px; line-height: 17px; font-weight: 500; color: #6e6388; }
.selp__label { font-size: 13px; line-height: 18px; font-weight: 700; color: #4b2a8a; }
.selp__row { display: flex; gap: 8px; }
.selp__input {
  flex: 1; min-width: 0; height: 46px; box-sizing: border-box; padding: 0 14px;
  border: 1px solid #ddd2ee; border-radius: 12px; background: #ffffff; color: #1b1b24;
  font-family: inherit; font-size: 15px; font-weight: 600;
}
.selp__input::placeholder { color: #8a7ca2; font-weight: 500; }
.selp__input:focus { outline: none; border-color: #6b3bb5; box-shadow: 0 0 0 3px rgba(107, 59, 181, 0.18); }
.selp__btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  height: 46px; padding: 0 20px; box-sizing: border-box; border: 0; border-radius: 12px;
  background: #6b3bb5; color: #ffffff; font-family: inherit; font-size: 14px; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.selp__btn:hover { background: #5a2f9c; color: #ffffff; }
.selp__btn[disabled] { opacity: 0.6; cursor: progress; }
.selp__part > .selp__btn { align-self: flex-start; }
.selp__btn--danger { background: #b3261e; }
.selp__btn--danger:hover { background: #951f18; }
.selp__btn--ghost { border: 1px solid #e3d9f2; background: #ffffff; color: #4b2a8a; }
.selp__btn--ghost:hover { border-color: #c4afea; background: #f4effb; color: #4b2a8a; }
.selp__all { align-self: flex-start; font-size: 14px; line-height: 20px; font-weight: 700; color: #6b3bb5; text-decoration: none; }
.selp__all:hover { text-decoration: underline; }
.selp__error { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fdf0ef; color: #a1241b; font-size: 13.5px; line-height: 19px; font-weight: 600; }
.selp__sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.selp :focus-visible { outline: 2px solid #6b3bb5; outline-offset: 2px; }
.selp__input:focus-visible { outline: none; }

/* "Запазено в „Запазени събития“ · Промени" */
.ev-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120; display: flex; align-items: center; gap: 14px;
  /* left: 50% would cap a shrink-to-fit width at half the screen: size it to its text instead */
  width: max-content; max-width: min(520px, calc(100vw - 32px)); padding: 12px 12px 12px 18px; box-sizing: border-box;
  border-radius: 14px; background: #1b1b24; color: #ffffff; box-shadow: 0 14px 34px rgba(20, 10, 40, 0.3);
  font-size: 14px; line-height: 20px; font-weight: 600;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.ev-toast:empty { display: none; }
.ev-toast.is-shown { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition-delay: 0s; }
.ev-toast__action {
  flex: none; height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.14);
  color: #d9c6ff; font-family: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.ev-toast__action:hover { background: rgba(255, 255, 255, 0.22); }
.ev-toast__action:focus-visible { outline: 2px solid #d9c6ff; outline-offset: 2px; }

/* An event taken out of your own selection: it stays until you leave, faded. */
.ev-card.is-removed { opacity: 0.45; transition: opacity 0.2s ease; }
.ev-card.is-removed .ev-fav { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .ev-toast { transition: none; }
}

@media (max-width: 560px) {
  .ev-toast { bottom: 16px; }
  .selp {
    width: 100%; max-height: 85vh; margin: auto 0 0; border-radius: 22px 22px 0 0;
  }
}
