/* ==========================================================================
   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;
}

html {
  background-color: var(--bg-main);
}

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;
  background-color: var(--bg-main);
}

/* ==================== OFFLINE STATUS BANNER ==================== */
.offline-status-banner {
  background-color: #1C1C1E;
  color: #A7A7A7;
  font-size: 11px;
  font-weight: 600;
  height: 26px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 999;
  width: 100%;
  position: relative;
  letter-spacing: 0.2px;
  user-select: none;
  -webkit-user-select: none;
}

.offline-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #FF9F0A;
  display: inline-block;
  box-shadow: 0 0 6px rgba(255, 159, 10, 0.4);
}

/* ==================== HEADER ==================== */
.top-header {
  padding-top: max(calc(var(--safe-top) + 6px), 14px);
  padding-bottom: 8px;
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-main);
  background: var(--bg-main);
  position: sticky;
  top: 0;
  z-index: 40;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

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

.user-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.avatar-progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 38px;
  transform: rotate(-90deg); /* Start at 12 o'clock */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.avatar-progress-ring.active {
  opacity: 1;
}

.avatar-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2.5;
}

.avatar-ring-bar {
  fill: none;
  stroke: #1DB954;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 113.1;
  transition: stroke-dashoffset 0.35s ease, stroke 0.3s ease;
  filter: drop-shadow(0 0 3px rgba(29, 185, 84, 0.6));
}

.avatar-ring-bar.finished {
  stroke: #1ed760;
  filter: drop-shadow(0 0 5px rgba(30, 215, 96, 0.8));
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #A280D8;
  color: #121212;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  position: relative;
  z-index: 2;
  transition: transform 0.15s ease;
}

.user-avatar-wrap:active .user-avatar {
  transform: scale(0.92);
}

.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: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #FFFFFF;
}

.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 0px 8px 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: 4px;
}

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

.track-title.active {
  color: #1DB954;
}

.track-artist {
  font-size: 13px;
  color: #A7A7A7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding-right: 0px;
  flex-shrink: 0;
}

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

.btn-track-action:last-child {
  padding-right: 0px;
  margin-right: 0px;
}

.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 - Authentic Spotify White Box */
.search-container {
  margin-top: 4px;
  margin-bottom: 18px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: #FFFFFF !important;
  border-radius: 8px !important;
  padding: 0 14px;
  height: 48px;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s ease;
}

.search-input-wrapper:focus-within {
  border: none !important;
  background: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.search-icon {
  width: 22px;
  height: 22px;
  color: #000000 !important;
  stroke: #000000 !important;
  stroke-width: 2.5;
  margin-right: 12px;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #000000 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.search-input::placeholder {
  color: #121212 !important;
  opacity: 1 !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px;
}

.search-clear {
  background: none;
  border: none;
  color: #333333 !important;
  cursor: pointer;
  padding: 6px;
  display: none;
  font-size: 14px;
  border-radius: 50%;
}

/* ==================== 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;
}

.bottom-nav-island-main {
  display: contents;
}

#nav-btn-home { order: 1; }
#nav-btn-search { order: 2; }
#nav-btn-playlists { order: 3; }
#nav-btn-favorites { order: 4; }
#nav-btn-offline { order: 5; }

.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 (1:1 SPOTIFY) ==================== */
.now-playing-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1b4d2e 0%, #0e2918 55%, #121212 100%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 8px) 22px calc(var(--safe-bottom) + 14px) 22px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.5s ease;
  overflow: hidden;
}

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

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

.np-playlist-name {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.np-content-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 24px;
}
.np-content-scroll::-webkit-scrollbar {
  display: none;
}

.np-cover-container {
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 330px;
  margin: 6px auto 22px auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  touch-action: pan-y;
  cursor: grab;
  position: relative;
}

.np-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.25s ease;
}

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

.np-track-text {
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}

