/* Vibe Music Player - Samsung One UI / Spotify Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

:root {
  --bg-canvas: #121212;
  --surface-0: #121212;
  --surface-1: #181818;
  --surface-2: #201f1f;
  --surface-3: #2a2a2a;
  --surface-4: #353534;
  --surface-dim: #0e0e0e;
  
  --primary: #00b3ff;
  --primary-hover: #1ec8d7;
  --primary-glow: rgba(0, 174, 255, 0.4);
  --primary-glow-subtle: rgba(29, 159, 185, 0.15);
  --on-primary: #002108;
  
  --text-high: #ffffff;
  --text-medium: #b3b3b3;
  --text-low: #757575;
  --text-muted: #535353;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(29, 185, 169, 0.6);
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  
  --nav-height: 72px;
  --mini-player-height: 64px;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-high);
  font-family: var(--font-family);
  overflow-x: clip;
  overscroll-behavior-y: none;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Material Symbols configuration */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.fill-1 {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24 !important;
}

/* Hide scrollbars universally */
::-webkit-scrollbar {
  display: none;
}
* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* App Shell Container */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 500px; /* One UI mobile optimized frame, responsive on wider screens */
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-canvas);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
}

/* Header Component */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  z-index: 50;
  padding-top: var(--safe-top);
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
}

.header-inner {
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #117a35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.app-logo .material-symbols-outlined {
  color: #ffffff;
  font-size: 20px;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-high);
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: var(--surface-3);
  color: var(--text-medium);
  font-size: 11px;
  font-weight: 600;
}

.connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--surface-2);
}

.user-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
}

/* Global Search Input Box in Header */
.header-search-bar {
  display: flex;
  align-items: center;
  height: 42px;
  max-height: 42px;
  padding: 0 14px;
  background: var(--surface-3);
  border-radius: 9999px;
  gap: 10px;
  transition: height 0.28s cubic-bezier(0.2, 0.9, 0.3, 1),
              max-height 0.28s cubic-bezier(0.2, 0.9, 0.3, 1),
              opacity 0.22s ease,
              transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1),
              margin 0.28s cubic-bezier(0.2, 0.9, 0.3, 1),
              padding 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  border: 1px solid transparent;
  overflow: hidden;
  will-change: transform, opacity, height;
  transform-origin: top center;
}

.app-header.search-bar-hidden .header-search-bar,
.header-search-bar.is-collapsed {
  height: 0 !important;
  max-height: 0 !important;
  min-height: 0 !important;
  opacity: 0 !important;
  transform: translateY(-24px) scaleY(0.7) !important;
  margin-top: -10px !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  border-width: 0 !important;
}

.app-header.search-bar-hidden .header-inner {
  gap: 0;
  padding-bottom: 8px;
}

.header-search-bar:focus-within {
  background: var(--surface-4);
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--primary-glow-subtle);
}

.header-search-bar .search-icon {
  color: var(--text-medium);
  font-size: 20px;
}

.header-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-high);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
}

.header-search-bar input::placeholder {
  color: var(--text-medium);
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-medium);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.clear-search-btn.visible {
  display: flex;
}

/* Filter Chips Bar (Visible ONLY in Search Mode or focused search) */
.filter-chips-rail {
  display: none;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin: 0 -4px;
}

#app-container.search-mode .filter-chips-rail,
.search-mode .filter-chips-rail {
  display: flex;
}

/* Library Mode: Hide search bar completely from Your Library page */
#app-container.library-mode .header-search-bar,
.library-mode .header-search-bar {
  display: none !important;
}

#app-container.library-mode .filter-chips-rail,
.library-mode .filter-chips-rail {
  display: none !important;
}

