/* Playlist header ------------------------------------------------------ */

.playlist-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #23262b 0%, #2f3339 100%);
    border-left: 4px solid #ff6600;
    border-radius: 8px;
}

.playlist-title {
    margin: 0;
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.playlist-icon {
    color: #ff6600;
    font-size: 24px;
}

.track-count {
    color: #8b949e;
    font-size: 13px;
    margin-left: auto;
    white-space: nowrap;
}

/* Table ---------------------------------------------------------------- */

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #30363d;
}

#playlist-table {
    table-layout: fixed;
    width: 100%;
    min-width: 990px;
    background-color: #1a1a1a;
    color: #e6e6e6;
    margin-bottom: 0;
}

#playlist-table th {
    background: #0d1117;
    border-bottom: 2px solid #ff6600;
    border-right: 1px solid #30363d;
    color: #ff6600;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 10px 12px;
    position: relative;
    user-select: none;
    text-align: left;
}

#playlist-table td {
    background-color: #202429;
    border-bottom: 1px solid #2c3138;
    border-right: 1px solid #2c3138;
    color: #e6e6e6;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 8px 12px;
    font-size: 13px;
}

#playlist-table th:last-child,
#playlist-table td:last-child {
    border-right: none;
}

#playlist-table th.sortable {
    cursor: pointer;
}

#playlist-table th.sortable:hover {
    color: #ffffff;
}

#playlist-table th.sortable[aria-sort="ascending"],
#playlist-table th.sortable[aria-sort="descending"] {
    color: #ffffff;
}

.sort-indicator {
    display: inline-block;
    width: 10px;
    margin-left: 3px;
    color: #ff6600;
}

#playlist-table tbody tr:nth-child(even) td {
    background-color: #1c2025;
}

#playlist-table tbody tr:hover td {
    background-color: #2b3037;
}

.cell-title {
    color: #ffffff;
    font-weight: 500;
}

.cell-comment {
    color: #8b949e;
}

.col-play {
    width: 56px;
    text-align: center;
    /* The button is wider than the text budget, so the inherited ellipsis
       rendered a stray "…" next to every play control. */
    padding-left: 6px;
    padding-right: 6px;
    text-overflow: clip;
}

.col-time {
    width: 84px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #8b949e;
}

.missing-marker {
    color: #6e7681;
}

/* Now playing ---------------------------------------------------------- */

#playlist-table tbody tr.currently-playing td {
    background-color: #2d2a24;
    color: #ffffff;
}

#playlist-table tbody tr.currently-playing td:first-child {
    box-shadow: inset 3px 0 0 #ff6600;
}

/* Play button ---------------------------------------------------------- */

.play-button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    padding: 0;
    background: #30363d;
    border: 1px solid #444c56;
    color: #e6e6e6;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.play-button:hover:not(:disabled) {
    background: #ff6600;
    border-color: #ff6600;
    color: #1a1a1a;
}

.play-button.playing {
    background: #ff6600;
    border-color: #ff8833;
    color: #1a1a1a;
}

.play-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.play-button .play-icon {
    pointer-events: none;
}

/* Loading spinner replaces the icon, so the button never lies about state. */
.play-button .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #ff6600;
    border-radius: 50%;
    animation: play-spin 0.7s linear infinite;
}

.play-button.loading {
    cursor: progress;
}

@keyframes play-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .play-button .spinner { animation-duration: 2s; }
}

/* Column resizer ------------------------------------------------------- */

.column-resizer {
    position: absolute;
    right: -2px;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
}

.column-resizer:hover {
    background: #ff6600;
}

.col-added {
    width: 108px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #8b949e;
}

/* Expandable set detail ------------------------------------------------ */

.col-expand {
    width: 30px;
    text-align: center;
    padding-left: 4px;
    padding-right: 0;
    text-overflow: clip;
}

.expander {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 12px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
    transition: transform 0.15s ease, color 0.15s ease;
}

.expander:hover { color: #ff6600; }
.expander.open { transform: rotate(90deg); color: #ff6600; }

#playlist-table tbody tr.set-detail-row td {
    background: #14181d;
    padding: 0;
    border-bottom: 1px solid #2c3138;
}

.set-detail { padding: 0.9rem 1.1rem 1.1rem 2.4rem; }

.set-detail-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}

.set-detail-head label {
    color: #ff9d4d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.set-detail-head select {
    background: #0d1117;
    color: #e6e6e6;
    border: 1px solid #30363d;
    border-radius: 5px;
    padding: 0.3rem 0.5rem;
    font-size: 12px;
    max-width: 460px;
}

.set-detail-count { color: #8b949e; font-size: 12px; }

.link-button.small { font-size: 11px; }

.set-tracklist {
    margin: 0;
    padding-left: 1.6rem;
    color: #c9d1d9;
    font-size: 12px;
    columns: 2;
    column-gap: 2.5rem;
}

.set-tracklist li {
    padding: 2px 0;
    break-inside: avoid;
}

.set-track-title { color: #ffffff; }
.set-track-artist { color: #8b949e; }
.set-track-artist::before { content: " — "; }
.set-track-time { color: #6e7681; float: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
    .set-tracklist { columns: 1; }
}

/* Unmatched tracks ------------------------------------------------------ */

.missing-list { margin-top: 0.6rem; }

.missing-list ul {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.8rem;
    background: #1c2025;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 12px;
}

.missing-list li { padding: 2px 0; }

.missing-name { color: #e6e6e6; }

.missing-path {
    display: block;
    color: #6e7681;
    /* Traktor paths are long; keep them on one line so the list stays scannable. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

.missing-hint {
    margin: 0.5rem 0 0;
    color: #8b949e;
    font-size: 11px;
}
