/*
 * Media Store — Playlists (page, dropdown, grids). Dark, glassmorphism.
 */

/* ── Add-to-Playlist dropdown ────────────────────────────────────────────── */
.mst-pl-drop {
	position: absolute; z-index: 9600; min-width: 240px; max-width: 280px;
	background: rgba(28,28,34,0.98);
	-webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
	border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
	box-shadow: 0 14px 40px rgba(0,0,0,0.55); padding: 6px; color: #fff;
}
.mst-pl-drop__head { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,0.5); padding: 6px 10px; }
.mst-pl-drop__list { max-height: 260px; overflow-y: auto; }
.mst-pl-drop__item {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 8px;
	color: #fff; font-size: 0.85rem; text-align: left; cursor: pointer;
}
.mst-pl-drop__item:hover { background: rgba(255,255,255,0.1); }
.mst-pl-drop__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mst-pl-drop__count { color: rgba(255,255,255,0.4); font-size: 0.72rem; flex-shrink: 0; }
.mst-pl-drop__empty, .mst-pl-drop__loading { color: rgba(255,255,255,0.5); font-size: 0.8rem; padding: 10px; text-align: center; }
.mst-pl-drop__new { display: flex; gap: 6px; padding: 8px 6px 4px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 4px; }
.mst-pl-drop__input { flex: 1; min-width: 0; padding: 6px 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; color: #fff; font-size: 0.8rem; }
.mst-pl-drop__create { padding: 6px 12px; background: var(--mst-accent,#5c6ef4); border: 0; border-radius: 6px; color: #fff; font-size: 0.8rem; cursor: pointer; }
.mst-pl-drop__create:disabled { opacity: 0.5; cursor: default; }

/* ── Playlist page hero ──────────────────────────────────────────────────── */
.mst-pl-hero { position: relative; overflow: hidden; }
.mst-pl-hero__bg { position: absolute; inset: 0; z-index: 0; }
.mst-pl-hero__bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(48px) brightness(0.45) saturate(1.5); transform: scale(1.2); }
.mst-pl-hero__inner {
	position: relative; z-index: 1; display: flex; gap: 28px; align-items: flex-end;
	max-width: 1100px; margin: 0 auto; padding: 48px 24px 32px;
}
.mst-pl-hero__cover {
	width: 200px; height: 200px; flex-shrink: 0; border-radius: 12px; overflow: hidden;
	box-shadow: 0 20px 50px rgba(0,0,0,0.55); background: rgba(255,255,255,0.06);
	display: flex; align-items: center; justify-content: center;
}
.mst-pl-hero__cover img { width: 100%; height: 100%; object-fit: cover; }
.mst-pl-hero__cover--placeholder,
.mst-pl-card__placeholder {
	background: linear-gradient(135deg, #5c6ef4, #b14ee8 60%, #ff6ad5);
	color: rgba(255,255,255,0.85);
}
.mst-pl-hero__cover .dashicons { font-size: 64px; width: 64px; height: 64px; }
.mst-pl-hero__meta { min-width: 0; color: #fff; }
.mst-pl-hero__eyebrow { display: flex; align-items: center; gap: 10px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.mst-pl-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.62rem; letter-spacing: .04em; }
.mst-pl-badge--public   { background: rgba(99,210,172,.2); color: #63d2ac; }
.mst-pl-badge--unlisted { background: rgba(240,180,60,.2); color: #f0b43c; }
.mst-pl-badge--private  { background: rgba(255,255,255,.14); color: rgba(255,255,255,.7); }
.mst-pl-hero__title { font-size: clamp(1.8rem,4vw,3rem); font-weight: 900; margin: 8px 0; line-height: 1.05; letter-spacing: -.02em; }
.mst-pl-hero__desc { font-size: 0.9rem; opacity: .8; max-width: 640px; }
.mst-pl-hero__stats { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; opacity: .65; margin: 8px 0 16px; }
.mst-pl-hero__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Track table ─────────────────────────────────────────────────────────── */
.mst-pl-body { max-width: 1100px; margin: 0 auto; padding: 16px 24px 80px; }
.mst-pl-empty { color: rgba(255,255,255,0.5); text-align: center; padding: 40px; }
.mst-pl-table { width: 100%; border-collapse: collapse; color: #fff; }
.mst-pl-table thead th {
	text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .05em;
	color: rgba(255,255,255,0.45); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mst-pl-table__num { width: 44px; text-align: center; }
.mst-pl-table__dur { width: 64px; text-align: right; }
.mst-pl-table__act { width: 84px; }
.mst-pl-row { cursor: pointer; transition: background 0.12s; }
.mst-pl-row:hover, .mst-pl-row:focus-within { background: rgba(255,255,255,0.06); }
.mst-pl-row.is-dragging { opacity: 0.4; }
.mst-pl-row.is-over td { box-shadow: inset 0 2px 0 var(--mst-accent,#5c6ef4); }
.mst-pl-row td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
.mst-pl-table__num { text-align: center; color: rgba(255,255,255,0.45); font-variant-numeric: tabular-nums; position: relative; }
.mst-pl-row__playicon { display: none; }
.mst-pl-row:hover .mst-pl-row__num, .mst-pl-row:focus-within .mst-pl-row__num { display: none; }
.mst-pl-row:hover .mst-pl-row__playicon, .mst-pl-row:focus-within .mst-pl-row__playicon { display: inline-block; }
.mst-pl-row__title { display: block; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mst-pl-row__artist { display: block; font-size: 0.75rem; color: rgba(255,255,255,0.55); }
.mst-pl-table__album { color: rgba(255,255,255,0.6); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.mst-pl-table__dur { text-align: right; color: rgba(255,255,255,0.5); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.mst-pl-table__act { white-space: nowrap; }
.mst-pl-row__btn {
	width: 28px; height: 28px; background: none; border: 0; border-radius: 50%;
	color: rgba(255,255,255,0.55); cursor: pointer; opacity: 0;
	display: inline-flex; align-items: center; justify-content: center; transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.mst-pl-row:hover .mst-pl-row__btn, .mst-pl-row:focus-within .mst-pl-row__btn { opacity: 1; }
.mst-pl-row__btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
.mst-pl-row__remove:hover { color: #ff5a6a; }

/* ── Lazy-load sentinel ──────────────────────────────────────────────────── */
.mst-pl-sentinel td { text-align: center; padding: 18px; }
.mst-pl-sentinel .mst-spinner { display: inline-block; }
.mst-pl-sentinel.is-done { display: none; }

/* ── Screen-reader-only live region ──────────────────────────────────────── */
.mst-sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Keyboard-grabbed row ────────────────────────────────────────────────── */
.mst-pl-row.is-grabbed { background: rgba(92,110,244,0.22); outline: 2px solid var(--mst-accent,#5c6ef4); outline-offset: -2px; }
.mst-pl-row:focus-visible { outline: 2px solid var(--mst-accent,#5c6ef4); outline-offset: -2px; }

/* ── Inline edit bar (cover + fields) ────────────────────────────────────── */
.mst-pl-editbar { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; padding: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
.mst-pl-edit-fields { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mst-pl-edit-title { padding: 8px 10px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: #fff; font-size: 0.9rem; min-width: 220px; }
.mst-pl-edit-vis { padding: 8px 10px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; color: #fff; }

/* Cover uploader */
.mst-pl-cover-edit { display: flex; gap: 12px; align-items: flex-start; }
.mst-pl-cover-drop {
	width: 110px; height: 110px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
	border: 2px dashed rgba(255,255,255,0.2); background: rgba(255,255,255,0.05);
	display: flex; align-items: center; justify-content: center; cursor: pointer; text-align: center;
	transition: border-color 0.15s, background 0.15s;
}
.mst-pl-cover-drop:hover, .mst-pl-cover-drop:focus-visible { border-color: var(--mst-accent,#5c6ef4); outline: none; }
.mst-pl-cover-drop.is-dragover { border-color: var(--mst-accent,#5c6ef4); background: rgba(92,110,244,0.15); }
.mst-pl-cover-drop.is-uploading { opacity: 0.6; pointer-events: none; }
.mst-pl-cover-preview { width: 100%; height: 100%; object-fit: cover; }
.mst-pl-cover-hint { font-size: 0.7rem; color: rgba(255,255,255,0.5); padding: 6px; }
.mst-pl-cover-btns { display: flex; flex-direction: column; gap: 6px; }

/* ── Library controls (search / sort / filter / view) ────────────────────── */
.mst-pl-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.mst-pl-search {
	flex: 1; min-width: 180px; padding: 9px 12px;
	background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
	border-radius: 8px; color: #fff; font-size: 0.875rem;
}
.mst-pl-search::placeholder { color: rgba(255,255,255,0.4); }
.mst-pl-search:focus { outline: none; border-color: var(--mst-accent,#5c6ef4); }
.mst-pl-sort, .mst-pl-filter-vis {
	padding: 9px 10px; background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: #fff; font-size: 0.8125rem; cursor: pointer;
}
.mst-pl-viewtoggle { display: inline-flex; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; overflow: hidden; }
.mst-pl-viewtoggle button {
	display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
	background: rgba(255,255,255,0.04); border: 0; color: rgba(255,255,255,0.55); cursor: pointer; transition: background 0.12s, color 0.12s;
}
.mst-pl-viewtoggle button:hover { color: #fff; }
.mst-pl-viewtoggle button.is-active { background: var(--mst-accent,#5c6ef4); color: #fff; }

/* List view */
.mst-pl-grid--list { display: block; }
.mst-pl-listrow {
	display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px;
	color: #fff; text-decoration: none; transition: background 0.12s;
}
.mst-pl-listrow:hover { background: rgba(255,255,255,0.07); }
.mst-pl-listrow__cover { width: 44px; height: 44px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; }
.mst-pl-listrow__cover img { width: 100%; height: 100%; object-fit: cover; }
.mst-pl-listrow__cover .mst-pl-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.mst-pl-listrow__title { flex: 1; min-width: 0; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mst-pl-listrow__count, .mst-pl-listrow__vis, .mst-pl-listrow__updated { font-size: 0.78rem; color: rgba(255,255,255,0.5); flex-shrink: 0; }
.mst-pl-listrow__vis { text-transform: capitalize; }
@media (max-width: 640px) { .mst-pl-listrow__updated, .mst-pl-listrow__vis { display: none; } }

/* Add-to-playlist mini buttons in queue / full player */
.mst-q-row__addpl, .mst-fp__next-addpl {
	width: 26px; height: 26px; flex-shrink: 0; background: none; border: 0; border-radius: 50%;
	color: rgba(255,255,255,0.5); cursor: pointer; opacity: 0;
	display: inline-flex; align-items: center; justify-content: center; transition: opacity 0.12s, color 0.12s, background 0.12s;
}
.mst-q-row:hover .mst-q-row__addpl, .mst-fp__next-item:hover .mst-fp__next-addpl { opacity: 1; }
.mst-q-row__addpl:hover, .mst-fp__next-addpl:hover { color: #fff; background: rgba(255,255,255,0.12); }

/* ── Playlist grids (cards) ──────────────────────────────────────────────── */
.mst-pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.mst-pl-grid__loading, .mst-pl-grid__empty { grid-column: 1 / -1; text-align: center; color: rgba(255,255,255,0.5); padding: 24px; }
.mst-pl-card { display: flex; flex-direction: column; gap: 8px; }
.mst-pl-card__cover {
	aspect-ratio: 1; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,0.05); box-shadow: 0 8px 22px rgba(0,0,0,0.3); transition: transform 0.15s;
}
.mst-pl-card__cover:hover { transform: translateY(-2px); }
.mst-pl-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.mst-pl-card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.mst-pl-card__placeholder.dashicons { font-size: 44px; }
.mst-pl-card__title { font-size: 0.875rem; font-weight: 600; color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mst-pl-card__title:hover { text-decoration: underline; }
.mst-pl-card__meta { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin: 0; }
.mst-pl-card__vis { text-transform: capitalize; }

/* Library / browse section spacing */
.mst-pl-section { margin: 0 0 40px; }
.mst-pl-section__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mst-pl-section__title { font-size: 1.1rem; font-weight: 700; margin: 0; }

@media (max-width: 640px) {
	.mst-pl-hero__inner { flex-direction: column; align-items: flex-start; gap: 18px; }
	.mst-pl-hero__cover { width: 150px; height: 150px; }
	.mst-pl-table__album { display: none; }
}
