/* ===== SPOTIFY FRONTEND CSS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --spotify-green: #1DB954;
    --spotify-dark: #121212;
    --sidebar-bg: #000000;
    --card-bg: #181818;
    --card-hover: #282828;
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --text-muted: #535353;
    --border: #282828;
    --player-bg: #181818;
}

body { font-family: 'Inter', sans-serif; background: var(--spotify-dark); color: var(--text-primary); overflow: hidden; height: 100vh; display: flex; flex-direction: column; }

/* ===== MAIN LAYOUT ===== */
.app-container { display: flex; flex: 1; overflow: hidden; height: calc(100vh - 90px); }

/* ===== SIDEBAR ===== */
.sidebar { width: 240px; background: var(--sidebar-bg); display: flex; flex-direction: column; padding: 8px; gap: 8px; flex-shrink: 0; overflow-y: auto; }

.sidebar-section { background: var(--card-bg); border-radius: 8px; padding: 16px; }

.logo { display: flex; align-items: center; gap: 10px; padding: 16px; }
.logo i { font-size: 32px; color: var(--spotify-green); }
.logo span { font-size: 20px; font-weight: 800; }

.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 6px; color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 600; transition: all 0.2s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: rgba(255,255,255,0.1); }
.nav-link i { font-size: 20px; width: 22px; }

.library-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.library-header span { font-size: 14px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.library-header i { font-size: 18px; }

.playlist-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; cursor: pointer; transition: background 0.2s; }
.playlist-item:hover { background: rgba(255,255,255,0.05); }
.playlist-item img { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.playlist-item .placeholder-thumb { width: 44px; height: 44px; border-radius: 4px; background: #333; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.playlist-item-info { overflow: hidden; }
.playlist-item-info .name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-item-info .meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; overflow-y: auto; background: linear-gradient(180deg, #1a3a2a 0%, var(--spotify-dark) 40%); }

.main-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; position: sticky; top: 0; z-index: 10; background: rgba(0,0,0,0.4); backdrop-filter: blur(10px); }
.nav-buttons { display: flex; gap: 8px; }
.nav-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.7); border: none; color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: background 0.2s; }
.nav-btn:hover { background: rgba(255,255,255,0.1); }