.np-title {
  font-size: 21px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-btn-heart {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.np-btn-heart:active {
  transform: scale(0.9);
}

.np-scrubber-container {
  margin-bottom: 12px;
  padding: 0 2px;
}

.np-slider-wrapper {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  display: flex;
  align-items: center;
}

.np-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #FFFFFF;
  border-radius: 2px;
  pointer-events: none;
}

.np-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 100%;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0;
  position: relative;
  z-index: 2;
}

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

.np-time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 8px;
  font-feature-settings: "tnum";
}

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

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

.np-btn-ctrl {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  transition: color 0.15s, transform 0.15s;
}
.np-btn-ctrl:active {
  transform: scale(0.9);
}

.np-btn-ctrl.active {
  color: #1DB954;
}
.np-btn-ctrl.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 4px;
  background: #1DB954;
  border-radius: 50%;
}

.np-utilities {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  margin-bottom: 22px;
}

/* Aperçu des paroles Card */
.np-lyrics-card {
  border-radius: 16px;
  padding: 20px;
  background: #1e6b37;
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.15s, background 0.4s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin-top: 6px;
}
.np-lyrics-card:active {
  transform: scale(0.98);
}

.np-lyrics-card-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 14px;
}

.np-lyrics-card-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.np-lyrics-line {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s, opacity 0.2s;
}
.np-lyrics-line.active {
  color: #FFFFFF;
  opacity: 1;
}

.np-lyrics-expand-btn {
  background: #FFFFFF;
  color: #000000;
  border: none;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}
.np-lyrics-expand-btn:active {
  transform: scale(0.95);
}

.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;
}

/* ==================== TRACK ITEM VISUAL CLEAN ==================== */
.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: 1;
}

.track-item.track-unavailable .track-title {
  color: #FFFFFF !important;
}

.track-item.track-unavailable .track-artist {
  color: #A7A7A7 !important;
}

/* ==================== OFFLINE UNPLAYABLE TRACKS ==================== */
.track-item.track-offline-unplayable {
  opacity: 0.35 !important;
  filter: grayscale(100%);
  transition: opacity 0.25s ease, filter 0.25s ease;
  cursor: not-allowed;
}

.track-item.track-offline-unplayable .track-title {
  color: #8E8E93 !important;
}

.track-item.track-offline-unplayable .track-artist {
  color: #636366 !important;
}

/* ==================== KPI CARDS & ADMIN COMPONENTS ==================== */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.admin-kpi-card {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-kpi-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8E8E93;
  margin-bottom: 4px;
}

.admin-kpi-value {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-kpi-sub {
  font-size: 10px;
  color: #1DB954;
  margin-top: 2px;
}

.admin-log-pill-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 10px;
}

.admin-log-pill-bar::-webkit-scrollbar {
  display: none;
}

.admin-log-pill {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  background: #242424;
  color: #A7A7A7;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.admin-log-pill.active {
  background: #1DB954;
  color: #000000;
  border-color: #1DB954;
}

.admin-log-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.4;
}

/* ==================== SEARCH FILTER PILLS ==================== */
.search-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.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;
  flex-shrink: 0;
}

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

/* ==================== PLAYLIST & TRACK BADGES ==================== */
.badge-in-library {
  background: rgba(29, 185, 84, 0.15);
  color: #1DB954;
  border: 1px solid rgba(29, 185, 84, 0.35);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
}

.badge-cloud {
  background: rgba(255, 255, 255, 0.08);
  color: #b3b3b3;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.playlist-hero-favorite-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #b3b3b3;
  transition: transform 0.15s, color 0.15s, background 0.15s;
}

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

.playlist-hero-favorite-btn.active {
  color: #1DB954;
}

.playlist-hero-favorite-btn.active svg {
  fill: #1DB954;
  stroke: #1DB954;
}

/* ==================== 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 DOWNLOAD BANNER (REPLACED BY AVATAR RING) ==================== */
.global-download-banner {
  display: none !important;
}

/* ==================== SETTINGS DOWNLOAD PROGRESS CARD ==================== */
.settings-download-card {
  border: 1px solid rgba(29, 185, 84, 0.3) !important;
  background: linear-gradient(180deg, rgba(29, 185, 84, 0.08) 0%, rgba(24, 24, 24, 1) 100%) !important;
  animation: fadeIn 0.25s ease-out;
}

