:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-accent: #f72585;
    /* Neon Pinkish */
    --secondary-accent: #4cc9f0;
    /* Neon Blue */
    --text-main: #ffffff;
    --text-muted: #b3b3b3;
    --font-family: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Dynamic Background */
.background-ambient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    z-index: -1;
}

.background-ambient::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle at 50% 50%, rgba(76, 201, 240, 0.15), transparent 50%);
    animation: moveAmbient 20s infinite alternate ease-in-out;
}

.background-ambient::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    bottom: 0px;
    right: 0px;
    background: radial-gradient(circle at 80% 80%, rgba(247, 37, 133, 0.1), transparent 40%);
    animation: pulseAmbient 10s infinite alternate ease-in-out;
}

@keyframes moveAmbient {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-5%, -5%);
    }
}

@keyframes pulseAmbient {
    0% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Layout */
.app-container {
    display: flex;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    overflow: hidden;
}

/* Sidebar */
.playlist-sidebar {
    width: 300px;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.playlist {
    list-style: none;
    overflow-y: auto;
}

.playlist li {
    display: flex;
    align-items: center;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.playlist li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist li.active {
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary-accent);
}

.song-index {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 16px;
    font-variant-numeric: tabular-nums;
}

.playlist li.active .song-index {
    color: var(--secondary-accent);
}

.song-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main */
.player-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
}

.player-card {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.visualizer-container {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.disk-visual {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--secondary-accent), var(--primary-accent), var(--secondary-accent));
    position: relative;
    box-shadow: 0 0 30px rgba(76, 201, 240, 0.3);
    animation: rotateDisk 10s linear infinite;
    animation-play-state: paused;
}

.disk-visual::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-dark);
}

.playing .disk-visual {
    animation-play-state: running;
    box-shadow: 0 0 50px rgba(247, 37, 133, 0.4);
}

@keyframes rotateDisk {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.track-info {
    margin-bottom: 30px;
}

.track-info h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #fff, #b3b3b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.track-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Controls */
.controls-container {
    width: 100%;
}

.progress-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type=range] {
    -webkit-appearance: none;
    margin: 0 15px;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    /* Taller */
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    /* Brighter base */
    border-radius: 5px;
}

input[type=range]::-webkit-slider-thumb {
    height: 20px;
    /* Larger thumb */
    width: 20px;
    border-radius: 50%;
    background: #fff;
    /* White for max contrast */
    border: 2px solid var(--primary-accent);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    /* Centering relative to 8px track */
    box-shadow: 0 0 15px var(--primary-accent);
    /* Stronger glow */
    transition: transform 0.1s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    color: var(--secondary-accent);
    transform: scale(1.1);
}

.control-btn.sm svg {
    width: 28px;
    height: 28px;
}

.control-btn.main {
    background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
    border-radius: 50%;
    width: 64px;
    height: 64px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.control-btn.main:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

.hidden {
    display: none;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: 100%;
        width: 100%;
        border-radius: 0;
        border: none;
    }

    .playlist-sidebar {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

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

    .disk-visual {
        width: 150px;
        height: 150px;
    }
}