#app-container.library-mode .main-viewport,
.library-mode .main-viewport {
  padding-top: calc(var(--safe-top) + 68px);
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--surface-3);
  color: var(--text-high);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.filter-chip.active {
  background: var(--primary);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Main Views Container */
.main-viewport {
  flex: 1;
  /* Compact offset for Home */
  padding-top: calc(var(--safe-top) + 116px);
  padding-bottom: calc(var(--nav-height) + var(--mini-player-height) + var(--safe-bottom) + 80px);
  padding-left: 16px;
  padding-right: 16px;
  min-height: 100vh;
  transition: padding-top 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.scroll-bottom-spacer {
  height: 160px;
  width: 100%;
  flex-shrink: 0;
  pointer-events: none;
  clear: both;
}

#app-container.search-mode .main-viewport,
.search-mode .main-viewport {
  /* Offset for sticky header with visible filter chips */
  padding-top: calc(var(--safe-top) + 158px);
}

.tab-view {
  display: none;
  animation: fadeIn 0.2s ease forwards;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home Screen Layout */
.home-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-high);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-medium);
}

.section-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Jump Back In (2-Column One UI Grid) */
.quick-play-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-play-card {
  display: flex;
  align-items: center;
  background: var(--surface-1);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  position: relative;
  border: 1px solid var(--border-subtle);
  min-height: 56px;
}

.quick-play-card:hover {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.14);
}

.quick-play-card:active {
  transform: scale(0.98);
  background: var(--surface-2);
}

.quick-play-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}

.quick-play-thumb-gradient {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #450af5 0%, #8e2de2 50%, #f000ff 100%);
  color: #ffffff;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.quick-play-thumb-gradient .material-symbols-outlined {
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.quick-play-thumb-create {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 179, 255, 0.08);
  border-right: 1px dashed rgba(0, 179, 255, 0.3);
  color: var(--primary);
}

.quick-play-info {
  flex: 1;
  padding: 0 8px 0 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.quick-play-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.quick-play-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.quick-play-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.quick-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease;
}

.quick-play-card:hover .quick-play-btn {
  transform: scale(1.08);
}

.quick-play-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Horizontal Rail (Tamil Hits & New Releases) */
.horizontal-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 4px 16px 8px;
  min-height: 160px;
}

.rail-skeleton {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: railShimmer 1.5s infinite;
  flex-shrink: 0;
}

@keyframes railShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.rail-card {
  width: 140px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.rail-card-art {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.rail-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rail-card:hover .rail-card-art img {
  transform: scale(1.04);
}

.rail-card-play {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.2s ease;
}

.rail-card:hover .rail-card-play,
.rail-card:active .rail-card-play {
  opacity: 1;
  transform: translateY(0);
}

.rail-card-meta {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.rail-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
}

.rail-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.rail-card-menu-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-medium);
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin: -4px -4px -4px 0;
  position: relative;
  z-index: 2;
  transition: all 0.15s ease;
}

.rail-card-menu-btn:hover {
  color: var(--text-high);
  background: var(--surface-3);
}

.rail-card-menu-btn:active {
  transform: scale(0.9);
  background: var(--surface-4);
}

.rail-card-subtitle {
  font-size: 11px;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Track List (One UI Ergonomic Row) */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(32, 31, 31, 0.4);
  cursor: pointer;
  transition: background 0.15s ease;
}

.track-row:hover {
  background: var(--surface-2);
}

.track-row:active {
  background: var(--surface-3);
}

.track-row.is-active {
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.25);
}

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

.track-thumb-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-3);
}

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

.track-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.track-row:hover .track-hover-overlay {
  opacity: 1;
}

.track-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

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

.track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row.is-active .track-title {
  color: var(--primary);
}