.settings-dl-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.settings-dl-percent {
  font-size: 28px;
  font-weight: 800;
  color: #1DB954;
  min-width: 60px;
  letter-spacing: -0.5px;
}

.settings-dl-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-dl-track {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-dl-status {
  font-size: 12px;
  color: #A7A7A7;
}

.settings-dl-badge {
  font-size: 11px;
  font-weight: 700;
  background: rgba(29, 185, 84, 0.2);
  color: #1DB954;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.settings-dl-queue-preview {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-dl-queue-item {
  font-size: 11px;
  color: #B3B3B3;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-dl-queue-item svg {
  flex-shrink: 0;
}







/* ==================== iOS NATIVE / SPOTIFY DARK THEME SETTINGS & ADMIN ==================== */
.settings-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 22px 16px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ios-grouped-list {
  background: #1C1C1E;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 16px 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ios-list-row {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
  color: #FFFFFF;
  transition: background 0.15s ease;
}

.ios-list-row:last-child {
  border-bottom: none;
}

.ios-list-row:active {
  background: rgba(255, 255, 255, 0.04);
}

.ios-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.ios-row-left svg {
  color: #8E8E93;
  flex-shrink: 0;
}

.ios-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ios-row-title {
  font-size: 14px;
  font-weight: 500;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-row-subtitle {
  font-size: 12px;
  color: #8E8E93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ios-row-val {
  font-size: 13px;
  color: #8E8E93;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ios-chevron {
  color: #636366;
  flex-shrink: 0;
}

/* iOS Switch */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #39393D;
  transition: 0.25s;
  border-radius: 26px;
}

.ios-switch-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.ios-switch input:checked + .ios-switch-slider {
  background-color: #1DB954;
}

.ios-switch input:checked + .ios-switch-slider:before {
  transform: translateX(18px);
}

/* iOS Stepper */
.ios-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  height: 28px;
}

.ios-stepper-btn {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 600;
  padding: 0 10px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-stepper-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.ios-stepper-val {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1DB954;
}

/* Micro bar for container CPU/RAM and storage */
.ios-micro-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

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

/* Live audio wave indicator */
.audio-wave-wrap {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  width: 16px;
}

.audio-wave-bar {
  width: 3px;
  background: #1DB954;
  border-radius: 1px;
  animation: audioWave 1s ease-in-out infinite alternate;
}

.audio-wave-bar:nth-child(1) { height: 30%; animation-delay: 0.1s; }
.audio-wave-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.audio-wave-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }

@keyframes audioWave {
  0% { height: 20%; }
  100% { height: 100%; }
}

.btn-ios-destructive {
  color: #FF453A;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-ios-destructive:active {
  background: rgba(255, 69, 58, 0.15);
}


/* ==========================================================================
   THEME SELECTOR & SETTINGS PREVIEWS
   ========================================================================== */
.theme-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}

