:root {
    --purple-glow: rgba(147, 51, 234, 0.4);
    --pink-glow: rgba(236, 72, 153, 0.4);
    --text-main: #ffffff;
    --text-sub: #cbd5e1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Background ambient light effects */
body::before, body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    z-index: 0;
    filter: blur(100px);
}
body::before { top: 15%; left: 20%; background: var(--purple-glow); }
body::after { bottom: 15%; right: 20%; background: var(--pink-glow); }

/* Glassmorphism Card Core Architecture */
.player-container {
    position: relative;
    z-index: 10;
}

.player-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 30px;
    width: 350px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transition: transform 0.3s ease;
}

.player-card:hover {
    transform: translateY(-5px);
}

/* UI Elements */
.album-art {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 25px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-card:hover .album-art img {
    transform: scale(1.05);
}

.track-details h2 {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.track-details h3 {
    color: var(--text-sub);
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 25px;
}

/* Seek Bar Synchronization Mechanics */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.time {
    color: var(--text-sub);
    font-size: 0.75rem;
    width: 35px;
}

.progress-bar-wrapper {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 10px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #a855f7, #ec4899);
    border-radius: 10px;
    position: relative;
    transition: width 0.1s linear; /* Essential for passive 60fps tracking */
}

/* Audio Control State Palette */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.play-main {
    width: 55px;
    height: 55px;
    background: #ffffff;
    color: #0f172a;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.3);
}

.play-main:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.5);
}

/* Volume Subsystem Layout */
.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.volume-container i {
    color: var(--text-sub);
    font-size: 0.85rem;
}

#volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
/* Playlist Container Subsystem */
.playlist-section {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    text-align: left;
}

.playlist-header h4 {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}

.playlist-tracks {
    max-height: 180px; /* Limits size and forces scrollbar */
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for sleek modern tracking UI */
.playlist-tracks::-webkit-scrollbar {
    width: 4px;
}
.playlist-tracks::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Individual Playlist Track Row Architecture */
.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background 0.2s ease;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.playlist-item.active {
    background: rgba(168, 85, 247, 0.2); /* Soft purple tint for playing track */
    border-left: 3px solid #a855f7;
}

.playlist-item img {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
}

.playlist-item-info {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-title {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
}

.playlist-item-artist {
    color: var(--text-sub);
    font-size: 0.75rem;
}