.bitrate-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-4);
  color: var(--primary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.track-row.is-active .bitrate-badge {
  background: var(--primary);
  color: #000;
}

.track-subtitle {
  font-size: 12px;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.track-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.track-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  padding: 0 6px;
}

.eq-bar {
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
  animation: soundwave 1s ease-in-out infinite alternate;
}
.eq-bar:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.eq-bar:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.eq-bar:nth-child(3) { height: 40%; animation-delay: 0.5s; }

@keyframes soundwave {
  0% { height: 25%; }
  100% { height: 100%; }
}

/* Liked State Icon */
.like-btn.is-liked .material-symbols-outlined {
  color: var(--primary);
  font-variation-settings: 'FILL' 1 !important;
}

/* Search Screen Specific */
.search-state-view {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-medium);
}

.search-state-view .material-symbols-outlined {
  font-size: 48px;
  color: var(--surface-4);
  margin-bottom: 12px;
}

.search-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-high);
  margin-bottom: 4px;
}

.search-state-desc {
  font-size: 13px;
  color: var(--text-medium);
  max-width: 280px;
}

/* Library Screen Layout */
.library-hero-banner {
  background: linear-gradient(135deg, #450af5 0%, #283c86 50%, var(--primary) 100%);
  border-radius: 16px;
  padding: 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.library-hero-banner:active {
  transform: scale(0.985);
  filter: brightness(1.05);
}

.library-hero-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  filter: blur(20px);
}

.library-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.library-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.library-hero-icon .material-symbols-outlined {
  font-size: 30px;
  color: #ffffff;
}

.library-hero-title {
  font-size: 18px;
  font-weight: 800;
}

.library-hero-subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.library-hero-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  flex-shrink: 0;
}

/* Device Storage Bar */
.storage-card {
  background: var(--surface-1);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.storage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.storage-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-high);
}

.storage-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--primary-glow-subtle);
  color: var(--primary);
}

.storage-progress-rail {
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 8px;
}

.storage-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--primary);
  width: 42%;
}

.storage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-medium);
}

.storage-footer button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Custom Playlists / Grid or List */
.playlists-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlists-grid.is-grid-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.playlist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.playlists-grid.is-grid-layout .playlist-card {
  flex-direction: column;
  align-items: flex-start;
  padding: 12px;
}

.playlist-card:hover {
  background: var(--surface-2);
}

.playlist-card:active {
  transform: scale(0.985);
  background: var(--surface-2);
}

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

.playlists-grid.is-grid-layout .playlist-card-left {
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 8px;
}

.playlist-art {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface-3);
  object-fit: cover;
  flex-shrink: 0;
}

.playlists-grid.is-grid-layout .playlist-art {
  width: 100%;
  height: 120px;
  border-radius: 8px;
}

.playlist-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.playlist-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-subtitle {
  font-size: 12px;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Bottom Persistent Mini-Player */
.mini-player {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  max-width: 484px;
  height: var(--mini-player-height);
  background: rgba(36, 36, 36, 0.95);
  backdrop-filter: blur(24px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 45;
  display: none;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  animation: slideUpMini 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.mini-player.visible {
  display: flex;
}

@keyframes slideUpMini {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.mini-progress-bar {
  width: 100%;
  height: 2.5px;
  background: var(--surface-4);
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: none;
}

.mini-player-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 8px;
}

.mini-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.mini-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.mini-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.mini-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.mini-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mini-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.mini-play-btn .material-symbols-outlined {
  font-size: 22px;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 48px;
  color: var(--text-medium);
  text-decoration: none;
  gap: 3px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: var(--font-family);
  transition: color 0.15s ease, transform 0.15s ease;
}

.nav-item .material-symbols-outlined {
  font-size: 24px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1 !important;
}

/* Fullscreen Now Playing Overlay View */
.now-playing-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  height: 100%;
  background: var(--bg-canvas);
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 22px calc(var(--safe-bottom) + 22px);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow-y: auto;
}

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

.player-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  margin-bottom: 4px;
}

.player-top-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 200px;
}

.player-top-title span:first-child {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-medium);
}