.theme-card {
  background: var(--bg-surface-elevated, #242424);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.theme-card:hover {
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: #1DB954;
}

.theme-preview {
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-preview-header {
  height: 18px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.theme-preview-line {
  height: 4px;
  border-radius: 2px;
}

.theme-preview-body {
  flex: 1;
  padding: 6px 8px;
  display: flex;
  gap: 6px;
}

.theme-preview-card {
  flex: 1;
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-preview-img {
  width: 100%;
  height: 24px;
  border-radius: 4px;
}

.theme-preview-bottom {
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  font-size: 8px;
}

.theme-card-info {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}

.theme-card-name {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.theme-card-badge {
  font-size: 11px;
  color: #8E8E93;
  margin-top: 2px;
}

.theme-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1DB954;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.theme-card.active .theme-card-check {
  display: flex;
}

/* ==========================================================================
   APPLE MUSIC (iOS LIQUID GLASS) 1:1 THEME
   ========================================================================== */
body.theme-apple {
  --bg-black: #FFFFFF;
  --bg-main: #FFFFFF;
  --bg-surface: #F2F2F7;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-hover: #E5E5EA;
  --color-spotify: #FA243C;
  --color-spotify-hover: #D91B32;
  --color-text-base: #000000;
  --color-text-subdued: #8E8E93;
  --color-text-subdued-light: #636366;
  --border-subtle: rgba(0, 0, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  background-color: #FFFFFF;
  color: #000000;
}

html[data-theme="apple"] {
  background-color: #FFFFFF;
}

body.theme-apple #app {
  background-color: #FFFFFF;
}

body.theme-apple .main-view {
  background-color: #FFFFFF;
  color: #000000;
  padding-bottom: calc(130px + var(--safe-bottom));
}

/* App Header in Apple Music */
body.theme-apple .app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

body.theme-apple .app-header .app-title {
  color: #000000;
}

body.theme-apple #header-btn-profile {
  background: #FA243C;
  color: #FFFFFF;
}

body.theme-apple #home-filter-pills {
  display: none !important;
}

body.theme-apple .quick-grid {
  display: none !important;
}

/* Apple Music Home Page Header & Pour vous */
body.theme-apple .am-home-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px 20px;
}

body.theme-apple .am-home-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #000000;
}

body.theme-apple .am-home-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FA243C, #FF5E3A);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(250, 36, 60, 0.3);
}

body.theme-apple .am-for-you-section {
  display: block !important;
  margin: 10px 0 24px 0;
}

body.theme-apple .am-section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #000000;
  padding: 0 20px 14px 20px;
}

body.theme-apple .am-for-you-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 0 20px 12px 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

body.theme-apple .am-for-you-carousel::-webkit-scrollbar {
  display: none;
}

body.theme-apple .am-replay-card {
  min-width: 250px;
  max-width: 270px;
  height: 320px;
  border-radius: 18px;
  background: linear-gradient(145deg, #FF2D55 0%, #FF375F 25%, #FF9500 70%, #FFCC00 100%);
  padding: 24px 20px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 30px rgba(255, 45, 85, 0.35);
  cursor: pointer;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}

body.theme-apple .am-replay-card:active {
  transform: scale(0.98);
}

body.theme-apple .am-replay-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  opacity: 0.9;
}

body.theme-apple .am-replay-big-title {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -1px;
  margin-top: 4px;
}

body.theme-apple .am-replay-desc {
  font-size: 14px;
  opacity: 0.92;
  line-height: 1.35;
  font-weight: 500;
}

body.theme-apple .am-hero-card {
  min-width: 250px;
  max-width: 270px;
  height: 320px;
  border-radius: 18px;
  background: #F2F2F7;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  scroll-snap-align: start;
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.15s ease;
}

body.theme-apple .am-hero-card:active {
  transform: scale(0.98);
}

body.theme-apple .am-hero-card img {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

body.theme-apple .am-hero-card-meta {
  margin-top: 10px;
}

body.theme-apple .am-hero-card-subtitle {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #FA243C;
  letter-spacing: 0.5px;
}

body.theme-apple .am-hero-card-title {
  font-size: 17px;
  font-weight: 700;
  color: #000000;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Home Section Titles & Cards */
body.theme-apple .section-title {
  color: #000000;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
}

body.theme-apple .section-title::after {
  content: " ›";
  color: #C7C7CC;
  font-size: 22px;
  margin-left: 4px;
}

body.theme-apple .media-card {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

body.theme-apple .media-card:hover {
  background: transparent;
}

body.theme-apple .media-card-img {
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

body.theme-apple .media-card-title {
  color: #000000;
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 6px;
}

body.theme-apple .media-card-desc {
  color: #8E8E93;
  font-size: 12px;
}

/* Liquid Glass Floating Mini Player */
body.theme-apple .mini-player {
  bottom: calc(66px + var(--safe-bottom) + 10px);
  left: 12px;
  right: 12px;
  height: 56px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border-radius: 28px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.95);
  border: 0.5px solid rgba(255, 255, 255, 0.45);
  padding: 6px 16px 6px 10px;
  color: #000000;
}

body.theme-apple .mini-player-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-right: 12px;
}

body.theme-apple .mini-player-title {
  color: #000000;
  font-weight: 600;
  font-size: 14px;
}

body.theme-apple .mini-player-artist {
  color: #8E8E93;
  font-size: 12px;
}

body.theme-apple .mini-player-controls {
  gap: 16px;
}

body.theme-apple #mini-btn-heart {
  display: none !important;
}

body.theme-apple .mini-player-progress-line {
  display: none !important;
}

body.theme-apple #mini-btn-play {
  color: #000000;
}

