@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.8);
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    --glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --favorite: #f59e0b;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: rgba(148, 163, 184, 0.2);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

[data-theme="neon"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0f;
    --bg-card: rgba(10, 10, 15, 0.8);
    --accent-primary: #00ff88;
    --accent-secondary: #00ccff;
    --accent-gradient: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    --border: rgba(0, 255, 136, 0.2);
    --glow: 0 0 40px rgba(0, 255, 136, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: var(--glow);
    margin-bottom: 20px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.header h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.theme-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.theme-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 50%;
}

.theme-btn.dark::before { background: linear-gradient(135deg, #6366f1, #a855f7); }
.theme-btn.light::before { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.theme-btn.neon::before { background: linear-gradient(135deg, #00ff88, #00ccff); }

.theme-btn:hover {
    transform: scale(1.1);
}

.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    font-family: 'Poppins', sans-serif;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    background: var(--accent-gradient);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 30px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
}

.file-input-label:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    width: 100%;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.search-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.results-container {
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.result-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(3px);
}

.result-icon {
    width: 45px;
    height: 45px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    cursor: pointer;
}

.result-info h4 {
    font-size: 1em;
    margin-bottom: 3px;
}

.result-info p {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.result-stats {
    display: flex;
    gap: 10px;
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 35px;
    height: 35px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1em;
}

.icon-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

.icon-btn.favorite.active {
    background: var(--favorite);
    border-color: var(--favorite);
    color: white;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.album-art {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    flex-shrink: 0;
    box-shadow: var(--glow);
}

.album-art.playing {
    animation: rotate-slow 20s linear infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.track-details h3 {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.track-details p {
    color: var(--text-secondary);
}

.visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 50px;
    margin-bottom: 20px;
}

.visualizer-bar {
    width: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.progress-section {
    margin-bottom: 25px;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
}

.progress-bar-container {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s;
    box-shadow: var(--glow);
}

.controls-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.control-btn:hover {
    transform: scale(1.1);
    border-color: var(--accent-primary);
}

.control-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.play-btn {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border: none;
    font-size: 1.5em;
    box-shadow: var(--glow);
}

.play-btn:hover {
    transform: scale(1.15);
}

.volume-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

input[type="range"] {
    width: 180px;
    height: 5px;
    background: var(--bg-primary);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.playlist-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.playlist-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.playlist-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.playlist-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.playlist-count {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border);
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 5px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.ranking-item:hover {
    border-color: var(--accent-primary);
}

.ranking-position {
    width: 35px;
    height: 35px;
    background: var(--accent-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
    cursor: pointer;
}

.ranking-info h4 {
    font-size: 1em;
    margin-bottom: 3px;
}

.ranking-info p {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.ranking-plays {
    color: var(--text-secondary);
    font-size: 0.85em;
    margin-top: 3px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 100%;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.3em;
    font-weight: 600;
}

.close-btn {
    width: 30px;
    height: 30px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-btn:hover {
    background: var(--accent-primary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

#uploadStatus {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 10px;
    display: none;
    font-weight: 500;
}

#uploadStatus.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
    display: block;
}

#uploadStatus.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    display: block;
}

#uploadStatus.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: block;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gradient);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .header h1 { font-size: 2em; }
    .now-playing { flex-direction: column; text-align: center; }
    .controls-section { gap: 10px; }
    .control-btn { width: 45px; height: 45px; }
    .play-btn { width: 55px; height: 55px; }
    .tabs-nav { gap: 5px; }
    .tab-btn { min-width: 80px; padding: 10px 12px; font-size: 0.85em; }
    input[type="range"] { width: 120px; }
}