.player-top-title span:last-child {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Large Album Art Center Stage */
.artwork-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 320px;
  margin: 8px auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artwork-glow {
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  background: var(--primary);
  filter: blur(44px);
  opacity: 0.35;
  transition: opacity 0.5s ease;
}

.artwork-image {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  position: relative;
  z-index: 2;
  background: var(--surface-2);
}



/* Track Metadata & Heart */
.player-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 12px;
}

.player-meta-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  padding-right: 12px;
}

.player-track-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-artist {
  font-size: 15px;
  color: var(--text-medium);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-heart-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  color: var(--text-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.player-heart-btn.is-liked {
  color: var(--primary);
}

.player-heart-btn:active {
  transform: scale(1.15);
}

/* Audio Scrubber */
.scrubber-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 16px;
}

.scrubber-rail {
  position: relative;
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.scrubber-track {
  width: 100%;
  height: 5px;
  border-radius: 9999px;
  background: var(--surface-4);
  position: relative;
  overflow: hidden;
}

.scrubber-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--primary);
  width: 0%;
  box-shadow: 0 0 10px var(--primary-glow);
}

.scrubber-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scrubber-thumb::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.scrubber-timestamps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-medium);
  font-weight: 500;
  margin-top: -4px;
}

/* Playback Control Stage (One UI Reachability) */
.playback-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--text-high);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

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

.control-btn.active-mode {
  color: var(--primary);
}

.control-btn.active-mode::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.giant-play-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--primary);
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px var(--primary-glow);
  cursor: pointer;
  transition: all 0.2s ease;
}

.giant-play-btn:active {
  transform: scale(0.94);
  background: var(--primary-hover);
}

.giant-play-btn .material-symbols-outlined {
  font-size: 38px;
}

/* Queue Open Row (Balanced Samsung One UI layout) */
.player-bottom-info {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.queue-open-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text-high);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.queue-open-btn:active {
  transform: scale(0.96);
  background: var(--surface-3);
}

/* Up Next Queue Drawer (Slide-up Sheet) */
.queue-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.queue-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.queue-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 500px;
  max-height: 86vh;
  background: var(--surface-1);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  z-index: 75;
  display: flex;
  flex-direction: column;
  padding: 10px 16px calc(var(--safe-bottom) + 16px);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.queue-drawer.open {
  transform: translate(-50%, 0);
}

.drawer-grab-handle {
  width: 44px;
  height: 5px;
  border-radius: 9999px;
  background: var(--surface-4);
  margin: 4px auto 14px;
  cursor: grab;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.drawer-title-group h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-high);
}

.drawer-title-group span {
  font-size: 12px;
  color: var(--text-medium);
}

.drawer-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-medium);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 9999px;
}

.drawer-clear-btn:hover {
  color: #ffb4ab;
  background: rgba(255, 180, 171, 0.1);
}

/* Queue Controls Row (Shuffle & Autoplay Switch) */
.queue-options-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.queue-shuffle-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--surface-3);
  color: var(--text-high);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.queue-shuffle-toggle.active {
  background: var(--primary);
  color: #000;
  font-weight: 700;
}

.autoplay-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-high);
}

/* One UI Switch */
.one-ui-switch {
  width: 38px;
  height: 22px;
  border-radius: 9999px;
  background: var(--surface-4);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
}

.one-ui-switch.active {
  background: var(--primary);
}

.one-ui-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.one-ui-switch.active .one-ui-knob {
  transform: translateX(16px);
  background: #000000;
}

/* Queue Current Playing Card */
.queue-current-card {
  position: relative;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(29, 185, 84, 0.3);
}

.queue-current-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--primary-glow-subtle), transparent);
  pointer-events: none;
}

/* Queue Items Scrollable List */
.queue-scroll-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  min-height: 150px;
}

.queue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.2s ease, opacity 0.2s ease;
}

.queue-row:hover {
  background: var(--surface-2);
}

.queue-drag-handle {
  color: var(--text-low);
  padding: 4px;
  cursor: grab;
}