body.theme-apple #mini-btn-next {
  display: flex !important;
  color: #000000;
}

/* Floating Two-Island Liquid Glass Bottom Nav */
body.theme-apple .bottom-nav {
  bottom: calc(var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  height: 56px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: none;
  pointer-events: none;
}

body.theme-apple .bottom-nav-island-main {
  display: flex !important;
  align-items: center;
  justify-content: space-around;
  flex: 1;
  height: 56px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border-radius: 28px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.95);
  border: 0.5px solid rgba(255, 255, 255, 0.45);
  padding: 0 6px;
  pointer-events: auto;
}

body.theme-apple #nav-btn-search {
  order: 99 !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 0.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  pointer-events: auto;
}

body.theme-apple #nav-btn-search span {
  display: none;
}

body.theme-apple #nav-btn-search svg {
  width: 24px;
  height: 24px;
}

body.theme-apple .nav-item {
  color: #8E8E93;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s ease;
  pointer-events: auto;
}

body.theme-apple .nav-item.active {
  color: #FA243C;
  background: rgba(250, 36, 60, 0.08);
}

body.theme-apple #nav-btn-search.active {
  color: #FA243C;
  background: rgba(250, 36, 60, 0.12);
}

/* Search View in Apple Music Theme */
body.theme-apple .am-search-header {
  display: block !important;
  padding: 12px 20px 4px 20px;
}

body.theme-apple .am-search-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #000000;
}

body.theme-apple .search-container {
  padding: 8px 20px;
}

body.theme-apple .search-input-wrapper {
  background: #EBEBF0;
  border-radius: 12px;
  height: 42px;
  padding: 0 12px;
  border: none;
}

body.theme-apple .search-input {
  color: #000000;
  font-size: 16px;
}

body.theme-apple .search-input::placeholder {
  color: #8E8E93;
  font-size: 15px;
}

body.theme-apple .search-icon {
  color: #8E8E93;
}

body.theme-apple .search-pills {
  padding: 0 20px 10px 20px;
}

body.theme-apple .search-pill-btn {
  background: #EBEBF0;
  color: #000000;
  border: none;
  font-weight: 600;
  font-size: 13px;
}

body.theme-apple .search-pill-btn.active {
  background: #FA243C;
  color: #FFFFFF;
}

body.theme-apple .am-categories-container {
  display: block !important;
  padding: 4px 20px 80px 20px;
}

body.theme-apple .am-categories-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #000000;
  margin-bottom: 14px;
}

body.theme-apple .am-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

body.theme-apple .am-category-tile {
  height: 105px;
  border-radius: 12px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease;
}

body.theme-apple .am-category-tile:active {
  transform: scale(0.97);
}

body.theme-apple .am-category-tile span {
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body.theme-apple .am-category-icon-bg {
  position: absolute;
  right: -6px;
  bottom: -6px;
  font-size: 52px;
  opacity: 0.35;
  transform: rotate(15deg);
  z-index: 1;
}

/* Playlist / Album Detail in Apple Music Theme */
body.theme-apple .playlist-hero,
body.theme-apple .album-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px 16px 20px;
  background: transparent;
}

body.theme-apple .playlist-cover,
body.theme-apple .album-cover {
  width: 210px;
  height: 210px;
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
  margin-bottom: 18px;
}

