/* Player Panel Styles */
.player-panel {
    width: var(--player-width);
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    flex-shrink: 0;
}

/* Now Playing Section */
.now-playing {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    transition: background 0.5s ease;
}

.track-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.track-cover:hover .cover-image {
    transform: scale(1.05);
}

.track-info {
    text-align: center;
}

.track-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-artist {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Player Controls */
.player-controls {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    min-width: 280px;
    overflow: visible;
}

.control-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap;
    min-height: 56px;
}

.control-btn {
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border: none;
    border-radius: 50%;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    flex-grow: 0;
}

.play-pause {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px;
    min-height: 56px;
    max-width: 56px;
    max-height: 56px;
    background: linear-gradient(145deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    flex-grow: 0;
}

.play-pause::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.play-pause:hover::before {
    opacity: 1;
}

.play-pause:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(73, 29, 185, 0.4);
}

.play-pause .play-icon {
    display: block;
    transition: transform 0.2s ease;
}

.play-pause .pause-icon {
    display: none;
    transition: transform 0.2s ease;
}

.play-pause.playing .play-icon {
    display: none;
    transform: scale(0.8);
}

.play-pause.playing .pause-icon {
    display: block;
    transform: scale(1);
}

/* Progress Section */
.progress-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 8px;
    cursor: pointer;
    position: relative;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-track {
    width: 100%;
    height: 100%;
    background: transparent;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    width: 0%;
    transition: width 0.2s ease;
    position: relative;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -7px; /* Centré correctement */
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.progress-bar:hover .progress-handle,
.progress-bar:active .progress-handle {
    opacity: 1;
}

.progress-handle:active {
    transform: translateY(-50%) scale(1.2);
}

/* Volume Section */
.volume-section {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0 1rem;
}

.volume-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.volume-btn:hover {
    background: rgba(29, 185, 84, 0.1);
}

.volume-slider {
    flex: 1;
    height: 6px;
    cursor: pointer;
    background: var(--bg-secondary);
    border-radius: 3px;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.volume-track {
    width: 100%;
    height: 100%;
    background: transparent;
    position: relative;
}

.volume-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    width: 70%; /* Valeur par défaut visible */
    transition: width 0.2s ease;
    position: relative;
}

.volume-handle {
    position: absolute;
    top: 50%;
    right: -6px; /* Centré correctement */
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.volume-slider:hover .volume-handle,
.volume-slider:active .volume-handle {
    opacity: 1;
}

.volume-handle:active {
    transform: translateY(-50%) scale(1.2);
}

/* Queue Section */
.queue-section {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
}

.queue-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.queue-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.queue-item.playing {
    background: rgba(29, 185, 84, 0.1);
}

.queue-item-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.queue-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item.playing .queue-item-title {
    color: var(--accent-primary);
}

.queue-item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.queue-item:hover .queue-item-actions {
    opacity: 1;
}

.queue-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.queue-action-btn:hover {
    background: rgba(112, 29, 185, 0.1);
}

.queue-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.queue-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Playing Animation */
.playing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 0.5rem;
}

.playing-bar {
    width: 3px;
    background: var(--accent-primary);
    border-radius: 1.5px;
    animation: playing 1s ease-in-out infinite;
}

.playing-bar:nth-child(1) {
    height: 10px;
    animation-delay: 0s;
}

.playing-bar:nth-child(2) {
    height: 14px;
    animation-delay: 0.2s;
}

.playing-bar:nth-child(3) {
    height: 8px;
    animation-delay: 0.4s;
}

@keyframes playing {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.4);
    }
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .player-panel {
        width: var(--player-min-width);
    }
}

@media (max-width: 968px) {
    .player-panel {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        border-left: none;
        border-top: 1px solid var(--border-color);
        background: var(--surface-color);
        backdrop-filter: blur(12px);
        height: auto;
        min-height: 140px;
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 1rem;
        gap: 1rem;
    }

    .now-playing {
        padding: 0;
        display: flex;
        align-items: center;
        gap: 1rem;
        background: transparent;
        border-bottom: none;
        flex-shrink: 0;
        width: auto;
    }

    .track-cover {
        width: 60px;
        height: 60px;
        margin: 0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        flex-shrink: 0;
    }

    .play-overlay,
    .play-btn-large {
        display: none;
    }

    .track-info {
        text-align: left;
        min-width: 0;
        width: 120px;
    }

    .track-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }

    .track-artist {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .player-controls {
        padding: 0;
        border-bottom: none;
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: center;
    }

    .control-buttons {
        gap: 1rem;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        flex-shrink: 0;
    }

    .play-pause {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    .progress-section {
        display: none;
    }

    .volume-section {
        display: none;
    }

    .queue-section {
        display: none;
    }
}

@media (max-width: 640px) {
    .player-panel {
        min-height: 120px;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .track-cover {
        width: 50px;
        height: 50px;
    }

    .track-info {
        width: 100px;
    }

    .track-title {
        font-size: 0.85rem;
    }

    .track-artist {
        font-size: 0.75rem;
    }

    .control-buttons {
        gap: 0.75rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .play-pause {
        width: 50px;
        height: 50px;
    }
}