/* Shared music player — present on every page */

.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #1a1a1a 0%, #252525 100%);
    border-top: 1px solid rgba(255, 234, 167, 0.1);
    z-index: 2000;
    transition: transform 0.3s ease;
    padding-bottom: env(safe-area-inset-bottom);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.music-player.hidden {
    transform: translateY(100%);
}

/* Collapsed Mini Player */
.player-collapsed {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    cursor: pointer;
}

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

.player-mini-art {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}

.player-mini-info {
    flex: 1;
    min-width: 0;
}

.player-mini-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-mini-artist {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.player-mini-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.player-btn:active { transform: scale(0.95); }

.player-btn svg { width: 24px; height: 24px; }

.player-btn--play {
    background: #ffeaa7;
    color: #1a1a1a;
}

.player-btn--play svg { width: 20px; height: 20px; }

.player-mini-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.player-mini-progress-bar {
    height: 100%;
    background: #ffeaa7;
    width: 0%;
    transition: width 0.1s linear;
}

/* Expanded Player */
.player-expanded-content {
    display: none;
    flex-direction: column;
    padding: 20px;
    padding-top: 12px;
}

.player-expanded .player-expanded-content { display: flex; }

.player-expand-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 16px;
    cursor: pointer;
}

.player-album-art {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    margin: 0 auto 20px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.player-info {
    text-align: center;
    margin-bottom: 20px;
}

.player-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.player-artist {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.player-progress { margin-bottom: 16px; }

.player-progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.player-progress-bar {
    height: 100%;
    background: #ffeaa7;
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.player-progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.player-progress-bar-container:hover .player-progress-bar::after { opacity: 1; }

.player-time {
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.player-btn--main {
    width: 56px;
    height: 56px;
    background: #ffeaa7;
    color: #1a1a1a;
}

.player-btn--main svg { width: 28px; height: 28px; }

.player-btn--secondary { color: rgba(255, 255, 255, 0.7); }

.player-btn--secondary:hover { color: #fff; }

/* Body padding so content doesn't sit under the player */
body.has-player {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* Desktop: center the player, keep it tidy */
@media (min-width: 769px) {
    .music-player {
        left: 50%;
        transform: translateX(-50%);
        max-width: 420px;
        border-radius: 16px 16px 0 0;
        border-left: 1px solid rgba(255, 234, 167, 0.1);
        border-right: 1px solid rgba(255, 234, 167, 0.1);
    }

    .music-player.hidden {
        transform: translateX(-50%) translateY(100%);
    }
}

/* Places detail panel: sit above the player when one is loaded */
body.has-player .detail {
    bottom: 70px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    height: calc(92vh - 70px);
}
