/* ============================================
   MUSIC.CSS — La Main Saison 2 — Lecteur Audio
   ============================================ */

/* ---- HERO SECTION ---- */
.music-hero {
    position: relative;
    width: 100%;
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 80%, rgba(180, 0, 0, 0.25) 0%, transparent 70%);
    margin-top: 70px;
    padding: 4rem 2rem 3rem;
}

.music-hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.music-hero-content {
    text-align: center;
    z-index: 1;
}

.music-hero-title {
    font-family: var(--font-title);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(255, 51, 51, 0.5);
    line-height: 1.1;
}

.music-hero-title .gold {
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(255, 183, 3, 0.6);
}

.music-hero-sub {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

/* ---- LAYOUT PRINCIPAL ---- */
.music-player-section {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 2rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .music-player-section {
        grid-template-columns: 1fr;
    }
}

/* ---- LECTEUR (colonne gauche) ---- */
.player-wrapper {
    background: rgba(10, 10, 15, 0.9);
    border: 1px solid rgba(255, 51, 51, 0.25);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 0 60px rgba(255, 0, 0, 0.12),
        0 30px 80px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ---- ÉCRAN / POCHETTE ---- */
.player-screen {
    background: linear-gradient(180deg, #0d0508 0%, #12080e 100%);
    padding: 2rem 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 51, 51, 0.15);
}

.player-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(180, 0, 30, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.album-cover-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 340px;
    margin: 0 auto 1.5rem;
    border-radius: 16px;
    overflow: visible;
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    box-shadow:
        0 0 40px rgba(255, 0, 0, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.8);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    position: relative;
    z-index: 2;
}

.album-cover:hover {
    transform: scale(1.02);
    box-shadow:
        0 0 60px rgba(255, 0, 0, 0.5),
        0 30px 80px rgba(0, 0, 0, 0.9);
}

.album-cover-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(255, 51, 51, 0.3) 0%, transparent 70%);
    border-radius: 20px;
    z-index: 1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Effet vinyle (coin bas-droite) */
.vinyl-effect {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: conic-gradient(
        #1a1a1a 0deg,
        #2a2a2a 30deg,
        #1a1a1a 60deg,
        #2a2a2a 90deg,
        #1a1a1a 120deg,
        #2a2a2a 150deg,
        #1a1a1a 180deg,
        #2a2a2a 210deg,
        #1a1a1a 240deg,
        #2a2a2a 270deg,
        #1a1a1a 300deg,
        #2a2a2a 330deg,
        #1a1a1a 360deg
    );
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    z-index: 3;
    transition: transform 0.3s ease;
}

.vinyl-effect.spinning {
    animation: vinylSpin 2s linear infinite;
}

.vinyl-inner {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: rgba(180, 0, 0, 0.15);
    border: 1px solid rgba(255, 51, 51, 0.3);
}

.vinyl-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-red);
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.8);
}

@keyframes vinylSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Infos piste */
.track-info {
    text-align: center;
    margin-bottom: 1rem;
}

