/* Stile Player Musicale Persistente */
#music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.98) 0%, rgba(118, 75, 162, 0.98) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#music-player.active {
    transform: translateY(0);
}

.player-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.player-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

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

.player-title-link {
    text-decoration: none;
    color: white !important;
    display: block;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

.player-title-link:hover {
    color: white !important;
}

.player-title-link:hover .player-title {
    text-decoration: underline;
    opacity: 0.9;
}

.player-title {
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
    cursor: pointer;
    display: inline-block;
    animation: scroll-text 10s linear infinite;
}

@keyframes scroll-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Applica animazione solo se il testo è lungo */
.player-title-link:hover .player-title {
    animation-play-state: paused;
}

.player-artist {
    font-size: 0.85rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.player-artist-link {
    text-decoration: none;
    color: white !important;
    display: block;
    overflow: hidden;
}

.player-artist-link:hover {
    color: white !important;
}

.player-artist-link:hover .player-artist {
    text-decoration: underline;
    opacity: 1;
}

.player-album-link {
    text-decoration: none;
    color: white !important;
    display: block;
    overflow: hidden;
}

.player-album-link:hover {
    color: white !important;
}

.player-album-link:hover .player-album {
    text-decoration: underline;
    opacity: 0.9;
}

.player-album {
    font-size: 0.75rem;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

#player-cover-link {
    flex-shrink: 0;
}

#player-cover-link:hover .player-cover {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.3s;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.player-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.player-btn.play-pause {
    width: 50px;
    height: 50px;
    background: white;
    color: #667eea;
    font-size: 1.2rem;
}

.player-btn.play-pause:hover {
    background: rgba(255, 255, 255, 0.9);
}

.player-progress-container {
    flex: 1;
    min-width: 200px;
}

.player-time {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

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

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

.player-progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 1.5rem;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.song-card:hover .play-button-overlay {
    opacity: 1;
}

.album-card:hover .play-button-overlay {
    opacity: 1;
}

.song-card, .album-card {
    position: relative;
}

.song-cover, .album-cover {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .player-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .player-cover {
        width: 50px;
        height: 50px;
    }
    
    .player-volume {
        display: none;
    }
    
    .player-progress-container {
        width: 100%;
        order: 4;
    }
}

/* Spazio per il player quando è visibile */
body.player-active {
    padding-bottom: 100px;
}
