/* ------------------------------ empty state ----------------------------- */

.empty-state {
  background: var(--panel-soft);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  display: grid;
  gap: 8px;
  padding: 24px;
}

.empty-state strong {
  color: var(--text);
  font-family: "Baloo 2", "Quicksand", sans-serif;
  font-size: 18px;
}

/* ------------------------------- skeletons ------------------------------ */

.skeleton-row {
  align-items: center;
  background: transparent;
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 56px;
  padding: 5px 8px;
}

.skeleton-block {
  animation: skeleton-shimmer 1.4s ease infinite;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  display: block;
}

.skeleton-art {
  border-radius: var(--radius-sm);
  height: 44px;
  width: 44px;
}

.skeleton-lines {
  display: grid;
  gap: 8px;
}

.skeleton-line {
  height: 10px;
  width: 70%;
}

.skeleton-line.short {
  width: 45%;
}

@keyframes skeleton-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------- playlist menu ---------------------------- */

/* Compact bordered popover, not a floating card stack: hairline edge, tight
 * rows, dash-stitched section divider. */
.playlist-menu {
  animation: menu-in 130ms ease;
  background: #181b2c;
  border: 1px solid rgba(224, 223, 254, 0.14);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 32px rgba(5, 6, 17, 0.5);
  display: grid;
  gap: 1px;
  max-width: min(280px, calc(100vw - 24px));
  min-width: 208px;
  padding: 5px;
  position: fixed;
  z-index: 50;
}

/* Translate/fade only: a scale here would distort the width/height measured
 * right after append and mis-place the menu. */
@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.playlist-menu button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  font-size: 13px;
  font-weight: 500;
  gap: 10px;
  grid-template-columns: 17px minmax(0, 1fr);
  min-height: 34px;
  padding: 0 9px;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}

.playlist-menu button svg {
  color: var(--text-dim);
  height: 16px;
  width: 16px;
}

.playlist-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.playlist-menu button:hover svg {
  color: var(--text);
}

.playlist-menu button.active,
.playlist-menu button.active svg {
  color: var(--amber);
}

.playlist-menu-empty {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 9px 5px;
}

.playlist-menu-label {
  border-top: 1px dashed rgba(224, 223, 254, 0.16);
  color: var(--blue-soft-dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-top: 5px;
  padding: 9px 9px 3px;
  text-transform: uppercase;
}

/* Same stitched-outline affordance as "Show more": creates something new. */
.playlist-menu button.playlist-menu-create {
  border: 1px dashed rgba(224, 223, 254, 0.25);
  color: var(--text-dim);
  margin-top: 4px;
}

.playlist-menu button.playlist-menu-create:hover {
  background: transparent;
  border-color: var(--amber-line);
  color: var(--amber);
}

.playlist-menu button.playlist-menu-create:hover svg {
  color: var(--amber);
}

/* Inline naming row: the same stitched outline as the create affordances it
 * replaces, with a bare input inside — no modal. Shared by the menu's New
 * playlist row and the sidebar draft. */
.inline-name-form {
  border: 1px dashed var(--amber-line);
  border-radius: 6px;
  display: grid;
}

.inline-name-form input {
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  height: 32px;
  outline: none;
  padding: 0 9px;
  width: 100%;
}

.inline-name-form input::placeholder {
  color: var(--text-dim);
}

/* The stitched border is the focus indicator — the global amber halo would
 * drown the dashes. */
.inline-name-form input:focus-visible {
  box-shadow: none;
  outline: none;
}

.inline-name-form:focus-within {
  border-color: var(--amber);
}

/* Empty submit: shake instead of silently creating nothing. */
.inline-name-form.invalid {
  animation: draft-shake 220ms ease;
  border-color: var(--danger);
}

@keyframes draft-shake {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.playlist-menu .inline-name-form {
  margin-top: 4px;
}

/* Destructive entries (e.g. right-click → Delete playlist). */
.playlist-menu button.menu-danger,
.playlist-menu button.menu-danger svg {
  color: var(--danger);
}

.playlist-menu button.menu-danger:hover {
  background: var(--danger-soft);
}

.playlist-menu button.menu-danger:hover svg {
  color: var(--danger);
}

/* -------------------------------- dialogs ------------------------------- */

.app-dialog {
  background: rgba(20, 23, 38, 0.99);
  border: 1px solid rgba(224, 223, 254, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--text);
  max-width: min(360px, calc(100vw - 32px));
  padding: 22px;
  width: 100%;
}

.app-dialog::backdrop {
  backdrop-filter: blur(2px);
  background: rgba(5, 6, 17, 0.6);
}

.app-dialog form {
  display: grid;
  gap: 14px;
}

.dialog-title {
  font-family: "Baloo 2", "Quicksand", sans-serif;
  font-size: 19px;
  font-weight: 800;
  margin: 0;
}

.dialog-body {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dialog-actions .primary-action {
  font-size: 13px;
  height: var(--control-md);
}

.dialog-actions .danger-button {
  height: var(--control-md);
  padding: 0 16px;
}

/* --------------------------------- toast -------------------------------- */

.toast {
  background: rgba(32, 34, 72, 0.96);
  border-radius: var(--radius-sm);
  bottom: calc(var(--player-height) + 16px);
  box-shadow: var(--shadow);
  color: var(--iris-text);
  font-size: 13px;
  font-weight: 600;
  left: 50%;
  opacity: 0;
  padding: 10px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: rgba(72, 32, 44, 0.97);
  color: #ffd3dd;
}

