/* ================================================================
   music-player-dynamic.css — ChordStar Alive Music Player
   ================================================================ */

/* ── Waveform bars (on song cards + rows) ─────────────────────── */
.cs-dyn-wave {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    padding: 0 4px;
    position: absolute;
    bottom: 38px;
    left: 10px;
    z-index: 10;
    pointer-events: none;
}
.cs-dyn-wave span {
    display: block;
    width: 3px;
    background: #d946ef;
    border-radius: 2px;
    animation: cs-wave-bar 0.8s ease-in-out infinite alternate;
    transform-origin: bottom;
}
.cs-dyn-wave span:nth-child(1) { height: 6px;  animation-delay: 0s;    }
.cs-dyn-wave span:nth-child(2) { height: 12px; animation-delay: 0.1s;  }
.cs-dyn-wave span:nth-child(3) { height: 16px; animation-delay: 0.2s;  }
.cs-dyn-wave span:nth-child(4) { height: 10px; animation-delay: 0.15s; }
.cs-dyn-wave span:nth-child(5) { height: 7px;  animation-delay: 0.05s; }

@keyframes cs-wave-bar {
    from { transform: scaleY(0.3); opacity: 0.6; }
    to   { transform: scaleY(1);   opacity: 1;   }
}

/* Waveform in track rows */
.cs-dyn-row .cs-track-art {
    position: relative;
}
.cs-dyn-row .cs-dyn-wave {
    position: absolute;
    bottom: 2px;
    left: 2px;
    height: 14px;
    padding: 0 2px;
}

/* ── Now Playing: card glow ───────────────────────────────────── */
.cs-dyn-card.cs-dyn-playing {
    box-shadow:
        0 0 0 2px #d946ef,
        0 0 20px rgba(217, 70, 239, 0.5),
        0 8px 32px rgba(217, 70, 239, 0.3) !important;
    transform: translateY(-4px) scale(1.02) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.cs-dyn-card.cs-dyn-playing .cs-song-card-play {
    opacity: 0 !important;
}
.cs-dyn-card.cs-dyn-playing .cs-dyn-wave {
    display: flex !important;
}

/* ── Now Playing: row glow ────────────────────────────────────── */
.cs-dyn-row.cs-dyn-playing {
    background: linear-gradient(90deg, rgba(217,70,239,0.12), transparent) !important;
    border-left: 3px solid #d946ef !important;
    padding-left: calc(0.75rem - 3px) !important;
}
.cs-dyn-row.cs-dyn-playing .cs-dyn-wave {
    display: flex !important;
}
.cs-dyn-row.cs-dyn-playing .cs-track-art-play {
    opacity: 0 !important;
}

/* ── Card hover ──────────────────────────────────────────────── */
.cs-dyn-card {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.cs-dyn-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(217, 70, 239, 0.25);
}
.cs-dyn-card:hover .cs-song-card-play {
    opacity: 1 !important;
    transform: scale(1.1);
}

/* ── Badges (NEW, rank, liked) ───────────────────────────────── */
.cs-dyn-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}
.cs-dyn-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.cs-dyn-badge--new {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    animation: cs-badge-pulse 2s ease-in-out infinite;
}
.cs-dyn-badge--rank {
    background: rgba(217, 70, 239, 0.85);
    color: #fff;
    backdrop-filter: blur(4px);
}
.cs-dyn-badge--liked {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
}

@keyframes cs-badge-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
    50%       { box-shadow: 0 0 14px rgba(16, 185, 129, 0.8); }
}

/* ── Play count under card title ──────────────────────────────── */
.cs-dyn-play-count {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
    min-height: 14px;
    transition: color 0.2s;
}
.cs-dyn-playing .cs-dyn-play-count {
    color: #d946ef;
}

