/* ===========================
   MusicStream - Main Stylesheet
   =========================== */

:root {
  --player-bg: #1a1a2e;
  --player-bg-card: rgba(255,255,255,0.08);
  --primary: #6c63ff;
  --primary-glow: rgba(108, 99, 255, 0.35);
  --text-muted: rgba(255,255,255,0.55);
  --border-color: rgba(255,255,255,0.12);
  --transition: 0.25s ease;
}

/* ---- Base ---- */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bs-body-bg);
  min-height: 100vh;
}

/* ---- Navbar ---- */
#mainNav {
  background: var(--bs-body-bg) !important;
  border-bottom: 1px solid var(--bs-border-color);
  backdrop-filter: blur(8px);
}
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--bs-body-color);
}
.btn-ghost:hover {
  background: var(--bs-secondary-bg);
}

/* ---- URL Player Box ---- */
.url-player-box {
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 10px 12px;
}
.url-player-box .form-control {
  font-size: 0.8rem;
}

/* ---- Song List Panel ---- */
.song-list-panel {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
}

.song-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--bs-secondary-bg) transparent;
}
.song-list::-webkit-scrollbar { width: 4px; }
.song-list::-webkit-scrollbar-thumb { background: var(--bs-secondary-bg); border-radius: 2px; }

.song-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 2px;
}
.song-item:hover { background: var(--bs-secondary-bg); }
.song-item.active {
  background: rgba(108, 99, 255, 0.15);
  border-left: 3px solid var(--primary);
}
.song-cover {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.song-cover img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
}
.song-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition);
  font-size: 1.1rem;
}
.song-item:hover .song-cover-overlay { opacity: 1; }
.song-item.active .song-cover-overlay { opacity: 1; background: rgba(108, 99, 255, 0.6); }

.song-info { flex: 1; min-width: 0; }
.song-title  {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bs-body-color);
}
.song-artist {
  font-size: 0.78rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.song-duration { font-size: 0.78rem; }

/* ---- Player Card ---- */
.player-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  position: relative;
  min-height: 400px;
}

.player-cover-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}
.player-cover {
  position: relative;
  z-index: 2;
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.4s ease;
}
.player-cover:hover { transform: translate(-50%, -50%) scale(1.03); }

.player-cover-blur {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.4);
  transform: scale(1.1);
  z-index: 1;
}

.player-body {
  padding: 24px 28px 28px;
}

.player-meta { margin-bottom: 4px; }
.player-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
  font-size: 0.95rem;
}
.player-album {
  color: rgba(255,255,255,0.45);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* ---- Progress Slider ---- */
.progress-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: height 0.15s;
}
.progress-slider:hover { height: 6px; }
.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--primary-glow);
  transition: transform 0.15s;
}
.progress-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.progress-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}
/* Volume slider - different color */
#volumeBar { background: rgba(255,255,255,0.15); }

/* ---- Controls ---- */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.ctrl-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.ctrl-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}
.ctrl-btn.active { color: var(--primary) !important; }

.ctrl-btn-prev,
.ctrl-btn-next { font-size: 1.4rem; }

.ctrl-btn-play {
  width: 56px;
  height: 56px;
  background: #fff;
  color: #1a1a2e !important;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.ctrl-btn-play:hover {
  background: var(--primary);
  color: #fff !important;
  transform: scale(1.08);
}

.ctrl-btn-sm { font-size: 0.9rem; padding: 6px; }

/* ---- Tabs ---- */
.nav-pills .nav-link {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  border-radius: 8px;
  padding: 6px 12px;
}
.nav-pills .nav-link.active {
  background: rgba(108, 99, 255, 0.3);
  color: #fff;
}
.nav-pills .nav-link:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.08); }

/* ---- Lyrics ---- */
.lyrics-box {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
  padding: 8px 4px;
}
.lyrics-box::-webkit-scrollbar { width: 4px; }
.lyrics-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.lyrics-box pre {
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 0;
}

/* ---- Info table ---- */
.player-body .table { color: rgba(255,255,255,0.75); font-size: 0.875rem; }
.player-body .table th { color: rgba(255,255,255,0.45); font-weight: 400; width: 90px; }
.player-body .table td { color: rgba(255,255,255,0.85); }
.player-body .table td, .player-body .table th { border-color: rgba(255,255,255,0.08); }

/* ---- Mobile floating player ---- */
.mobile-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  backdrop-filter: blur(8px);
}
.mobile-player-cover {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.mobile-player-info { flex: 1; min-width: 0; }
.mobile-player-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-player-artist {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
}
.mobile-player-controls { display: flex; gap: 4px; }
.mobile-player .ctrl-btn { color: var(--bs-body-color); }

/* ---- Dark mode overrides ---- */
[data-bs-theme="dark"] {
  --bs-body-bg: #0d0d0d;
}
[data-bs-theme="dark"] #mainNav { border-bottom-color: rgba(255,255,255,0.08); }
[data-bs-theme="dark"] .song-item.active { background: rgba(108, 99, 255, 0.2); }

/* ---- Responsive ---- */
@media (max-width: 992px) {
  .song-list-panel { max-height: 350px; position: static; }
  body { padding-bottom: 70px; }
  .player-cover-wrapper { height: 200px; }
  .player-cover { width: 130px; height: 130px; }
}
