/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light Theme Variables */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --accent-color: #ec4899;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-music: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
    
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    
    --border-color: #475569;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Base Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
}

.music-player-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    min-height: 100vh;
}

/* Header */
.player-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: var(--gradient-music);
    background-clip: text;
 -webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.theme-controls {
    display: flex;
    gap: 10px;
}

.theme-btn, .visualizer-btn {
    background: var(--bg-tertiary);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.theme-btn:hover, .visualizer-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Main Player */
.main-player {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Album Section */
.album-section {
    position: relative;
    margin-bottom: 20px;
}

.album-art-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

#albumArt {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.album-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.album-art-container:hover .album-overlay {
    opacity: 1;
}

.vinyl-record {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 50%;
    position: relative;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.vinyl-record.playing {
    animation-play-state: running;
}

.vinyl-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid white;
}

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

/* Visualizer */
.visualizer {
    display: none;
    justify-content: center;
    align-items: end;
    gap: 3px;
    height: 60px;
    margin-top: 20px;
}

.visualizer.active {
    display: flex;
}

.visualizer-bar {
    width: 4px;
    background: var(--gradient-music);
    border-radius: 2px;
    animation: visualizer 1.5s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) { animation-delay: 0s; height: 20px; }
.visualizer-bar:nth-child(2) { animation-delay: 0.1s; height: 30px; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; height: 40px; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; height: 50px; }
.visualizer-bar:nth-child(5) { animation-delay: 0.4s; height: 60px; }
.visualizer-bar:nth-child(6) { animation-delay: 0.5s; height: 50px; }
.visualizer-bar:nth-child(7) { animation-delay: 0.4s; height: 40px; }
.visualizer-bar:nth-child(8) { animation-delay: 0.3s; height: 30px; }
.visualizer-bar:nth-child(9) { animation-delay: 0.2s; height: 20px; }
.visualizer-bar:nth-child(10) { animation-delay: 0.1s; height: 10px; }

@keyframes visualizer {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* Song Info */
.song-info {
    text-align: center;
}

.song-info h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-music);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
}

.song-info p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.song-album {
    font-size: 1rem;
    color: var(--text-light);
}

.song-year {
    color: var(--text-light);
}

/* Progress Section */
.progress-section {
    margin: 20px 0;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.progress {
    height: 100%;
    background: var(--gradient-music);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: var(--transition);
    cursor: grab;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.control-btn {
    background: var(--bg-tertiary);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 1.2rem;
}

.control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.control-btn.active {
    background: var(--primary-color);
    color: white;
}

.play-pause {
    width: 70px;
    height: 70px;
    background: var(--gradient-music);
    color: white;
    font-size: 1.5rem;
}

.play-pause:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

#pauseIcon {
    display: none;
}

.playing #playIcon {
    display: none;
}

.playing #pauseIcon {
    display: block;
}

/* Volume Section */
.volume-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.volume-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
}

.volume-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.volume-container {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.volume-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.volume-level {
    height: 100%;
    background: var(--gradient-music);
    border-radius: 3px;
    width: 70%;
}

.volume-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: var(--transition);
    cursor: grab;
}

.volume-container:hover .volume-handle {
    opacity: 1;
}

/* Extra Features */
.extra-features {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.feature-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.feature-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Playlist Section */
.playlist-section {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.playlist-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-controls {
    display: flex;
    gap: 10px;
}

.autoplay-btn, .clear-btn {
    background: var(--bg-tertiary);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.autoplay-btn:hover, .clear-btn:hover {
    background: var(--primary-color);
    color: white;
}

.autoplay-btn.active {
    background: var(--success-color);
    color: white;
}

.playlist-container {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.playlist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.playlist-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.playlist-item.playing {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.playlist-item.playing .item-title {
    color: var(--primary-color);
    font-weight: 600;
}

.playlist-item.playing .item-artist {
    color: var(--text-primary);
}

.item-artwork {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.item-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.item-duration {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.playlist-stats {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Modals */
.lyrics-modal, .queue-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lyrics-modal.active, .queue-modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
}

.close-btn:hover {
    color: var(--error-color);
    transform: scale(1.1);
}

.lyrics-content {
    line-height: 1.8;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.queue-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.queue-item.playing {
    background: var(--primary-color);
    color: white;
}

.queue-item .item-artist {
    color: inherit;
    opacity: 0.8;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1100;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .music-player-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .playlist-section {
        order: -1;
    }
}

@media (max-width: 768px) {
    .music-player-container {
        padding: 15px;
    }
    
    .player-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .album-art-container {
        width: 250px;
        height: 250px;
    }
    
    .song-info h2 {
        font-size: 1.5rem;
    }
    
    .player-controls {
        gap: 15px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .play-pause {
        width: 60px;
        height: 60px;
    }
    
    .extra-features {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .main-player, .playlist-section {
        padding: 20px;
    }
    
    .album-art-container {
        width: 200px;
        height: 200px;
    }
    
    .vinyl-record {
        width: 150px;
        height: 150px;
    }
    
    .song-info h2 {
        font-size: 1.3rem;
    }
    
    .player-controls {
        gap: 10px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Animation Classes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-player, .playlist-section {
    animation: slideIn 0.6s ease-out;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}