/* ═══════════════════════════════════════════
 *  Hyphen-V Music Player  —  Bricks Element
 * ═══════════════════════════════════════════ */

.hv-player {
    --hv-accent: #00e5a0;
    --hv-bg: #0f0f12;
    --hv-text: #e8e8ec;
    --hv-text-dim: rgba(232, 232, 236, .45);
    --hv-surface: rgba(255, 255, 255, .05);
    --hv-surface-hover: rgba(255, 255, 255, .09);
    --hv-radius: 12px;
    --hv-transition: .2s cubic-bezier(.4, 0, .2, 1);

    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    background: var(--hv-bg);
    color: var(--hv-text);
    border-radius: var(--hv-radius);
    padding: 28px 28px 20px;
    max-width: 460px;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
    position: relative;
    overflow: hidden;
}

/* subtle ambient glow behind cover */
.hv-player::before {
    content: "";
    position: absolute;
    top: -40%;
    left: -20%;
    width: 140%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 20%, var(--hv-accent), transparent 60%);
    opacity: .06;
    pointer-events: none;
    transition: opacity .6s;
}

/* ── Display: cover + meta ── */
.hv-player__display {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

.hv-player__cover-wrap {
    width: 88px;
    height: 88px;
    min-width: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--hv-surface);
    position: relative;
}

.hv-player__cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity .3s;
}

.hv-player__cover.is-loaded {
    opacity: 1;
}

.hv-player__cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hv-text-dim);
    transition: opacity .3s;
}

.hv-player__cover-placeholder svg {
    width: 32px;
    height: 32px;
}

.hv-player__cover.is-loaded + .hv-player__cover-placeholder {
    opacity: 0;
}

.hv-player__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.hv-player__title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-player__artist {
    font-size: 13px;
    color: var(--hv-text-dim);
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Progress ── */
.hv-player__progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.hv-player__time {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--hv-text-dim);
    min-width: 34px;
}

.hv-player__time--total {
    text-align: right;
}

.hv-player__progress {
    flex: 1;
    height: 4px;
    background: var(--hv-surface);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: height var(--hv-transition);
}

.hv-player__progress:hover {
    height: 6px;
}

.hv-player__progress-filled {
    height: 100%;
    background: var(--hv-accent);
    border-radius: 4px;
    width: 0%;
    position: relative;
    transition: background var(--hv-transition);
}

.hv-player__progress-handle {
    position: absolute;
    top: 50%;
    right: -5px;
    width: 10px;
    height: 10px;
    background: var(--hv-accent);
    border-radius: 50%;
    transform: translate(0, -50%) scale(0);
    transition: transform var(--hv-transition);
    pointer-events: none;
}

.hv-player__progress:hover .hv-player__progress-handle {
    transform: translate(0, -50%) scale(1);
}

/* ── Controls ── */
.hv-player__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.hv-player__btn {
    all: unset;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--hv-text-dim);
    transition: color var(--hv-transition), background var(--hv-transition), transform var(--hv-transition);
}

.hv-player__btn svg {
    width: 18px;
    height: 18px;
}

.hv-player__btn:hover {
    color: var(--hv-text);
}

.hv-player__btn:active {
    transform: scale(.92);
}

.hv-player__btn.is-active {
    color: var(--hv-accent);
}

/* Play button — larger */
.hv-player__btn--play {
    width: 48px;
    height: 48px;
    background: var(--hv-accent);
    color: var(--hv-bg);
    margin: 0 6px;
}

.hv-player__btn--play:hover {
    color: var(--hv-bg);
    filter: brightness(1.12);
}

.hv-player__btn--play svg {
    width: 22px;
    height: 22px;
}

/* ── Volume ── */
.hv-player__volume-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.hv-player__btn--vol {
    width: 28px;
    height: 28px;
}

.hv-player__btn--vol svg {
    width: 16px;
    height: 16px;
}

.hv-player__volume {
    flex: 1;
    height: 4px;
    max-width: 110px;
    background: var(--hv-surface);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.hv-player__volume-filled {
    height: 100%;
    width: 80%;
    background: var(--hv-text-dim);
    border-radius: 4px;
    transition: background var(--hv-transition);
}

.hv-player__volume:hover .hv-player__volume-filled {
    background: var(--hv-text);
}

.hv-player__volume-handle {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    background: var(--hv-text);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform var(--hv-transition);
    pointer-events: none;
}

.hv-player__volume:hover .hv-player__volume-handle {
    transform: translate(-50%, -50%) scale(1);
}

/* ── Playlist ── */
.hv-player__playlist {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    position: relative;
    z-index: 1;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--hv-surface-hover) transparent;
}

.hv-player__playlist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--hv-transition);
}

.hv-player__playlist-item:hover {
    background: var(--hv-surface-hover);
}

.hv-player__playlist-item.is-active {
    background: var(--hv-surface);
}

.hv-player__playlist-num {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--hv-text-dim);
    min-width: 18px;
    text-align: right;
}

.hv-player__playlist-item.is-active .hv-player__playlist-num {
    color: var(--hv-accent);
}

.hv-player__playlist-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.hv-player__playlist-title {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-player__playlist-artist {
    font-size: 12px;
    color: var(--hv-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Equaliser animation for active item */
.hv-player__playlist-eq {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    opacity: 0;
    transition: opacity .2s;
}

.hv-player__playlist-item.is-active.is-playing .hv-player__playlist-eq {
    opacity: 1;
}

.hv-player__playlist-eq span {
    display: block;
    width: 3px;
    border-radius: 1px;
    background: var(--hv-accent);
    animation: hvEq .8s ease-in-out infinite alternate;
}

.hv-player__playlist-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.hv-player__playlist-eq span:nth-child(2) { height: 80%; animation-delay: .2s; }
.hv-player__playlist-eq span:nth-child(3) { height: 55%; animation-delay: .4s; }

@keyframes hvEq {
    0%   { height: 25%; }
    100% { height: 100%; }
}

/* ── No-playlist modifier ── */
.hv-player--no-playlist .hv-player__playlist { display: none; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .hv-player {
        padding: 20px 18px 16px;
    }
    .hv-player__cover-wrap {
        width: 68px;
        height: 68px;
        min-width: 68px;
    }
    .hv-player__title { font-size: 15px; }
}
