/*
    Music player — fixed bottom‑right corner.
    Uses theme variables so it follows light ↔ dark transitions.
*/

.music-player {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 100;

    min-width: 220px;
    max-width: 320px;

    padding: 8px 12px;

    border: 2px solid var(--ui-color);
    border-radius: 4px;

    background-color: var(--background-color);
    color: var(--ui-color);

    font-family: monospace;
    font-size: 13px;

    transition:
        background-color var(--theme-transition-duration) ease,
        color var(--theme-transition-duration) ease,
        border-color var(--theme-transition-duration) ease;
}

.music-player__meta {
    display: flex;
    gap: 6px;

    margin-bottom: 6px;

    overflow: hidden;
    white-space: nowrap;
}

.music-player__title {
    font-weight: bold;
}

.music-player__artist {
    opacity: 0.65;
}

.music-player__artist::before {
    content: '— ';
}

/* Hide artist when empty. */
.music-player__artist:empty {
    display: none;
}

.music-player__controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.music-player__btn {
    flex: 0 0 auto;

    width: 28px;
    height: 24px;
    padding: 0;

    border: 1px solid var(--ui-color);
    border-radius: 2px;
    background: transparent;
    color: var(--ui-color);

    font-family: monospace;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;

    transition: background-color 120ms ease;
}

.music-player__btn:hover {
    background: color-mix(in srgb, var(--ui-color) 16%, transparent);
}

.music-player__btn--play {
    width: 32px;
}

.music-player__volume {
    flex: 1 1 auto;

    width: 40px;
    height: 4px;

    appearance: none;
    -webkit-appearance: none;
    background: color-mix(in srgb, var(--ui-color) 22%, transparent);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.music-player__volume::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 10px;
    height: 10px;

    border: 0;
    border-radius: 2px;
    background: var(--ui-color);
    cursor: pointer;
}

.music-player__volume::-moz-range-thumb {
    width: 10px;
    height: 10px;

    border: 0;
    border-radius: 2px;
    background: var(--ui-color);
    cursor: pointer;
}

.music-player__seek-row {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-top: 5px;
}

.music-player__time {
    flex: 0 0 auto;

    min-width: 64px;

    font-size: 11px;
    white-space: nowrap;
}

.music-player__seek {
    flex: 1 1 auto;

    height: 4px;

    appearance: none;
    -webkit-appearance: none;
    background: color-mix(in srgb, var(--ui-color) 22%, transparent);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.music-player__seek::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 10px;
    height: 10px;

    border: 0;
    border-radius: 2px;
    background: var(--ui-color);
    cursor: pointer;
}

.music-player__seek::-moz-range-thumb {
    width: 10px;
    height: 10px;

    border: 0;
    border-radius: 2px;
    background: var(--ui-color);
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .music-player {
        transition: none;
    }
}
