* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #22d3ee;
    --success: #10b981;
    --border: #334155;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.player-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.6s ease;
}

/* Upload Area */
.upload-area {
    text-align: center;
    padding: 60px 20px;
    border: 3px dashed var(--border);
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* Player Interface */
.player-interface {
    animation: fadeIn 0.6s ease;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.album-art {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.audio-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 40px;
}

.audio-wave span {
    width: 4px;
    height: 100%;
    background: white;
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.audio-wave span:nth-child(1) { animation-delay: 0s; }
.audio-wave span:nth-child(2) { animation-delay: 0.1s; }
.audio-wave span:nth-child(3) { animation-delay: 0.2s; }
.audio-wave span:nth-child(4) { animation-delay: 0.3s; }
.audio-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 20%; }
    50% { height: 100%; }
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-info h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info p {
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 25px;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.time-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    transform: scale(1.1);
}

.control-btn.active {
    color: var(--accent);
}

.play-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.play-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    transform: scale(1.05);
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.volume-slider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--accent);
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#volumeValue {
    min-width: 45px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Playlist */
.playlist {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
    animation: fadeIn 0.6s ease;
}

.playlist h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.playlist-items {
    max-height: 300px;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.playlist-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.playlist-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
}

.playlist-item-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-name {
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-duration {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.playlist-item-download {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.playlist-item-download:hover {
    background: rgba(34, 211, 238, 0.2);
    color: var(--accent);
}

.playlist-item-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.playlist-item-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Scrollbar */
.playlist-items::-webkit-scrollbar {
    width: 8px;
}

.playlist-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .player-card {
        padding: 25px;
    }
    
    .now-playing {
        flex-direction: column;
        text-align: center;
    }
    
    .album-art {
        width: 150px;
        height: 150px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .control-btn {
        padding: 8px;
    }
    
    .play-btn {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .player-card {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
}
