/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-hover: #252540;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --text-muted: #666680;
    --border: rgba(255, 255, 255, 0.06);
    --success: #00cec9;
    --danger: #ff4757;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* ===== APP LAYOUT ===== */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ===== LEFT PANEL ===== */
.left-panel {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    overflow-y: auto;
}

.left-panel::-webkit-scrollbar {
    width: 4px;
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 32px;
    padding: 0 8px;
}

.logo i {
    font-size: 28px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-box {
    position: relative;
    margin-bottom: 24px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* ===== PLAYLIST ===== */
.playlist {
    flex: 1;
    overflow-y: auto;
}

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

.playlist::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 14px;
    margin-bottom: 4px;
}

.song-item:hover {
    background: var(--bg-hover);
}

.song-item.active {
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
}

.song-item .song-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.song-item .song-details {
    flex: 1;
    min-width: 0;
}

.song-item .song-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item .song-artist-small {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.song-item .song-duration-mini {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== MAIN PLAYER ===== */
.main-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow-y: auto;
}

.player-header {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.now-playing-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.player-actions {
    display: flex;
    gap: 8px;
}

.player-actions button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.player-actions button:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--accent);
}

.player-actions button.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* ===== ALBUM ART ===== */
.album-section {
    margin-bottom: 32px;
}

.album-art-container {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px var(--accent-glow);
}

.album-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.album-art.playing {
    animation: spin 20s linear infinite;
}

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

.equalizer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.equalizer.visible {
    opacity: 1;
}

.equalizer .bar {
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    animation: equalizerBounce 0.5s ease-in-out infinite alternate;
}

.equalizer .bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.equalizer .bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.equalizer .bar:nth-child(3) { height: 15px; animation-delay: 0.2s; }
.equalizer .bar:nth-child(4) { height: 25px; animation-delay: 0.3s; }
.equalizer .bar:nth-child(5) { height: 12px; animation-delay: 0.15s; }
.equalizer .bar:nth-child(6) { height: 22px; animation-delay: 0.25s; }
.equalizer .bar:nth-child(7) { height: 18px; animation-delay: 0.05s; }
.equalizer .bar:nth-child(8) { height: 28px; animation-delay: 0.35s; }

@keyframes equalizerBounce {
    0% { transform: scaleY(0.3); }
    100% { transform: scaleY(1); }
}

/* ===== SONG INFO ===== */
.song-info {
    text-align: center;
    margin-bottom: 24px;
}

.song-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.song-artist {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===== PROGRESS BAR ===== */
.progress-section {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: height 0.15s ease;
}

.progress-bar:hover {
    height: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 6px var(--accent-glow);
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.progress-knob {
    display: none;
}

/* ===== PLAY/PAUSE BUTTON ===== */
.play-pause-main {
    width: 72px !important;
    height: 72px !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-light)) !important;
    border: none !important;
    color: white !important;
    font-size: 28px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 8px 30px var(--accent-glow) !important;
}

.play-pause-main:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.5) !important;
}

/* ===== BOTTOM CONTROLS ===== */
.bottom-controls {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-container i {
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
}

.volume-slider {
    width: 100px;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 80%;
    transition: width 0.1s ease;
}

.volume-knob {
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.extra-controls {
    display: flex;
    gap: 8px;
}

.extra-controls button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.extra-controls button:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* ===== VISUALIZER OVERLAY ===== */
.visualizer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.visualizer-overlay.active {
    display: flex;
}

.visualizer-overlay canvas {
    width: 100%;
    height: 100%;
}

.close-visualizer {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
    z-index: 1001;
}

.close-visualizer:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .left-panel {
        width: 100%;
        min-width: unset;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .app-container {
        flex-direction: column;
    }

    .album-art-container {
        width: 220px;
        height: 220px;
    }

    .main-player {
        padding: 20px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.song-item {
    animation: fadeIn 0.3s ease forwards;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}