.search-bar { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 50px; padding: 8px 16px; flex: 1; max-width: 360px; }
.search-bar i { color: #000; font-size: 15px; }
.search-bar input { border: none; outline: none; background: transparent; font-size: 14px; color: #000; font-family: inherit; width: 100%; }
.search-bar input::placeholder { color: #666; }

.user-menu { display: flex; align-items: center; gap: 8px; }
.admin-btn { background: var(--spotify-green); color: #000; border: none; padding: 8px 16px; border-radius: 50px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 6px; transition: background 0.2s; }
.admin-btn:hover { background: #1ed760; }

/* ===== CONTENT SECTIONS ===== */
.content-section { padding: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 800; }
.see-all { color: var(--text-secondary); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: color 0.2s; letter-spacing: 0.5px; text-transform: uppercase; }
.see-all:hover { color: var(--text-primary); }

/* ===== CARDS GRID ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

.music-card { background: var(--card-bg); border-radius: 8px; padding: 16px; cursor: pointer; transition: background 0.3s; position: relative; }
.music-card:hover { background: var(--card-hover); }
.music-card:hover .play-btn { opacity: 1; transform: translateY(0); }

.card-image { position: relative; margin-bottom: 16px; }
.card-image img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.card-image .placeholder { width: 100%; aspect-ratio: 1; background: linear-gradient(135deg, #333, #555); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--text-muted); }

.play-btn { position: absolute; bottom: 8px; right: 8px; width: 48px; height: 48px; background: var(--spotify-green); border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(8px); transition: all 0.3s; box-shadow: 0 8px 16px rgba(0,0,0,0.4); border: none; cursor: pointer; }
.play-btn i { color: #000; font-size: 18px; margin-left: 2px; }
.play-btn:hover { transform: translateY(0) scale(1.05) !important; background: #1ed760; }

.card-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtitle { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== TRACKS LIST ===== */
.tracks-section { padding: 0 24px 24px; }
.tracks-header { display: grid; grid-template-columns: 40px 1fr 1fr 80px; gap: 16px; padding: 8px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.tracks-header span { font-size: 12px; color: var(--text-secondary); font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; }

.track-item { display: grid; grid-template-columns: 40px 1fr 1fr 80px; gap: 16px; padding: 8px 16px; border-radius: 6px; align-items: center; cursor: pointer; transition: background 0.2s; }
.track-item:hover { background: rgba(255,255,255,0.07); }
.track-item.playing { background: rgba(29,185,84,0.1); }
.track-item.playing .track-title { color: var(--spotify-green); }

.track-num { font-size: 14px; color: var(--text-secondary); text-align: center; }
.track-item:hover .track-num { display: none; }
.track-item:hover .track-play-icon { display: flex; }
.track-play-icon { display: none; align-items: center; justify-content: center; color: var(--text-primary); font-size: 14px; }

.track-info { display: flex; align-items: center; gap: 12px; overflow: hidden; }
.track-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.track-thumb-placeholder { width: 40px; height: 40px; border-radius: 4px; background: #333; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.track-text { overflow: hidden; }
.track-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-album { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-duration { font-size: 13px; color: var(--text-secondary); text-align: right; }

/* ===== PLAYER ===== */
.player { height: 90px; background: var(--player-bg); border-top: 1px solid var(--border); display: flex; align-items: center; padding: 0 16px; gap: 16px; flex-shrink: 0; }

.player-left { display: flex; align-items: center; gap: 14px; width: 280px; min-width: 180px; }
.player-thumb { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.player-thumb-placeholder { width: 56px; height: 56px; border-radius: 4px; background: #333; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 22px; flex-shrink: 0; }
.player-song-info { overflow: hidden; }
.player-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.player-like { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px; transition: color 0.2s; }
.player-like:hover, .player-like.liked { color: var(--spotify-green); }

.player-center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 722px; }
.player-controls { display: flex; align-items: center; gap: 20px; }
.ctrl-btn { background: none; border: none; color: var(--text-secondary); font-size: 16px; cursor: pointer; padding: 4px; transition: color 0.2s; }
.ctrl-btn:hover { color: var(--text-primary); }
.ctrl-btn.active { color: var(--spotify-green); }
.play-pause-btn { width: 34px; height: 34px; background: var(--text-primary); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.1s; }
.play-pause-btn:hover { transform: scale(1.05); background: #fff; }
.play-pause-btn i { color: #000; font-size: 14px; margin-left: 1px; }
.play-pause-btn i.fa-pause { margin-left: 0; }

.progress-bar-container { display: flex; align-items: center; gap: 8px; width: 100%; }
.time-label { font-size: 11px; color: var(--text-secondary); min-width: 32px; }
.time-label.end { text-align: right; }
.progress-bar { flex: 1; height: 4px; background: #535353; border-radius: 2px; cursor: pointer; position: relative; }
.progress-bar:hover { height: 6px; }
.progress-fill { height: 100%; background: var(--text-primary); border-radius: 2px; position: relative; transition: width 0.1s; }
.progress-bar:hover .progress-fill { background: var(--spotify-green); }
.progress-thumb { width: 12px; height: 12px; background: #fff; border-radius: 50%; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); display: none; }
.progress-bar:hover .progress-thumb { display: block; }

.player-right { display: flex; align-items: center; gap: 8px; width: 220px; justify-content: flex-end; }
.volume-container { display: flex; align-items: center; gap: 8px; }
.volume-icon { background: none; border: none; color: var(--text-secondary); font-size: 14px; cursor: pointer; }
.volume-icon:hover { color: var(--text-primary); }
.volume-bar { width: 90px; height: 4px; background: #535353; border-radius: 2px; cursor: pointer; }
.volume-bar:hover { height: 6px; }
.volume-fill { height: 100%; background: var(--text-primary); border-radius: 2px; }
.volume-bar:hover .volume-fill { background: var(--spotify-green); }

/* ===== CATEGORY PAGE ===== */
.hero-section { padding: 60px 24px 24px; background: linear-gradient(180deg, rgba(29,185,84,0.4) 0%, transparent 100%); }
.hero-section h1 { font-size: 48px; font-weight: 900; margin-bottom: 8px; }
.hero-section p { color: var(--text-secondary); font-size: 15px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #777; }

/* ===== SEARCH RESULTS ===== */
.search-results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
.top-result-card { background: var(--card-hover); border-radius: 8px; padding: 20px; cursor: pointer; transition: background 0.3s; position: relative; overflow: hidden; }
.top-result-card:hover { background: #3e3e3e; }
.top-result-card:hover .play-btn { opacity: 1 !important; transform: translateY(0) !important; }
.top-result-type { background: rgba(255,255,255,0.1); color: var(--text-secondary); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 50px; text-transform: capitalize; }
.search-songs-col { display: flex; flex-direction: column; gap: 4px; }
.search-song-item { border-radius: 6px; }

/* ===== RECENTLY PLAYED ===== */
.recent-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.recent-quick-item { display: flex; align-items: center; gap: 12px; background: var(--card-hover); border-radius: 6px; overflow: hidden; cursor: pointer; transition: background 0.2s; position: relative; }
.recent-quick-item:hover { background: #3e3e3e; }
.recent-quick-item:hover .recent-play-btn { opacity: 1; }
.recent-quick-item img { width: 56px; height: 56px; object-fit: cover; flex-shrink: 0; }
.recent-quick-placeholder { width: 56px; height: 56px; background: #333; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 20px; flex-shrink: 0; }
.recent-quick-item span { font-size: 13px; font-weight: 600; flex: 1; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-play-btn { width: 40px; height: 40px; background: var(--spotify-green); border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.3s; margin-right: 8px; flex-shrink: 0; }
.recent-play-btn i { color: #000; font-size: 14px; margin-left: 2px; }

/* ===== VISUALIZER ===== */
.viz-btn.active { color: var(--spotify-green); }
.mini-equalizer { display: none; align-items: flex-end; gap: 2px; height: 16px; position: absolute; bottom: 4px; right: 4px; }
.mini-equalizer.active { display: flex; }
.eq-bar { width: 3px; background: var(--spotify-green); border-radius: 2px; animation: eqBounce 0.8s ease-in-out infinite; }
.eq-bar:nth-child(1) { animation-delay: 0s; }
.eq-bar:nth-child(2) { animation-delay: 0.15s; }
.eq-bar:nth-child(3) { animation-delay: 0.3s; }
.eq-bar:nth-child(4) { animation-delay: 0.15s; }
.eq-bar:nth-child(5) { animation-delay: 0s; }
@keyframes eqBounce {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}
@keyframes albumSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
#playerThumb { border-radius: 50%; transition: border-radius 0.3s; }

/* ===== SOCIAL / SHARED ===== */
.share-btn { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 6px 14px; border-radius: 50px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.share-btn:hover { border-color: #fff; }
.public-badge { background: rgba(29,185,84,0.15); color: var(--spotify-green); font-size: 11px; padding: 3px 10px; border-radius: 50px; font-weight: 600; border: 1px solid rgba(29,185,84,0.3); }
.private-badge { background: rgba(255,255,255,0.08); color: var(--text-secondary); font-size: 11px; padding: 3px 10px; border-radius: 50px; font-weight: 600; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sidebar { width: 72px; }
    .sidebar .nav-link span, .sidebar .logo span, .playlist-item-info, .library-header span { display: none; }
    .playlist-item { justify-content: center; }
    .player-left { width: 180px; }
    .player-right { width: 140px; }
    .track-item { grid-template-columns: 40px 1fr 80px; }
    .track-album { display: none; }
    .tracks-header { grid-template-columns: 40px 1fr 80px; }
    .tracks-header span:nth-child(3) { display: none; }
}
@media (max-width: 600px) {
    .sidebar { display: none; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .player-right { display: none; }
}