body.theme-apple .playlist-title,
body.theme-apple .album-title {
  font-size: 24px;
  font-weight: 800;
  color: #000000;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

body.theme-apple .playlist-meta,
body.theme-apple .album-meta {
  font-size: 13.5px;
  color: #8E8E93;
  margin-bottom: 20px;
}

.am-playlist-actions {
  display: none;
}

body.theme-apple .playlist-hero-actions {
  display: none !important;
}

body.theme-apple .am-playlist-actions {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 20px auto;
}

body.theme-apple .am-btn-action-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F2F2F7;
  border: none;
  color: #FA243C;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
}

body.theme-apple .am-btn-action-round:active {
  transform: scale(0.92);
}

body.theme-apple .am-btn-play-pill {
  flex: 1;
  height: 46px;
  border-radius: 23px;
  background: #000000;
  color: #FFFFFF;
  border: none;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: transform 0.15s;
}

body.theme-apple .am-btn-play-pill:active {
  transform: scale(0.97);
}

body.theme-apple .track-row {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  padding: 10px 16px;
}

body.theme-apple .track-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.theme-apple .track-row-title {
  color: #000000;
  font-weight: 600;
}

body.theme-apple .track-row-artist {
  color: #8E8E93;
}

body.theme-apple .track-row-num {
  color: #8E8E93;
}

/* Fullscreen Now Playing Overlay in Apple Music Theme */
body.theme-apple #now-playing-overlay {
  background: linear-gradient(180deg, rgba(30, 30, 40, 0.95) 0%, rgba(15, 15, 20, 0.98) 100%);
  color: #FFFFFF;
}

body.theme-apple .np-grab-bar {
  display: block;
  width: 38px;
  height: 5px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  margin: 10px auto 4px auto;
}

body.theme-apple .np-cover-img {
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

body.theme-apple .np-title {
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

body.theme-apple .np-artist {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

body.theme-apple .np-btn-play {
  background: transparent !important;
  color: #FFFFFF !important;
  transform: scale(1.3);
}

body.theme-apple .np-btn-play:hover {
  transform: scale(1.35);
}

body.theme-apple .am-vol-row {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 14px 24px 8px 24px;
  color: rgba(255, 255, 255, 0.5);
}

body.theme-apple .am-vol-slider-wrap {
  flex: 1;
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  display: flex;
  align-items: center;
}

body.theme-apple .am-vol-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  pointer-events: none;
}

body.theme-apple .am-vol-slider {
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

body.theme-apple .am-toolbar {
  display: flex !important;
  align-items: center;
  justify-content: space-around;
  padding: 12px 30px 24px 30px;
}

body.theme-apple .am-tb-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.15s;
}

body.theme-apple .am-tb-btn:active {
  transform: scale(0.9);
  color: #FA243C;
}

body.theme-apple .am-tb-btn.active {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.2);
}

/* Synchronized Lyrics (Karaoke Sing) in Apple Music Theme */
body.theme-apple .am-lyrics-top-bar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 16px 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(20px);
}

body.theme-apple .lyrics-top-bar {
  display: none !important;
}

body.theme-apple .am-lyrics-meta-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 60%;
}

body.theme-apple .am-lyrics-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

body.theme-apple .am-lyrics-meta-text {
  min-width: 0;
}

body.theme-apple .am-lyrics-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-apple .am-lyrics-artist {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-apple .am-lyrics-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.theme-apple .lyrics-line {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.4);
  filter: blur(1.4px);
  transform: scale(0.97);
  transform-origin: left center;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 14px 20px;
  cursor: pointer;
}

body.theme-apple .lyrics-line.active {
  color: #FFFFFF;
  filter: blur(0px);
  transform: scale(1.02);
  opacity: 1;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.35);
}

/* Settings View in Apple Music Theme */
body.theme-apple #view-settings,
body.theme-apple #view-admin-users,
body.theme-apple #view-admin-server {
  background: #F2F2F7;
}