/* ── Trending row extras ─────────────────────────────────────── */
.cs-dyn-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-left 0.2s;
    border-left: 3px solid transparent;
    position: relative;
}
.cs-dyn-row:hover {
    background: rgba(217, 70, 239, 0.08);
}
.cs-dyn-row-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}
.cs-dyn-fire {
    font-size: 1rem;
    animation: cs-fire-bob 1.5s ease-in-out infinite alternate;
}
@keyframes cs-fire-bob {
    from { transform: translateY(0) rotate(-3deg); }
    to   { transform: translateY(-3px) rotate(3deg); }
}
.cs-dyn-heart {
    color: #ef4444;
    font-size: 0.85rem;
}
.cs-track-rank--hot {
    color: #f97316 !important;
    font-weight: 800 !important;
}

/* ── Live dot (trending section) ──────────────────────────────── */
.cs-dyn-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: cs-live-pulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
}
@keyframes cs-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);  }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);    }
}

/* ── Greeting bar ─────────────────────────────────────────────── */
.cs-dyn-greeting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, rgba(217,70,239,0.08), rgba(168,85,247,0.06));
    border: 1px solid rgba(217,70,239,0.15);
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 0.5rem;
    animation: cs-greet-in 0.4s ease both;
}
@keyframes cs-greet-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0);    }
}
.cs-dyn-greeting-text {
    font-size: 0.9rem;
    color: #d4b8ff;
    font-weight: 500;
}
.cs-dyn-stats {
    display: flex;
    gap: 1rem;
}
.cs-dyn-stat {
    font-size: 0.78rem;
    color: #888;
}
.cs-dyn-stat-num {
    font-weight: 700;
    color: #d946ef;
    margin-right: 3px;
}

/* ── Section stagger-in animation ────────────────────────────── */
.cs-dyn-section {
    animation: cs-section-in 0.45s ease both;
}
.cs-dyn-section:nth-child(1) { animation-delay: 0.05s; }
.cs-dyn-section:nth-child(2) { animation-delay: 0.10s; }
.cs-dyn-section:nth-child(3) { animation-delay: 0.15s; }
.cs-dyn-section:nth-child(4) { animation-delay: 0.20s; }
.cs-dyn-section:nth-child(5) { animation-delay: 0.25s; }
.cs-dyn-section:nth-child(6) { animation-delay: 0.30s; }

@keyframes cs-section-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ── Artist grid ──────────────────────────────────────────────── */
.cs-dyn-artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    padding: 0.25rem 0;
}
.cs-dyn-artist-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    text-align: center;
    gap: 0.6rem;
}
.cs-dyn-artist-card:hover {
    background: rgba(217, 70, 239, 0.1);
    border-color: rgba(217, 70, 239, 0.3);
    transform: translateY(-3px);
}
.cs-dyn-artist-img-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(217, 70, 239, 0.3);
    flex-shrink: 0;
}
.cs-dyn-artist-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.cs-dyn-artist-card:hover .cs-dyn-artist-img-wrap img {
    transform: scale(1.08);
}
.cs-dyn-artist-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 60%, rgba(217,70,239,0.2));
    pointer-events: none;
}
.cs-dyn-artist-info { width: 100%; }
.cs-dyn-artist-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-dyn-artist-meta {
    font-size: 0.7rem;
    color: #888;
    margin-top: 2px;
}

/* ── Uploaded song thumb ─────────────────────────────────────── */
.cs-dyn-upload-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(135deg, rgba(217,70,239,0.2), rgba(168,85,247,0.2));
}
.cs-dyn-uploaded {
    border: 1px dashed rgba(217, 70, 239, 0.4) !important;
}

/* ── Section title italic (artist spotlight) ──────────────────── */
.cs-section-title em {
    font-style: normal;
    color: #d946ef;
}

/* ── Responsive: smaller artist grid on mobile ───────────────── */
@media (max-width: 600px) {
    .cs-dyn-artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    .cs-dyn-artist-img-wrap {
        width: 64px;
        height: 64px;
    }
    .cs-dyn-greeting {
        flex-direction: column;
    }
}

/* ── Bottom player "alive" equalizer enhancement ─────────────── */
.cs-eq.playing .cs-eq-bar {
    animation-play-state: running !important;
}
.cs-eq-bar {
    animation-play-state: paused;
}

/* ── Smooth scroll for main area ─────────────────────────────── */
.cs-player-main {
    scroll-behavior: smooth;
}
