/* Sidebar Now Playing Widget */
.sidebar-now-playing {
    margin-top: 1.5rem;
    width: 100%;
    animation: fadeSlideUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

.spotify-widget-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.spotify-widget-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(29, 185, 84, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Pulsing effect when playing */
.spotify-widget-card.playing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: #1DB954;
    box-shadow: 0 0 8px rgba(29, 185, 84, 0.5);
}

.spotify-widget-art-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.spotify-widget-art {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.spotify-widget-vinyl-groove {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
    /* Only show on hover or specific design choice */
}

/* Pulse animation on the album art if playing */
.spotify-widget-card.playing .spotify-widget-art {
    animation: albumPulse 2s infinite ease-in-out;
}

@keyframes albumPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.spotify-widget-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    /* for truncation */
}

.spotify-widget-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1DB954;
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1DB954;
    display: inline-block;
}

.spotify-widget-card.playing .status-dot {
    animation: pulseDot 1.5s infinite ease-in-out;
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }
}

.spotify-widget-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.spotify-widget-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

/* Waveform Visualizer (CSS only) */
.spotify-widget-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    margin-left: auto;
    /* Push to right */
    opacity: 0.5;
}

.spotify-widget-card.playing .spotify-widget-visualizer {
    opacity: 1;
}

.visualizer-bar {
    width: 3px;
    background: #1DB954;
    border-radius: 2px;
    height: 4px;
}

.spotify-widget-card.playing .visualizer-bar {
    animation: visualize 0.8s ease-in-out infinite alternate;
}

.visualizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.visualizer-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.visualizer-bar:nth-child(3) {
    animation-delay: 0.4s;
}

.visualizer-bar:nth-child(4) {
    animation-delay: 0.1s;
}

@keyframes visualize {
    0% {
        height: 4px;
    }

    100% {
        height: 12px;
    }
}

@media (max-width: 768px) {
    .spotify-widget-card {
        padding: 0.8rem 1rem;
    }

    .spotify-widget-art-wrapper {
        width: 40px;
        height: 40px;
    }
}