body.theme-apple .settings-container {
  background: #F2F2F7;
}

body.theme-apple .ios-grouped-list {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

body.theme-apple .ios-list-row {
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

body.theme-apple .ios-row-title {
  color: #000000;
}

body.theme-apple .ios-row-subtitle {
  color: #8E8E93;
}

body.theme-apple .ios-section-header {
  color: #6E6E73;
}

body.theme-apple .ios-chevron {
  color: #C7C7CC;
}

body.theme-apple .ios-input {
  background: #E5E5EA;
  color: #000000;
}

body.theme-apple .theme-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.theme-apple .theme-card.active {
  border-color: #FA243C;
  box-shadow: 0 4px 14px rgba(250, 36, 60, 0.25);
}

body.theme-apple .theme-card-name {
  color: #000000;
}

body.theme-apple .theme-card-check {
  background: #FA243C;
}

/* Action Sheet in Apple Music Theme */
body.theme-apple .action-sheet {
  background: #F2F2F7;
  color: #000000;
}

body.theme-apple .action-sheet-item {
  color: #000000;
}

body.theme-apple .action-sheet-title {
  color: #000000;
}

body.theme-apple .action-sheet-sub {
  color: #8E8E93;
}

/* ==================== APPLE MUSIC PIXEL-PERFECT REFINEMENTS ==================== */
/* Hide old app-header elements on Home and Search */
body.theme-apple .user-avatar-wrap {
  display: none !important;
}

body.theme-apple #sync-charts-btn {
  display: none !important;
}

body.theme-apple #app-header {
  height: 0px !important;
  min-height: 0px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  overflow: visible !important;
}

/* Back button in Apple theme when navigating deeper */
body.theme-apple #btn-header-back {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  z-index: 60;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-radius: 50%;
  color: #FA243C;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Now playing clean Apple Music look */
body.theme-apple #np-btn-heart {
  display: none !important;
}

body.theme-apple #np-btn-lyrics-icon {
  display: none !important;
}

body.theme-apple .np-utilities {
  display: none !important;
}

body.theme-apple .np-lyrics-card {
  display: none !important;
}

body.theme-apple .np-scrubber-container {
  padding: 10px 24px 6px 24px;
}

body.theme-apple .np-slider-wrapper {
  background: rgba(255, 255, 255, 0.22);
  height: 4px;
  border-radius: 2px;
}

body.theme-apple .np-slider-fill {
  background: #FFFFFF;
  border-radius: 2px;
}

/* Crisp lyrics modal background eliminating ghosting */
body.theme-apple #lyrics-overlay {
  background: rgba(20, 20, 26, 0.98) !important;
  backdrop-filter: blur(50px) saturate(180%);
  -webkit-backdrop-filter: blur(50px) saturate(180%);
}

/* Favorites hero card in Apple theme */
body.theme-apple .playlist-hero-heart {
  width: 210px !important;
  height: 210px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #FF2D55 0%, #FF375F 40%, #FF9500 100%) !important;
  box-shadow: 0 12px 35px rgba(255, 45, 85, 0.3) !important;
  margin-bottom: 18px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure text on light background is dark */
body.theme-apple .spotify-card-title {
  color: #000000 !important;
}

body.theme-apple .spotify-card-sub {
  color: #8E8E93 !important;
}

body.theme-apple [style*="color: #fff"],
body.theme-apple [style*="color:#fff"] {
  color: #000000 !important;
}

body.theme-apple #np-title,
body.theme-apple #np-time-current,
body.theme-apple #np-time-total,
body.theme-apple #now-playing-overlay [style*="color: #fff"],
body.theme-apple #now-playing-overlay [style*="color:#fff"],
body.theme-apple #lyrics-overlay [style*="color: #fff"],
body.theme-apple #lyrics-overlay [style*="color:#fff"] {
  color: #FFFFFF !important;
}

body.theme-apple .settings-container [style*="color:#FFFFFF"],
body.theme-apple .settings-container [style*="color: #FFFFFF"] {
  color: #000000 !important;
}
