/* assets/styles/soundRoom.css */

/* Container */
.sound-room-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-xl);
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-lg);
    z-index: 20;
    position: relative;
    color: var(--text-color);
}

/* 1. Player (Left/Top) */
.player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 350px;
    padding: 30px;
    border-radius: 24px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background: rgba(255, 255, 255, 0.05);
    /* Very subtle glass */
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .player-card {
    background: rgba(255, 255, 255, 0.2);
}

/* Album Art (Square) */
.album-art-container {
    width: 280px;
    height: 280px;
    position: relative;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

.album-cover {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    z-index: 10;
    position: relative;
    /* "Our Taste": Subtle inner border or glass sheen */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Glow Effect behind the cover */
.album-glow {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: inherit;
    /* Requires JS to copy img src or use a filter */
    border-radius: 12px;
    filter: blur(20px);
    opacity: 0.5;
    z-index: 1;
    /* Fallback glow if image inheritance isn't easy */
    background: var(--text-color);
    transition: opacity 0.5s ease;
    opacity: 0;
}



/* Playing State: Scale up slightly */
.album-art-container.playing {
    transform: scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.album-art-container.playing .album-glow {
    opacity: 0.6;
    animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
    from {
        opacity: 0.4;
        transform: scale(0.9);
    }

    to {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Controls */
.player-controls {
    margin-top: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.ctl-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctl-btn.large {
    width: 56px;
    height: 56px;
    font-size: 20px;
    border-color: var(--text-color);
}

.ctl-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Waveform Visualizer (Placeholder) */
.waveform-container {
    margin-top: 24px;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.wave-bar {
    width: 3px;
    height: 10px;
    background: var(--text-color);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
    opacity: 0.5;
}

.wave-bar:nth-child(even) {
    animation-duration: 1.2s;
}

.wave-bar:nth-child(3n) {
    animation-duration: 0.8s;
}

.player-card:not(.playing) .wave-bar {
    animation-play-state: paused;
    height: 4px !important;
    /* Flatline */
}

@keyframes wave {

    0%,
    100% {
        height: 10px;
        opacity: 0.5;
    }

    50% {
        height: 24px;
        opacity: 1;
    }
}

/* 2. Playlist (Right) */
.playlist-panel {
    flex: 1;
    min-width: 300px;
    /* Glass Container style */
    background: var(--glass-container-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    max-height: 500px;
    overflow-y: auto;
}

.playlist-header {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.track-item.active {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
}

.track-img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.track-info {
    display: flex;
    flex-direction: column;
}

.track-title {
    font-size: 14px;
    font-weight: 500;
}

.track-artist {
    font-size: 11px;
    color: var(--text-muted);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sound-room-container {
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .player-card {
        width: 100%;
    }

    .playlist-panel {
        width: 100%;
        min-width: unset;
    }
}