/* ==========================================================================
   SpotiPWA - 100% Authentic Spotify Dark Theme for iOS & Mobile Web
   ========================================================================== */

:root {
  --bg-black: #000000;
  --bg-main: #121212;
  --bg-surface: #181818;
  --bg-surface-elevated: #242424;
  --bg-surface-hover: #2a2a2a;
  --color-spotify: #1DB954;
  --color-spotify-hover: #1ed760;
  --color-text-base: #FFFFFF;
  --color-text-subdued: #B3B3B3;
  --color-text-subdued-light: #D9D9D9;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Circular", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--color-text-base);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* ==================== HEADER ==================== */
.top-header {
  padding: calc(var(--safe-top) + 10px) 16px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(18,18,18,0.98) 0%, rgba(18,18,18,0.85) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ff5722;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.header-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-back-btn {
  background: none;
  border: none;
  color: #fff;
  display: none; /* Shown dynamically when stack > 1 */
  cursor: pointer;
  padding: 4px;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.header-back-btn:active {
  transform: scale(0.9);
}

.header-greeting {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.pill-btn {
  background: var(--bg-surface-elevated);
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.pill-btn.active {
  background: #fff;
  color: #000;
}

.pill-btn:active {
  transform: scale(0.96);
}

/* ==================== SCROLLABLE CONTENT ==================== */
.main-view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 16px 130px 16px;
  -webkit-overflow-scrolling: touch;
}

/* Quick access 6-tiles grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.quick-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.quick-card:active {
  background: rgba(255, 255, 255, 0.16);
}

.quick-card-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  flex-shrink: 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.quick-card-title {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: #FFFFFF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.quick-card-heart-gradient {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #450af5, #8e8ee5, #c4efd9);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

/* Home Category Filter Pills */
.home-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  flex: 1;
}
.home-filter-pills::-webkit-scrollbar {
  display: none;
}
.home-pill {
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transition: all 0.15s ease;
}
.home-pill.active {
  background: #1DB954;
  color: #000000;
  font-weight: 700;
}
.home-pill:active {
  transform: scale(0.96);
}

/* Section Headings */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 12px 0;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #FFFFFF;
}

/* Horizontal Carousels */
.horizontal-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

/* Spotify Card conforming exactly to mobile Spotify app */
.spotify-card {
  min-width: 142px;
  width: 142px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
  position: relative;
}

.spotify-card:active {
  background: transparent;
  transform: scale(0.97);
  opacity: 0.85;
}

.spotify-card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.spotify-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.spotify-card-sub {
  font-size: 12px;
  color: var(--color-text-subdued);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Playlist Grid for Library Tab */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 14px;
}

.playlist-grid .spotify-card {
  width: 100%;
  min-width: 0;
}

/* Track list */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.15s;
  cursor: pointer;
}

.track-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.track-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.track-info {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}

.track-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.track-title.active {
  color: var(--color-spotify);
}

.track-artist {
  font-size: 12px;
  color: var(--color-text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-track-action {
  background: none;
  border: none;
  color: var(--color-text-subdued);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-track-action:active {
  color: #fff;
  transform: scale(0.9);
}

.btn-track-heart.active {
  color: var(--color-spotify);
}

.badge-in-library {
  font-size: 10px;
  padding: 3px 6px;
  background: rgba(29, 185, 84, 0.15);
  color: var(--color-spotify);
  border-radius: 10px;
  font-weight: 600;
}

/* Search input */
.search-container {
  margin-bottom: 16px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: #242424;
  border-radius: 24px;
  padding: 0 16px;
  height: 46px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.search-input-wrapper:focus-within {
  border-color: #fff;
  background: #2b2b2b;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-subdued);
  margin-right: 10px;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
}

.search-clear {
  background: none;
  border: none;
  color: var(--color-text-subdued);
  cursor: pointer;
  padding: 4px;
  display: none;
  font-size: 16px;
}

/* ==================== MINI PLAYER (iOS STYLE) ==================== */
.mini-player {
  position: fixed;
  bottom: calc(54px + var(--safe-bottom) + 8px);
  left: 8px;
  right: 8px;
  background: rgba(30, 30, 30, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 50;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-player-img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  margin-right: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.mini-player-info {
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}

.mini-player-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-artist {
  font-size: 12px;
  color: var(--color-text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-btn-ctrl {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-btn-ctrl:active {
  transform: scale(0.9);
}

.mini-player-progress-line {
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
  overflow: hidden;
}

.mini-player-progress-fill {
  height: 100%;
  background: var(--color-spotify);
  width: 0%;
}

/* ==================== BOTTOM TAB BAR ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(54px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 45;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-subdued);
  font-size: 11px;
  font-weight: 600;
  gap: 3px;
  cursor: pointer;
  padding: 4px 14px;
  transition: color 0.15s;
}

.nav-item.active {
  color: #fff;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

/* ==================== NOW PLAYING FULLSCREEN MODAL ==================== */
.now-playing-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #282828 0%, #121212 55%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 12px) 24px calc(var(--safe-bottom) + 20px) 24px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.now-playing-overlay.open {
  transform: translateY(0%);
}

.np-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.np-playlist-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-text-subdued);
}

.np-cover-container {
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 330px;
  margin: 0 auto 30px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

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

.np-track-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.np-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 15px;
  color: var(--color-text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-btn-heart {
  background: none;
  border: none;
  color: var(--color-text-subdued);
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.np-btn-heart.active {
  color: var(--color-spotify);
  transform: scale(1.15);
}

.np-scrubber-container {
  margin-bottom: 16px;
}

.np-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.np-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.np-time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-subdued);
  margin-top: 6px;
  font-feature-settings: "tnum";
}

.np-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}

.np-btn-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.np-btn-play:active {
  transform: scale(0.93);
}

.np-btn-ctrl {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.np-btn-ctrl:active {
  transform: scale(0.9);
}

.np-btn-ctrl.active {
  color: var(--color-spotify);
}

.np-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.quality-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: var(--color-text-subdued);
}

/* ==================== ACTION SHEET / 3-DOTS MODAL ==================== */
.action-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.action-sheet-backdrop.open {
  display: flex;
}

.action-sheet {
  background: #242424;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 20px 20px calc(var(--safe-bottom) + 20px) 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.action-sheet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}

.action-sheet-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.action-sheet-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.action-sheet-sub {
  font-size: 13px;
  color: var(--color-text-subdued);
}

.action-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.action-sheet-item:active {
  background: rgba(255, 255, 255, 0.1);
}

.action-sheet-item svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-subdued);
}

.action-sheet-cancel {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 24px;
  padding: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

/* ==================== PLAYLIST SELECTION MODAL ==================== */
.playlist-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.playlist-modal-backdrop.open {
  display: flex;
}

.playlist-modal {
  background: #242424;
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

.playlist-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.playlist-modal-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.playlist-modal-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.playlist-modal-item:active {
  background: rgba(255, 255, 255, 0.12);
}

.btn-new-playlist {
  background: var(--color-spotify);
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Toast Notifications */
.toast-notice {
  position: fixed;
  bottom: calc(54px + var(--safe-bottom) + 70px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40, 40, 40, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  z-index: 300;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: toastFade 2.5s forwards ease;
}

@keyframes toastFade {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* ==================== BUTTONS & UTILITIES ==================== */
.btn-icon-subtle {
  background: none;
  border: none;
  color: var(--color-text-subdued);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.15s;
}

.btn-icon-subtle:active {
  color: #fff;
  transform: scale(0.9);
}

.btn-play-track {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.btn-play-track:active {
  transform: scale(0.88);
}

.btn-download-track {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-download-track:active {
  background: var(--color-spotify);
  color: #000;
  border-color: var(--color-spotify);
  transform: scale(0.95);
}

/* Download Progress Banner */
.download-progress-banner {
  background: #1e1e1e;
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-spotify);
  width: 5%;
  transition: width 0.3s ease;
}

/* Playlist & Favorites Hero Header */
.playlist-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 4px;
}

.playlist-hero-img {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.playlist-hero-heart {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background: linear-gradient(135deg, #450af5, #8e8ee5, #c4efd9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.playlist-hero-info {
  flex: 1;
  min-width: 0;
}

.playlist-hero-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-subdued);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.playlist-hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.playlist-hero-meta {
  font-size: 12px;
  color: var(--color-text-subdued);
  margin-bottom: 12px;
}

.playlist-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-hero-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-spotify);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: none !important;
  transition: transform 0.15s, background 0.15s;
}

.btn-hero-play:hover {
  background: var(--color-spotify-hover);
  transform: scale(1.04);
}

.btn-hero-play:active {
  transform: scale(0.92);
}

/* Optical centering for play triangle inside circle & white play symbol */
.btn-hero-play svg,
.btn-hero-play svg.play-triangle {
  fill: #FFFFFF !important;
  color: #FFFFFF !important;
  transform: translateX(1.5px);
}

.np-btn-play svg.play-triangle {
  transform: translateX(1.5px);
}

/* ==================== SPOTIFY ACQUIRED BADGE & HEART ANIMATION ==================== */
.spotify-acquired-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  flex-shrink: 0;
}

@keyframes pulseHeart {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.btn-track-heart.heart-pending svg {
  animation: pulseHeart 1.1s infinite ease-in-out;
}

/* ==================== GREYED-OUT UNAVAILABLE TRACKS ==================== */
.track-item.track-unavailable {
  cursor: pointer;
}

.track-item.track-unavailable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.track-item.track-unavailable .track-img {
  opacity: 0.9;
}

.track-item.track-unavailable .track-title {
  color: rgba(255, 255, 255, 0.42) !important;
}

.track-item.track-unavailable .track-artist {
  color: rgba(255, 255, 255, 0.25) !important;
}

/* ==================== SEARCH FILTER PILLS ==================== */
.search-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.search-pills::-webkit-scrollbar {
  display: none;
}

.search-pill-btn {
  background: var(--bg-surface-elevated);
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.search-pill-btn.active {
  background: #FFFFFF;
  color: #000000;
}

/* ==================== ALBUM DETAIL & BATCH SELECTION ==================== */
.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border-radius: 8px;
  margin-bottom: 16px;
}

.btn-batch-download {
  background: var(--color-spotify);
  color: #000;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s;
}

.btn-batch-download:active {
  transform: scale(0.95);
}

.btn-select-all {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.track-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--color-spotify);
  cursor: pointer;
  margin-right: 8px;
}

/* ==================== SYNCHRONIZED LYRICS OVERLAY ==================== */
.lyrics-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1c1a24 0%, #121212 70%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 16px) 24px calc(var(--safe-bottom) + 30px) 24px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lyrics-overlay.open {
  transform: translateY(0%);
}

.lyrics-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.lyrics-track-title {
  font-size: 16px;
  font-weight: 700;
}

.lyrics-track-artist {
  font-size: 13px;
  color: var(--color-text-subdued);
}

.lyrics-scroll-container {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 40px 0 120px 0;
  -webkit-overflow-scrolling: touch;
}

.lyrics-line {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.3);
  padding: 12px 0;
  transition: all 0.25s ease;
  cursor: pointer;
}

.lyrics-line:hover {
  color: rgba(255, 255, 255, 0.65);
}

.lyrics-line.active {
  color: #FFFFFF;
  font-size: 28px;
  transform: scale(1.03);
  transform-origin: left center;
  text-shadow: 0 2px 24px rgba(255, 255, 255, 0.4);
}

/* ==================== SPOTIFY AUTHENTICATION MODAL ==================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #121212;
  z-index: 500;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 24px;
}

.login-overlay.open {
  display: flex;
}

.login-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  margin-bottom: 20px;
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  margin-bottom: 24px;
  text-align: center;
}

.login-field {
  width: 100%;
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #FFFFFF;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  background: #242424;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0 14px;
  height: 48px;
  transition: border-color 0.2s;
}

.login-input-wrap:focus-within {
  border-color: #FFFFFF;
}

.login-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-size: 15px;
}

.login-btn-eye {
  background: none;
  border: none;
  color: var(--color-text-subdued);
  cursor: pointer;
  padding: 4px;
}

.btn-login {
  width: 100%;
  height: 48px;
  background: var(--color-spotify);
  color: #000000;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 6px 16px rgba(29, 185, 84, 0.35);
  transition: transform 0.15s, background 0.2s;
}

.btn-login:active {
  transform: scale(0.97);
  background: var(--color-spotify-hover);
}

.login-error {
  width: 100%;
  background: rgba(226, 33, 52, 0.15);
  border: 1px solid #E22134;
  color: #FF5A5F;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}

/* ==================== USER PROFILE & SETTINGS VIEW ==================== */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 120px;
}

.settings-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-surface);
  border-radius: 12px;
}

.settings-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ff5722;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.settings-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(29, 185, 84, 0.15);
  color: var(--color-spotify);
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.settings-card {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.storage-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-subdued);
}

.storage-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1DB954 0%, #1ed760 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.btn-action-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s;
}

.btn-action-outline:active {
  background: rgba(255, 255, 255, 0.1);
}

.btn-logout {
  width: 100%;
  padding: 12px;
  border-radius: 24px;
  background: rgba(226, 33, 52, 0.15);
  color: #FF5A5F;
  border: 1px solid rgba(226, 33, 52, 0.3);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s;
}

.btn-logout:active {
  background: rgba(226, 33, 52, 0.25);
}

/* ==================== GLOBAL SINGLE-LINE DOWNLOAD PROGRESS BAR ==================== */
.global-download-banner {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin: 8px 16px 12px 16px;
  padding: 10px 14px 8px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: slideDownBanner 0.25s ease-out;
  position: relative;
  z-index: 80;
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gdb-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.gdb-spinner-wrap {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdb-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(29, 185, 84, 0.25);
  border-top-color: #1DB954;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.gdb-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gdb-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gdb-counter {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
}

.gdb-percent {
  font-size: 12px;
  font-weight: 700;
  color: #1DB954;
  margin-left: auto;
}

.gdb-current-track {
  font-size: 11px;
  color: var(--color-text-subdued);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gdb-btn-cancel {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--color-text-subdued);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.gdb-btn-cancel:hover, .gdb-btn-cancel:active {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.gdb-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.gdb-bar-fill {
  height: 100%;
  background: #1DB954;
  border-radius: 2px;
  transition: width 0.3s ease;
}


