/* ===== Player Bar ===== */
.player-bar {
    grid-column: 1 / -1;
    background: linear-gradient(180deg, #181818, #0a0a0a);
    border-top: 1px solid #ffffff10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 50;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 280px;
    min-width: 200px;
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background: var(--bg-highlight);
    overflow: hidden;
    flex-shrink: 0;
}

.player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-meta {
    overflow: hidden;
    min-width: 0;
}

.player-title {
    display: block;
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    display: block;
    font-size: .75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.player-artist:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.like-btn.liked svg {
    fill: var(--accent);
    stroke: var(--accent);
}

/* ===== Player Controls ===== */
.player-controls {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.play-btn {
    width: 40px;
    height: 40px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 50%;
}

.play-btn:hover {
    transform: scale(1.06);
    color: var(--bg-primary);
}

.progress-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.progress-track {
    flex: 1;
    height: 4px;
    background: #ffffff30;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height .1s;
}

.progress-track:hover {
    height: 6px;
}

.progress-track:hover .progress-thumb {
    opacity: 1;
}

.progress-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    width: 0%;
    position: relative;
    transition: background .2s;
}

.progress-track:hover .progress-fill {
    background: var(--accent);
}

.progress-thumb {
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .2s;
}

.time {
    font-size: .7rem;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ===== Player Extra ===== */
.player-extra {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 280px;
    justify-content: flex-end;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-track {
    width: 100px;
    height: 4px;
    background: #ffffff30;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: background .2s;
}

.volume-track:hover .volume-fill {
    background: var(--accent);
}

#shuffleBtn.active,
#repeatBtn.active {
    color: var(--accent);
}

#shuffleBtn.active::after,
#repeatBtn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}

#shuffleBtn,
#repeatBtn {
    position: relative;
}

/* ===== Queue Panel ===== */
.queue-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: var(--player-height);
    width: 360px;
    background: var(--bg-secondary);
    border-left: 1px solid #ffffff10;
    z-index: 40;
    display: flex;
    flex-direction: column;
    animation: slideIn .3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #ffffff10;
}

.queue-header h3 {
    font-size: 1.1rem;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

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

.queue-item:hover {
    background: #ffffff10;
}

.queue-item.active {
    background: #ffffff15;
}

.queue-item-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-highlight);
}

.queue-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-info {
    flex: 1;
    overflow: hidden;
}

.queue-item-title {
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    font-size: .75rem;
    color: var(--text-secondary);
}

.queue-item-duration {
    font-size: .75rem;
    color: var(--text-muted);
}

/* ===== Mobile Player ===== */
@media (max-width: 768px) {
    .app {
        grid-template-rows: 1fr auto;
    }

    .player-bar {
        position: fixed;
        bottom: 52px; /* above mobile nav */
        left: 0;
        right: 0;
        padding: 6px 12px 4px;
        flex-wrap: wrap;
        gap: 2px;
        align-content: center;
        z-index: 55;
        grid-column: auto;
    }

    /* Row 1: Track info + play button */
    .player-track-info {
        flex: 1;
        min-width: 0;
        order: 1;
    }

    .player-cover {
        width: 40px;
        height: 40px;
    }

    .player-title {
        font-size: .82rem;
    }

    .player-artist {
        font-size: .7rem;
    }

    .like-btn {
        display: none;
    }

    /* Row 2: Controls + progress */
    .player-controls {
        flex: 1 1 100%;
        order: 3;
        max-width: 100%;
        gap: 2px;
    }

    .player-buttons {
        gap: 12px;
    }

    .player-buttons .btn-icon {
        width: 28px;
        height: 28px;
    }

    .play-btn {
        width: 36px !important;
        height: 36px !important;
    }

    .progress-bar {
        display: flex;
        width: 100%;
    }

    .progress-track {
        height: 4px;
    }

    .time {
        font-size: .65rem;
        min-width: 30px;
    }

    #shuffleBtn, #repeatBtn {
        display: none;
    }

    .player-extra {
        order: 2;
        width: auto;
    }

    #queueBtn {
        display: none;
    }

    .volume-control {
        display: none;
    }

    .queue-panel {
        width: 100%;
        bottom: 52px;
    }

    .main-content {
        margin-bottom: 160px; /* player + nav */
    }
}