.queue-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-medium);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-delete-btn:hover {
  color: #ffb4ab;
  background: rgba(255, 180, 171, 0.15);
}

/* Modal Dialog: New Playlist & Rename Playlist */
.playlist-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

@media (max-width: 600px) {
  .playlist-modal-backdrop {
    align-items: flex-start;
    padding-top: max(80px, 14vh);
  }
}

.playlist-dialog {
  background: var(--surface-1, #1e1e1e);
  border-radius: 20px;
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: dialogPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dialogPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.playlist-dialog h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-high, #ffffff);
  margin: 0;
}

.playlist-dialog-subtitle {
  font-size: 13px;
  color: var(--text-medium, #a0a0a0);
  margin-top: -8px;
  margin-bottom: 2px;
}

.playlist-dialog input {
  width: 100%;
  height: 48px;
  background: var(--surface-3, #282828);
  border: 1.5px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  padding: 0 16px;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.playlist-dialog input:focus {
  border-color: var(--primary, #1db954);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.25);
  background: #2e2e2e;
}

.playlist-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}

.dialog-btn-cancel {
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-high, #ffffff);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.dialog-btn-cancel:active {
  background: rgba(255, 255, 255, 0.16);
}

.dialog-btn-save {
  min-height: 40px;
  padding: 10px 22px;
  border-radius: 9999px;
  background: var(--primary, #1db954);
  color: #000000;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dialog-btn-save:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

/* Toast Feedback Pill */
.action-toast {
  position: fixed;
  top: calc(var(--safe-top) + 64px);
  left: 50%;
  transform: translate(-50%, -20px);
  background: var(--surface-4);
  color: var(--text-high);
  padding: 8px 18px;
  border-radius: 9999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
}

.action-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.action-toast .material-symbols-outlined {
  color: var(--primary);
  font-size: 18px;
}

/* Artists Rail (Library) */
.artists-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 4px 16px;
}

.artist-circle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  flex-shrink: 0;
  cursor: pointer;
}

.artist-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.artist-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-high);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}



/* ===================================================
   Song Context Menu (Add to Playlist / Queue)
   =================================================== */
.song-context-dialog {
  background: var(--surface-1);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
}

.context-dialog-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.context-actions-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.context-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-high);
  transition: background 0.15s ease;
}

.context-action-row:hover, .context-action-row:active {
  background: var(--surface-2);
}

.context-action-row .material-symbols-outlined {
  font-size: 22px;
  flex-shrink: 0;
}

.context-action-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.context-action-sub {
  font-size: 11px;
  color: var(--text-medium);
  font-weight: 400;
  margin-top: 1px;
}

.context-create-pl-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.context-create-pl-link:hover, .context-create-pl-link:active {
  background: var(--surface-3);
}

.context-playlists-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.context-playlist-item:hover, .context-playlist-item:active {
  background: var(--surface-2);
}

.context-playlist-item img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

/* Skeleton Loading for Rails */
.rail-skeleton {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================================
   Real Dedicated Playlist Detail Modal & Inline Finder
   ======================================================== */
.playlist-detail-modal {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 100%;
  background: var(--bg-canvas, #121212);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.playlist-detail-modal.open {
  display: flex;
  animation: slideUpPlaylist 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpPlaylist {
  from {
    opacity: 0;
    transform: translate(-50%, 30px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.playlist-detail-sheet {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 40px;
}

.sheet-grab-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-4, rgba(255, 255, 255, 0.2));
  margin: 10px auto 4px;
  cursor: pointer;
}

.playlist-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(16px);
  z-index: 10;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.playlist-detail-nav-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.playlist-detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.12) 0%, rgba(18, 18, 18, 0) 100%);
}

.playlist-detail-cover-wrapper {
  width: 170px;
  height: 170px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 16px;
  background: var(--surface-2);
}

.playlist-detail-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-detail-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 4px;
}

.playlist-detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-high);
  letter-spacing: -0.02em;
  margin: 0;
}

