/* === NAGHMA MUSIC — PREMIUM DARK PLAYER === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

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

:root {
  --pink: #ec4899;
  --orange: #f97316;
  --bg: #050508;
  --bg2: #0d0d17;
  --bg3: #12121f;
  --bg4: #1a1a2e;
  --card: rgba(255,255,255,0.04);
  --card-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.07);
  --text: #f1f1f3;
  --text-muted: rgba(255,255,255,0.45);
  --text-sub: rgba(255,255,255,0.28);
  --player-h: 82px;
  --sidebar-w: 240px;
  --gradient: linear-gradient(135deg, var(--pink), var(--orange));
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  overflow: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* === SIDEBAR === */
.sidebar {
  grid-row: 1 / 2;
  grid-column: 1 / 2;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 0 4px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(236,72,153,0.4);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.logo-by { font-size: 0.68rem; color: var(--text-muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 28px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-item:hover { background: var(--card-hover); color: var(--text); }
.nav-item.active { background: rgba(236,72,153,0.12); color: var(--pink); }
.nav-item.active svg { stroke: var(--pink); }

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-sub);
  padding: 0 12px;
  margin-bottom: 10px;
}

.quick-picks { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.qpick {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  padding: 8px 12px;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}
.qpick:hover { background: var(--card-hover); color: var(--text); padding-left: 18px; }

.sidebar-footer { margin-top: auto; padding-top: 20px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-sub);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}
.back-link:hover { color: var(--pink); background: rgba(236,72,153,0.08); }

/* === MAIN CONTENT === */
.main-content {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
  overflow-y: auto;
  background: var(--bg);
}

/* === TOP BAR === */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.hamburger-btn:hover { color: var(--text); background: var(--card); }

.search-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  transition: all 0.2s;
  max-width: 520px;
}
.search-bar-wrap:focus-within {
  border-color: rgba(236,72,153,0.4);
  background: var(--bg4);
  box-shadow: 0 0 0 3px rgba(236,72,153,0.08);
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
}
#search-input::placeholder { color: var(--text-sub); }

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s;
}
.search-clear:hover { color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.quality-selector select {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 7px 10px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.quality-selector select:hover { border-color: rgba(236,72,153,0.3); color: var(--text); }

/* === VIEWS === */
.view { display: none; padding: 0 28px 120px; }
.view.active { display: block; }

/* === HOME VIEW === */
.home-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 28px 0 48px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(236,72,153,0.12);
  color: var(--pink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero-text h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 380px;
  margin-bottom: 28px;
}

.hero-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(236,72,153,0.35);
}
.hero-search-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(236,72,153,0.45); }

/* Vinyl Animation */
.hero-visual { display: flex; align-items: center; justify-content: center; }

.vinyl-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}

.vinyl {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 50%, #1a1a2e 30%, #0d0d17 31%, #ec4899 50%, #1a1a2e 51%, #0d0d17 65%, #ec4899 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin 8s linear infinite;
  animation-play-state: paused;
  box-shadow: 0 0 40px rgba(236,72,153,0.3);
}

.vinyl.spinning { animation-play-state: running; }

.vinyl-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.vinyl-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236,72,153,0.2) 0%, transparent 70%);
  pointer-events: none;
}

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

/* Genre Grid */
.section-title-row { margin-bottom: 16px; }
.section-title-row h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.genre-card {
  background: linear-gradient(135deg, var(--gc1), var(--gc2));
  border: none;
  border-radius: 14px;
  padding: 20px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
  text-align: left;
  overflow: hidden;
  position: relative;
}
.genre-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}
.genre-card:hover { transform: scale(1.03); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.genre-card:hover::after { background: rgba(255,255,255,0.05); }

.genre-icon { font-size: 1.6rem; }
.genre-card span:last-child { color: white; font-weight: 600; font-size: 0.9rem; font-family: 'Space Grotesk', sans-serif; }

/* === RESULTS VIEW === */
.results-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 20px 0 16px;
}
.results-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; font-weight: 700; }
.results-count { color: var(--text-muted); font-size: 0.82rem; }

/* Loading */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(236,72,153,0.15);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Error */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--text-muted);
  text-align: center;
}
.error-icon { font-size: 2.5rem; }

/* Tracks List */
.tracks-list { display: flex; flex-direction: column; gap: 4px; }

.track-item {
  display: grid;
  grid-template-columns: 36px 48px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.track-item:hover { background: var(--card-hover); }
.track-item.playing { background: rgba(236,72,153,0.1); }

.track-num {
  font-size: 0.82rem;
  color: var(--text-sub);
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 36px;
}
.track-item.playing .track-num { display: none; }
.track-item.playing .track-play-ind { display: flex; }

.track-play-ind {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
}

.playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.playing-bars span {
  width: 3px;
  background: var(--pink);
  border-radius: 2px;
  animation: bar 0.8s ease-in-out infinite;
}
.playing-bars span:nth-child(2) { animation-delay: 0.2s; }
.playing-bars span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bar {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

.track-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg4);
  flex-shrink: 0;
}

.track-info { overflow: hidden; min-width: 0; }
.track-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.track-item.playing .track-title { color: var(--pink); }
.track-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-lang {
  font-size: 0.72rem;
  color: var(--text-sub);
  background: var(--card);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  display: none;
}

.track-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* === PLAYER BAR === */
.player-bar {
  grid-row: 2 / 3;
  grid-column: 1 / 3;
  background: rgba(10,10,20,0.97);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(20px);
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  height: var(--player-h);
  position: relative;
  z-index: 100;
}

.player-track {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.player-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--bg4);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-track-info { overflow: hidden; min-width: 0; }
.player-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

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

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: all 0.15s;
}
.ctrl-btn:hover { color: var(--text); background: var(--card); }

.play-btn {
  width: 46px;
  height: 46px;
  background: var(--gradient) !important;
  color: white !important;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(236,72,153,0.4);
  transition: all 0.2s !important;
}
.play-btn:hover { transform: scale(1.08) !important; box-shadow: 0 6px 22px rgba(236,72,153,0.55) !important; }

/* Progress */
.player-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.player-controls-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.time-current, .time-total {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}
.time-total { text-align: right; }

.progress-bar-wrap {
  flex: 1;
  cursor: pointer;
  padding: 8px 0;
}

.progress-bar-bg {
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

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

/* Volume */
.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--text-muted);
}

.volume-slider {
  -webkit-appearance: none;
  width: 90px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: var(--player-h);
    width: 260px;
    z-index: 200;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.5); }

  .main-content {
    grid-column: 1 / 2;
  }

  .hamburger-btn { display: flex; }

  .player-bar {
    grid-template-columns: 1fr auto 1fr;
    padding: 0 14px;
    gap: 10px;
  }

  .player-right { gap: 6px; }
  .volume-slider { width: 60px; }

  .home-hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }

  .genre-grid { grid-template-columns: repeat(2, 1fr); }

  .track-item {
    grid-template-columns: 36px 44px 1fr auto;
  }
  .track-lang { display: none; }

  .view { padding: 0 16px 120px; }
  .topbar { padding: 14px 16px 12px; }
}