.track-title-scroll {
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.track-album {
    font-size: 0.8rem;
    color: rgba(255, 183, 3, 0.7);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.track-number {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Equalizer */
.equalizer {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    height: 24px;
    margin-top: 0.5rem;
}

.equalizer span {
    width: 4px;
    border-radius: 2px;
    background: var(--accent-red);
    height: 4px;
    transition: height 0.1s ease;
}

.equalizer.active span {
    animation: eqBar 0.8s ease-in-out infinite alternate;
}

.equalizer.active span:nth-child(1) { animation-duration: 0.6s; animation-delay: 0.0s; }
.equalizer.active span:nth-child(2) { animation-duration: 0.4s; animation-delay: 0.1s; }
.equalizer.active span:nth-child(3) { animation-duration: 0.7s; animation-delay: 0.2s; }
.equalizer.active span:nth-child(4) { animation-duration: 0.5s; animation-delay: 0.05s; }
.equalizer.active span:nth-child(5) { animation-duration: 0.9s; animation-delay: 0.15s; }
.equalizer.active span:nth-child(6) { animation-duration: 0.3s; animation-delay: 0.25s; }
.equalizer.active span:nth-child(7) { animation-duration: 0.6s; animation-delay: 0.0s; }
.equalizer.active span:nth-child(8) { animation-duration: 0.8s; animation-delay: 0.1s; }
.equalizer.active span:nth-child(9) { animation-duration: 0.5s; animation-delay: 0.2s; }
.equalizer.active span:nth-child(10){ animation-duration: 0.7s; animation-delay: 0.05s; }

@keyframes eqBar {
    0%   { height: 4px; }
    100% { height: 22px; }
}

/* ---- CONTRÔLES (bas du lecteur) ---- */
.player-controls-area {
    padding: 1.5rem 1.5rem 1.5rem;
}

/* Barre de progression */
.progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.time-current, .time-total {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    min-width: 35px;
    font-variant-numeric: tabular-nums;
}

.progress-bar-wrapper {
    flex: 1;
    cursor: pointer;
    padding: 8px 0;
}

.progress-bar-bg {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: visible;
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-red), #ff6666);
    border-radius: 2px;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.8);
    opacity: 0;
    transition: opacity 0.2s ease, left 0.1s linear;
}

.progress-bar-wrapper:hover .progress-thumb {
    opacity: 1;
}

/* Boutons de contrôle */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.ctrl-btn:hover {
    color: #fff;
    transform: scale(1.15);
}

.ctrl-btn.active {
    color: var(--accent-red);
    filter: drop-shadow(0 0 6px rgba(255, 51, 51, 0.8));
}

/* Bouton Play central */
.ctrl-play {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-red), #8b0000);
    border-radius: 50% !important;
    box-shadow:
        0 0 20px rgba(255, 51, 51, 0.4),
        0 8px 20px rgba(0,0,0,0.5);
    color: #fff !important;
    transition: all 0.2s ease !important;
}

.ctrl-play svg {
    width: 22px !important;
    height: 22px !important;
}

.ctrl-play:hover {
    transform: scale(1.1) !important;
    box-shadow:
        0 0 35px rgba(255, 51, 51, 0.7),
        0 12px 30px rgba(0,0,0,0.6) !important;
}

.ctrl-prev svg, .ctrl-next svg {
    width: 24px;
    height: 24px;
}

/* Volume */
.volume-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.volume-icon {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-red);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 51, 51, 0.6);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-red);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(255, 51, 51, 0.6);
}

/* ---- PLAYLIST (colonne droite) ---- */
.playlist-wrapper {
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(255, 51, 51, 0.2);
    border-radius: 20px;
    overflow: hidden;
    max-height: calc(100vh - 280px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 51, 51, 0.15);
    background: rgba(255, 0, 0, 0.04);
    flex-shrink: 0;
}

.playlist-header h3 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
}

.playlist-count {
    font-size: 0.75rem;
    color: rgba(255, 183, 3, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.playlist {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 51, 51, 0.4) transparent;
}

.playlist::-webkit-scrollbar {
    width: 4px;
}

.playlist::-webkit-scrollbar-track {
    background: transparent;
}

.playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 51, 51, 0.4);
    border-radius: 2px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.playlist-item:hover {
    background: rgba(255, 51, 51, 0.08);
    border-left-color: rgba(255, 51, 51, 0.4);
}

.playlist-item.active {
    background: rgba(255, 51, 51, 0.12);
    border-left-color: var(--accent-red);
}

.playlist-item.active .playlist-title {
    color: var(--accent-red);
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

.playlist-item.active .playlist-num {
    color: var(--accent-red);
}

.playlist-num {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    min-width: 24px;
    font-variant-numeric: tabular-nums;
    font-family: monospace;
}

.playlist-icon {
    font-size: 0.75rem;
    opacity: 0.5;
}

.playlist-title {
    flex: 1;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.playlist-duration {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: monospace;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .music-player-section {
        padding: 1rem;
        gap: 1rem;
    }

    .player-screen {
        padding: 1.5rem 1rem 1rem;
    }

    .album-cover-container {
        max-width: 260px;
    }

    .ctrl-play {
        width: 52px;
        height: 52px;
    }

    .controls-row {
        gap: 0.6rem;
    }
}
