/* web/static/css/plModal.css */
/* Hard, isolated styles for the Add-to-playlist / picker modals. */

.pl-modal {
  position: fixed;
  inset: 0;
  z-index: 450000; /* above header(300000) and everything else */
  display: none;   /* JS sets to block */
  font-family: sans-serif;
}

.pl-modal[aria-hidden="false"] {
  display: block;
}

.pl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.pl-modal-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  max-height: min(80vh, 680px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.25);
  border: 1px solid rgba(0,0,0,0.12);
}

.pl-modal-header {
  padding: 12px 14px;
  background: #f6f6f6;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pl-modal-title {
  font-weight: 800;
}

.pl-modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1em;
  padding: 4px 10px;
  border-radius: 8px;
}

.pl-modal-close:hover {
  background: rgba(0,0,0,0.06);
}

.pl-modal-body {
  padding: 12px 14px 14px;
}

.pl-modal-create {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pl-modal-create input {
  width: min(340px, 70vw);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.14);
}

.pl-modal-create button {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  cursor: pointer;
}

.pl-modal-section-title {
  font-weight: 800;
  margin: 12px 0 8px;
}

.pl-modal-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pl-modal-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 10px;
  margin-bottom: 8px;
  min-width: 0;
  background: #fff;
}

.pl-modal-list li > div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-modal-list button {
  flex: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  cursor: pointer;
}

.pl-modal-status {
  margin-top: 10px;
  min-height: 1.2em;
  color: #345;
}

/* Dark mode */
.dark-mode .pl-modal-dialog {
  background: var(--bg-secondary);
  color: var(--fg-primary);
  border: 1px solid var(--border);
}

.dark-mode .pl-modal-header {
  background: color-mix(in oklab, var(--bg-secondary) 80%, #000 20%);
  border-bottom: 1px solid var(--border);
}

.dark-mode .pl-modal-list li,
.dark-mode .pl-modal-create input,
.dark-mode .pl-modal-create button,
.dark-mode .pl-modal-list button {
  background: var(--bg-input);
  color: var(--fg-primary);
  border: 1px solid var(--border);
}

.dark-mode .pl-modal-status {
  color: var(--fg-secondary);
}