* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #000; color: #fff; overflow: hidden; height: 100vh; }
.app { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 1fr 90px; height: 100vh; }
.sidebar { background: #000; padding: 24px 12px; grid-row: 1; overflow-y: auto; }
.logo { font-size: 22px; font-weight: bold; color: #1db954; margin-bottom: 24px; padding: 0 12px; }
.sidebar nav a { display: flex; align-items: center; gap: 16px; padding: 10px 12px; color: #b3b3b3; text-decoration: none; border-radius: 4px; font-weight: 600; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: #1a1a1a; }
.playlists { margin-top: 24px; padding: 0 12px; }
.playlists h4 { color: #b3b3b3; font-size: 12px; text-transform: uppercase; margin-bottom: 12px; }
.playlists a { display: block; color: #b3b3b3; text-decoration: none; padding: 6px 0; font-size: 14px; }
.playlists a:hover { color: #fff; }

.main-content { background: linear-gradient(180deg, #1f1f1f 0%, #121212 200px); grid-row: 1; overflow-y: auto; padding: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 16px 24px; background: rgba(0,0,0,0.3); position: sticky; top: 0; z-index: 10; }
.nav-buttons button { background: #000; color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.search-box { flex: 1; max-width: 400px; position: relative; }
.search-box input { width: 100%; padding: 10px 10px 10px 40px; background: #2a2a2a; border: none; border-radius: 500px; color: #fff; font-size: 14px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #b3b3b3; }
.btn-login { background: #fff; color: #000; padding: 8px 20px; border-radius: 500px; text-decoration: none; font-weight: bold; font-size: 14px; }
.btn-login:hover { transform: scale(1.05); }

.hero { padding: 40px 24px; background: linear-gradient(135deg, #1db954, #191414); }
.hero h1 { font-size: 48px; margin-bottom: 8px; }
.hero p { color: #b3b3b3; font-size: 18px; }

.section { padding: 24px; }
.section h2 { font-size: 24px; margin-bottom: 16px; }
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.song-card { background: #181818; padding: 16px; border-radius: 8px; cursor: pointer; transition: background 0.3s; }
.song-card:hover { background: #282828; }
.song-card .cover { position: relative; margin-bottom: 12px; }
.song-card .cover img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.song-card .play-btn { position: absolute; bottom: 8px; right: 8px; width: 48px; height: 48px; border-radius: 50%; background: #1db954; border: none; color: #000; font-size: 18px; cursor: pointer; opacity: 0; transform: translateY(8px); transition: all 0.3s; }
.song-card:hover .play-btn { opacity: 1; transform: translateY(0); }
.song-card h3 { font-size: 16px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card p { color: #b3b3b3; font-size: 14px; }

.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.genre-card { padding: 20px; border-radius: 8px; color: #fff; text-decoration: none; font-weight: bold; font-size: 18px; height: 100px; display: flex; align-items: flex-end; }

/* Player */
.player { grid-column: 1 / -1; background: #181818; border-top: 1px solid #282828; display: grid; grid-template-columns: 30% 40% 30%; align-items: center; padding: 0 16px; }
.now-playing { display: flex; align-items: center; gap: 12px; }
.now-playing img { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; }
.np-info div:first-child { font-size: 14px; }
.np-info div:last-child { font-size: 12px; color: #b3b3b3; }
#like-btn { background: none; border: none; color: #b3b3b3; cursor: pointer; font-size: 16px; margin-left: auto; }
#like-btn.liked { color: #1db954; }

.player-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.controls { display: flex; gap: 16px; align-items: center; }
.controls button { background: none; border: none; color: #b3b3b3; cursor: pointer; font-size: 16px; }
.controls button:hover { color: #fff; }
.play-main { width: 36px; height: 36px; background: #fff !important; color: #000 !important; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.progress-container { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 500px; font-size: 11px; color: #b3b3b3; }
input[type=range] { -webkit-appearance: none; flex: 1; height: 4px; background: #4d4d4d; border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #fff; border-radius: 50%; cursor: pointer; }

.player-extra { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.player-extra button { background: none; border: none; color: #b3b3b3; cursor: pointer; }
.player-extra input[type=range] { width: 100px; }

@media (max-width: 768px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .song-grid { grid-template-columns: repeat(2, 1fr); }
    .player { grid-template-columns: 1fr; grid-template-rows: auto auto; padding: 8px; }
    .player-extra { display: none; }
}