/* ============================================
   Nyce Music - Audio Player Styles
   ============================================ */

.player-bar {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(30px);
    border-top: 1px solid var(--border-default);
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: var(--space-4);
    z-index: var(--z-player);
    height: var(--player-height);
}

/* Nothing loaded yet — the bar (and the layout space reserved for it)
   should not exist at all, not just be visually empty. */
.player-bar:not(.has-track) {
    display: none;
}

/* ── Now Playing (Left) ── */
.player-track-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.player-track-art {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base);
}

.player-track-art.playing {
    animation: float 3s ease-in-out infinite;
}

.player-track-details {
    min-width: 0;
}

.player-track-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-track-artist {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-like-btn {
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    flex-shrink: 0;
    background: none;
    border: none;
    padding: var(--space-2);
}

.player-like-btn:hover { color: var(--secondary-500); }
.player-like-btn.liked { color: var(--secondary-500); }

/* ── Player Controls (Center) ── */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    font-size: 1.1rem; /* Added for FA icons */
}

.player-btn:hover { color: var(--text-primary); transform: scale(1.1); }
.player-btn.active { color: var(--primary-500); }

.player-btn-play {
    width: 44px;
    height: 44px;
    background: var(--primary-500) !important; /* Use Audiomack Orange */
    color: var(--bg-primary) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.25rem; /* Larger icon */
}

.player-btn-play .fa-play {
    margin-left: 3px; /* Center play icon visually */
}

.player-btn-play:hover {
    transform: scale(1.08);
    background: var(--primary-400) !important;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.4);
}

/* ── Progress Bar ── */
.player-progress {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    max-width: 600px;
}

.player-time {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: center;
}

.player-equalizer {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 30px;
    gap: 2px;
    cursor: pointer;
    position: relative;
}

.eq-bar {
    flex: 1;
    background: var(--neutral-700);
    border-radius: 2px 2px 0 0;
    min-width: 2px;
    height: 10%;
    transition: background 0.2s, height 0.1s;
}

.eq-bar.active {
    background: var(--primary-500); /* Colored bar */
}

.player-bar.playing .eq-bar.active {
    animation: eq-bounce 0.8s infinite alternate ease-in-out;
}

/* Give bars random animation delays via nth-child in JS or CSS */
@keyframes eq-bounce {
    0%   { height: 10%; }
    100% { height: 100%; }
}

/* ── Volume & Extra Controls (Right) ── */
.player-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: var(--neutral-800);
    border-radius: var(--radius-full);
    cursor: pointer;
    position: relative;
}

.volume-filled {
    height: 100%;
    background: var(--text-primary);
    border-radius: var(--radius-full);
}

.volume-slider:hover .volume-filled { background: var(--primary-500); }

/* ── Expand / Maximize ── */
.player-expand-btn {
    color: var(--text-muted);
}

.player-minimize-btn {
    display: none;
}

.player-expanded-bg {
    display: none;
}

.player-bar.expanded {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    grid-template-columns: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-10) var(--space-6);
    background: var(--bg-primary);
    border-top: none;
}

.player-bar.expanded .player-expanded-bg {
    display: block;
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.35) saturate(1.3);
    transform: scale(1.1);
    z-index: 0;
}

.player-bar.expanded > *:not(.player-expanded-bg) {
    position: relative;
    z-index: 1;
}

.player-bar.expanded .player-minimize-btn {
    display: flex;
    position: absolute;
    top: var(--space-6);
    left: var(--space-6);
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--transition-fast);
}
.player-bar.expanded .player-minimize-btn:hover { background: rgba(255, 255, 255, 0.16); }

.player-bar.expanded .player-expand-btn { display: none; }

.player-bar.expanded .player-track-info {
    flex-direction: column;
    text-align: center;
    gap: var(--space-5);
}

.player-bar.expanded .player-track-art {
    width: min(320px, 60vw);
    height: min(320px, 60vw);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.player-bar.expanded .player-track-details { min-width: 0; max-width: 480px; }
.player-bar.expanded .player-track-title { font-size: var(--text-2xl); white-space: normal; }
.player-bar.expanded .player-track-artist { font-size: var(--text-base); white-space: normal; }
.player-bar.expanded .player-like-btn { font-size: 1.4rem; }

.player-bar.expanded .player-controls {
    width: 100%;
    max-width: 480px;
}

.player-bar.expanded .player-buttons { gap: var(--space-5); }
.player-bar.expanded .player-btn { font-size: 1.3rem; }
.player-bar.expanded .player-btn-play { width: 64px; height: 64px; font-size: 1.6rem; }
.player-bar.expanded .player-progress { max-width: none; }
.player-bar.expanded .player-equalizer { height: 40px; }

.player-bar.expanded .player-extras {
    justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .player-bar {
        grid-template-columns: 1fr auto;
        padding: 0 var(--space-4);
        height: 72px;
    }
    .player-extras { display: none; }
    .player-controls { flex-direction: row; }
    .player-progress { display: none; }
    .player-track-art { width: 44px; height: 44px; }
}