.playlist-rename-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--surface-3);
  color: var(--text-medium);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}

.playlist-rename-chip:hover, .playlist-rename-chip:active {
  background: var(--surface-4);
  color: var(--text-high);
}

.playlist-detail-stats {
  font-size: 13px;
  color: var(--text-medium);
  margin-top: 6px;
}

.playlist-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.playlist-play-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 9999px;
  background: var(--primary);
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.playlist-play-all-btn:active {
  transform: scale(0.96);
}

.playlist-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: var(--surface-3);
  color: var(--text-high);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
}

.playlist-secondary-btn:active {
  background: var(--surface-4);
}

/* Inline Song Finder Drawer */
.playlist-song-finder {
  margin: 12px 16px;
  padding: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.playlist-finder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.playlist-finder-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0 12px;
  height: 42px;
}

.playlist-finder-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-high);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.playlist-finder-results {
  max-height: 240px;
  overflow-y: auto;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.finder-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  gap: 10px;
}

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

.finder-track-art {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.finder-track-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.finder-track-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.finder-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--surface-3);
  color: var(--text-high);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.finder-add-btn.added {
  background: rgba(0, 229, 255, 0.2);
  color: var(--primary);
  border-color: rgba(0, 229, 255, 0.4);
}

/* Playlist tracks content */
.playlist-detail-content {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-songs-header {
  padding: 12px 4px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.playlist-songs-count {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-medium);
}

.playlist-empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-medium);
}

.playlist-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.playlist-empty-icon span {
  font-size: 30px;
  color: var(--text-medium);
}

.playlist-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-high);
}

.playlist-empty-desc {
  font-size: 12px;
  margin-top: 4px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.playlist-remove-btn {
  color: var(--text-medium);
  transition: color 0.15s ease;
}

.playlist-remove-btn:hover {
  color: #ff5252;
}

/* ========================================================
   App Loading Screen & Error Page
   ======================================================== */
.app-loading-screen {
  position: fixed;
  inset: 0;
  background: #0b0f12;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.app-loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.loading-logo-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary, #00e5ff) 0%, #0077b6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.4);
  margin-bottom: 20px;
  animation: logoPulse 1.8s infinite ease-in-out;
}

@keyframes logoPulse {
  0% { transform: scale(0.96); box-shadow: 0 6px 20px rgba(0, 229, 255, 0.3); }
  50% { transform: scale(1.04); box-shadow: 0 14px 40px rgba(0, 229, 255, 0.6); }
  100% { transform: scale(0.96); box-shadow: 0 6px 20px rgba(0, 229, 255, 0.3); }
}

.loading-eq-icon {
  font-size: 38px;
  color: #000000;
}

.loading-brand-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.loading-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.loading-progress-track {
  width: 140px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  margin-top: 24px;
  overflow: hidden;
  position: relative;
}

.loading-progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 45%;
  background: var(--primary, #00e5ff);
  border-radius: 999px;
  animation: loadingSlide 1.2s infinite ease-in-out;
}

@keyframes loadingSlide {
  0% { left: -45%; }
  100% { left: 100%; }
}

/* Custom Network / Offline Error Screen */
.app-error-screen {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 18, 0.98);
  backdrop-filter: blur(18px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease-out;
}

.error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 340px;
}

.error-icon-wrapper {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 82, 82, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 82, 82, 0.25);
}

.error-icon {
  font-size: 34px;
  color: #ff5252;
}

.error-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-high, #ffffff);
  margin: 0;
}

.error-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-medium, rgba(255, 255, 255, 0.7));
  margin: 10px 0 24px;
}

.error-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.error-retry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 9999px;
  background: var(--primary, #00e5ff);
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.error-retry-btn:active {
  transform: scale(0.97);
}

.error-library-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 9999px;
  background: var(--surface-3, #222);
  color: var(--text-high, #fff);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  cursor: pointer;
}

