/* Shared styles for the web interface and the OBS dock. Dark by default to match OBS. */
:root {
    --bg: #15161c;
    --surface: #1f2029;
    --surface-2: #2a2b36;
    --border: #363745;
    --fg: #ececf1;
    --muted: #9a9bab;
    --accent: #7c5cff;
    --accent-fg: #ffffff;
    --danger: #ff5c6c;
    --ok: #3ccf8e;
    --radius: 8px;
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f4f4f7;
        --surface: #ffffff;
        --surface-2: #ececf2;
        --border: #d8d8e2;
        --fg: #1b1c22;
        --muted: #636474;
        --accent: #6a4cf0;
        color-scheme: light;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

select,
input:not([type]),
input[type="search"],
input[type="text"],
input[type="number"] {
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

/* ---------- Control panel ---------- */

.ctl {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ctl-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctl-overlay {
    flex: 1;
}

.ctl-conn {
    width: 10px;
    height: 10px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--danger);
    flex: none;
}

.ctl-conn.is-online {
    background: var(--ok);
}

.ctl-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ctl-body[hidden],
.ctl-body section[hidden] {
    display: none;
}

.ctl-empty {
    color: var(--muted);
}

.ctl-now {
    padding: 12px;
    border-radius: var(--radius);
    background: var(--surface);
}

.ctl-title {
    font-size: 16px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctl-artist {
    min-height: 1.45em;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctl-bar {
    height: 4px;
    margin-top: 10px;
    border-radius: 2px;
    background: var(--surface-2);
    overflow: hidden;
}

.ctl-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.5s linear;
}

.ctl-times {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.ctl-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.ctl-btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    cursor: pointer;
}

.ctl-btn svg,
.ctl-volume svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.ctl-btn.ctl-play {
    background: var(--accent);
    color: var(--accent-fg);
}

.ctl-volume {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    color: var(--muted);
}

.ctl-volume input {
    flex: 1;
    min-width: 0;
    accent-color: var(--accent);
}

.ctl-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.ctl-meta.is-warning {
    color: var(--danger);
}

.ctl-label {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.ctl-moods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ctl-chip {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
}

.ctl-chip.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-fg);
}

.ctl-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ctl-row select {
    flex: 1;
}

.ctl-check {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.ctl-loop {
    color: var(--muted);
}

.ctl-query {
    width: 100%;
}

.ctl-results {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}

.ctl-results button {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: none;
    text-align: left;
    cursor: pointer;
}

.ctl-results button:hover,
.ctl-results button:focus-visible {
    background: var(--surface-2);
}

.ctl-r-title,
.ctl-r-artist {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ctl-r-artist,
.ctl-r-empty {
    font-size: 12px;
    color: var(--muted);
}

.ctl-r-empty {
    padding: 6px 8px;
}

.ctl-toast {
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--danger);
    color: #fff;
}
