/* ==========================================================================
   Spotify Playlist Cloner & Downloader - Dark UI Styling
   ========================================================================== */

:root {
  --bg-base: #121212;
  --bg-surface: #181818;
  --bg-surface-elevated: #242424;
  --bg-card-hover: #2a2a2a;
  --border-color: rgba(255, 255, 255, 0.08);

  --spotify-green: #1db954;
  --spotify-green-hover: #1ed760;
  --spotify-green-glow: rgba(29, 185, 84, 0.35);

  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #9e9e9e;

  --status-pending: #4a5568;
  --status-searching: #d69e2e;
  --status-downloading: #3182ce;
  --status-tagging: #805ad5;
  --status-completed: #38a169;
  --status-failed: #e53e3e;

  --font-main: "Inter", "Circular Std", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 90px; /* Space for sticky download bar */
}

/* ==========================================================================
   Top Navigation
   ========================================================================== */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1db954, #1ed760);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.status-pill.ready .status-dot {
  background-color: var(--spotify-green);
  box-shadow: 0 0 8px var(--spotify-green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  padding: 10px 22px;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--text-primary);
  color: #000000;
}
.btn-primary:hover {
  transform: scale(1.03);
  background-color: #f0f0f0;
}

.btn-success {
  background-color: var(--spotify-green);
  color: #000000;
  box-shadow: 0 4px 14px var(--spotify-green-glow);
}
.btn-success:hover {
  background-color: var(--spotify-green-hover);
  transform: scale(1.03);
  box-shadow: 0 6px 20px var(--spotify-green-glow);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background-color: #e53e3e;
  color: #ffffff;
}
.btn-danger:hover {
  background-color: #c53030;
}

.btn-large {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-icon:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.btn-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-text-action:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

.main-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ==========================================================================
   Search / Input Hero
   ========================================================================== */

.search-section {
  display: flex;
  flex-direction: column;
}

.search-box-card {
  background: radial-gradient(circle at top right, rgba(29, 185, 84, 0.15), transparent 60%), var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
}

.search-headline {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.search-subhead {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 28px;
}

.url-input-container {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto 20px;
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 44px 14px 44px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}
.input-wrapper input:focus {
  border-color: var(--spotify-green);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.25);
  background-color: #2e2e2e;
}

.btn-clear {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  padding: 4px;
}
.btn-clear:hover {
  color: var(--text-primary);
}

.quick-examples {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Preferences Panel
   ========================================================================== */

.settings-panel {
  animation: slideDown 0.25s ease-out;
}

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

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

.settings-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group select,
.form-group input {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  outline: none;
}
.form-group select:focus,
.form-group input:focus {
  border-color: var(--spotify-green);
}

.form-group small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dir-picker-row {
  display: flex;
  gap: 8px;
}
.dir-picker-row input {
  flex: 1;
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--spotify-green);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   Playlist Header Card
   ========================================================================== */

.playlist-header {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.playlist-cover-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background-color: var(--bg-surface-elevated);
}

.playlist-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.playlist-cover-wrapper:hover .cover-overlay {
  opacity: 1;
}
.playlist-cover-wrapper:hover .playlist-cover {
  transform: scale(1.05);
}

.playlist-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pl-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pl-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.pl-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pl-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.pl-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pl-meta .separator {
  color: var(--text-muted);
}

.pl-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.select-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ==========================================================================
   Tracks List Table
   ========================================================================== */

.tracks-card {
  padding: 16px;
}

.tracks-table-header {
  display: grid;
  grid-template-columns: 36px 36px 1fr 180px 65px 45px 130px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tracks-list {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
}

.track-row {
  display: grid;
  grid-template-columns: 36px 36px 1fr 180px 65px 45px 130px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  transition: background-color 0.15s ease;
}

.track-row:hover,
.track-row:focus-within {
  background-color: var(--bg-card-hover);
}

.track-row:focus-within {
  outline: 1px solid rgba(29, 185, 84, 0.4);
}

.col-check {
  display: flex;
  align-items: center;
}

.track-checkbox,
#check-all {
  accent-color: var(--spotify-green);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.col-num {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.track-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--bg-surface-elevated);
}

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

.track-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.explicit-tag {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 700;
}

.track-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-preview-play {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 50%;
  transition: var(--transition);
}
.btn-preview-play:hover {
  color: var(--spotify-green);
  transform: scale(1.1);
}

.col-album {
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 12px;
}

.col-dur {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.col-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-single-dl {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.btn-single-dl i {
  width: 14px;
  height: 14px;
}

.btn-single-dl:hover {
  background: var(--spotify-green);
  color: #000;
  border-color: var(--spotify-green);
  transform: scale(1.12);
  box-shadow: 0 0 8px var(--spotify-green-glow);
}

.col-status {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

/* Status Badges */
.badge-status {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background-color: var(--status-pending);
  color: #ffffff;
  text-align: center;
}

.badge-status.ready {
  background-color: rgba(29, 185, 84, 0.18);
  color: var(--spotify-green);
  border: 1px solid rgba(29, 185, 84, 0.35);
}

.badge-status.queued {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.badge-status.searching {
  background-color: rgba(214, 158, 46, 0.2);
  color: #ecc94b;
  border: 1px solid rgba(214, 158, 46, 0.4);
}

.badge-status.downloading {
  background-color: rgba(49, 130, 206, 0.2);
  color: #63b3ed;
  border: 1px solid rgba(49, 130, 206, 0.4);
}

.badge-status.tagging {
  background-color: rgba(128, 90, 213, 0.2);
  color: #b794f4;
  border: 1px solid rgba(128, 90, 213, 0.4);
}

.badge-status.completed {
  background-color: rgba(56, 161, 105, 0.2);
  color: #48bb78;
  border: 1px solid rgba(56, 161, 105, 0.4);
}

.badge-status.failed {
  background-color: rgba(229, 62, 62, 0.2);
  color: #f56565;
  border: 1px solid rgba(229, 62, 62, 0.4);
}

/* ==========================================================================
   Sticky Bottom Download Monitor Bar
   ========================================================================== */

.download-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(24, 24, 24, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 14px 32px;
  z-index: 200;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.bar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.pulse-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--spotify-green);
  box-shadow: 0 0 0 0 var(--spotify-green-glow);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); }
}

.bar-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.bar-title {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.bar-counter {
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1db954, #1ed760);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Utilities & Spinners
   ========================================================================== */

.hidden {
  display: none !important;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ==========================================================================
   New UI Components & Optimizations
   ========================================================================== */

.btn-input-action {
  position: absolute;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-input-action:hover {
  background: rgba(29, 185, 84, 0.2);
  border-color: var(--spotify-green);
  color: var(--spotify-green-hover);
}
.btn-input-action i {
  width: 14px;
  height: 14px;
}

.selection-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--spotify-green-hover);
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
}

/* In-Playlist Search & Filter Bar */
.filter-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.filter-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.filter-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.filter-input-wrapper input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.filter-input-wrapper input:focus {
  border-color: var(--spotify-green);
  box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
}

.filter-counter-badge {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

/* Speedometer & Download Bar Metrics */
.bar-metrics-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.bar-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--spotify-green-hover);
}

.bar-metric i {
  width: 13px;
  height: 13px;
}

.bar-metric-sep {
  color: var(--text-muted);
}

/* Floating Mini Audio Player */
.mini-player {
  position: fixed;
  bottom: 84px;
  left: 32px;
  right: 32px;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(24, 24, 24, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 95;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mini-player-track {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  max-width: 280px;
}

.mp-cover {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  background: #282828;
}

.mp-details {
  overflow: hidden;
}

.mp-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-center-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 420px;
}

.btn-mp-play {
  background: var(--spotify-green);
  color: #000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-mp-play:hover {
  background: var(--spotify-green-hover);
  transform: scale(1.06);
}

.btn-mp-play i {
  width: 18px;
  height: 18px;
}

.mp-timeline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.mp-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.mp-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mp-progress-fill {
  height: 100%;
  background: var(--spotify-green);
  border-radius: 2px;
  width: 0%;
}

.mp-right-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.equalizer-bars span {
  width: 3px;
  background: var(--spotify-green);
  border-radius: 1px;
  animation: bounceBar 1.2s infinite ease-in-out alternate;
}

.equalizer-bars span:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.equalizer-bars span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.equalizer-bars span:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.equalizer-bars span:nth-child(4) { height: 80%; animation-delay: 0.4s; }

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

.mp-slider {
  width: 70px;
  accent-color: var(--spotify-green);
  cursor: pointer;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.8);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-success {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.15);
  color: var(--spotify-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-success i {
  width: 36px;
  height: 36px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.modal-stat {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 10px;
}

.stat-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 380px;
  background: #242424;
  border-left: 4px solid var(--spotify-green);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

.toast.toast-success {
  border-left-color: var(--spotify-green);
}

.toast.toast-error {
  border-left-color: var(--status-failed);
}

.toast.toast-info {
  border-left-color: var(--status-downloading);
}

.tracks-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

.tracks-empty-state svg,
.tracks-empty-state i {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.tracks-empty-state h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tracks-empty-state p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Recent Playlists Section
   ========================================================================== */
.recent-section {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  text-align: left;
}

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

.recent-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.recent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.recent-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(29, 185, 84, 0.4);
  transform: translateY(-2px);
}

.recent-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface-elevated);
}

.recent-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.recent-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Skeleton Shimmer Loading
   ========================================================================== */
.skeleton-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
}

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

.shimmer {
  background: linear-gradient(90deg, #181818 25%, #282828 50%, #181818 75%);
  background-size: 200% 100%;
  animation: shimmerAnimation 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-header {
  display: flex;
  gap: 24px;
  align-items: center;
}

.skeleton-cover {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.skeleton-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.skeleton-badge {
  width: 70px;
  height: 20px;
  border-radius: 12px;
}

.skeleton-title {
  width: 65%;
  height: 36px;
}

.skeleton-desc {
  width: 45%;
  height: 18px;
}

.skeleton-meta-row {
  width: 55%;
  height: 22px;
}

.skeleton-tracks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.skeleton-row {
  height: 50px;
  width: 100%;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Quick Quality Switcher Pills
   ========================================================================== */
.quick-quality-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.quick-quality-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-quality-label i {
  width: 16px;
  height: 16px;
  color: var(--spotify-green);
}

.quality-pills {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.pill-btn.active {
  background: var(--spotify-green);
  color: #000000;
  font-weight: 700;
  border-color: var(--spotify-green);
  box-shadow: 0 0 12px var(--spotify-green-glow);
}

/* Sentinel / Load More */
.tracks-sentinel {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}

/* ==========================================================================
   Expandable Live Queue Drawer
   ========================================================================== */
.queue-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 440px;
  max-width: calc(100vw - 48px);
  max-height: 400px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 199;
  animation: slideUpDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.25);
}

.queue-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.queue-heading i {
  width: 16px;
  height: 16px;
  color: var(--spotify-green);
}

.queue-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background-color: var(--spotify-green);
  color: #000;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.queue-items-container {
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
}

.queue-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px 0;
}

.queue-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.82rem;
}

.queue-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  max-width: 280px;
}

.queue-item-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.queue-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.queue-item-title {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Clipboard Auto-Detect Banner
   ========================================================================== */
.clipboard-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.15), rgba(24, 24, 24, 0.95));
  border: 1px solid rgba(29, 185, 84, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: slideDownBanner 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.clipboard-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.clipboard-icon {
  width: 22px;
  height: 22px;
  color: var(--spotify-green);
  flex-shrink: 0;
}

.clipboard-banner-text-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.clipboard-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.clipboard-url {
  font-size: 0.75rem;
  color: var(--text-secondary);
  max-width: 460px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clipboard-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   Quick Filter Chips
   ========================================================================== */
.filter-quick-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-chip.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.filter-chip[data-filter="failed"].active {
  background: rgba(229, 62, 62, 0.25);
  border-color: #e53e3e;
  color: #fc8181;
}

.filter-chip[data-filter="downloaded"].active {
  background: rgba(29, 185, 84, 0.25);
  border-color: var(--spotify-green);
  color: #68d391;
}

/* Warning & Retry Button */
.btn-warning {
  background: #d69e2e;
  color: #000;
}
.btn-warning:hover {
  background: #ecc94b;
  transform: scale(1.03);
  box-shadow: 0 0 12px rgba(214, 158, 46, 0.4);
}

/* Mini Player HQ Additions */
.mp-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mp-quality-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#mp-quality-badge.hq {
  background-color: var(--spotify-green);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 0 8px var(--spotify-green-glow);
}

.btn-preview-play.btn-hq-play {
  color: var(--spotify-green);
}
.btn-preview-play.btn-hq-play:hover {
  transform: scale(1.2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .navbar { padding: 12px 16px; }
  .playlist-header { flex-direction: column; align-items: center; text-align: center; }
  .playlist-cover-wrapper { width: 140px; height: 140px; }
  .pl-meta { justify-content: center; }
  .pl-actions { justify-content: center; }
  .select-controls { margin-left: 0; }
  .tracks-table-header,
  .track-row {
    grid-template-columns: 36px 36px 1fr 40px 105px;
  }
  .col-album, .col-dur { display: none; }
  .url-input-container { flex-direction: column; }
  .mini-player { left: 12px; right: 12px; bottom: 90px; }
  .filter-controls-bar { flex-direction: column; align-items: stretch; }
  .queue-drawer { left: 12px; right: 12px; width: auto; bottom: 85px; }
}

/* ==========================================================================
   Spotify Account Linking & Library Dashboard Styles
   ========================================================================== */

.btn-spotify-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.35);
  color: #1ed760;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-spotify-pill:hover {
  background: rgba(29, 185, 84, 0.25);
  border-color: #1ed760;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.25);
}

.spotify-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spotify-nav-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #1ed760;
}

.nav-tabs-wrapper {
  display: flex;
  justify-content: center;
  margin: 10px 0 24px;
}

.nav-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 6px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: rgba(29, 185, 84, 0.2);
  color: #1ed760;
  border: 1px solid rgba(29, 185, 84, 0.4);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1ed760;
  display: inline-block;
}

/* Library Section */
.library-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease;
}

.library-card-auth {
  text-align: center;
  padding: 50px 30px;
  background: linear-gradient(180deg, rgba(29, 185, 84, 0.08) 0%, rgba(18, 18, 18, 0.95) 100%);
  border: 1px solid rgba(29, 185, 84, 0.25);
  border-radius: 16px;
  max-width: 620px;
  margin: 20px auto;
}

.auth-card-icon {
  display: inline-flex;
  padding: 16px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.1);
  margin-bottom: 18px;
}

.auth-card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 10px;
}

.auth-card-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 24px;
}

.auth-card-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-spotify {
  background: #1db954;
  color: #000000;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-spotify:hover {
  background: #1ed760;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

/* User Profile Banner */
.user-profile-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 14px;
}

.user-profile-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1ed760;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-display-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.badge-status-green {
  background: rgba(29, 185, 84, 0.15);
  color: #1ed760;
  border: 1px solid rgba(29, 185, 84, 0.4);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.user-submeta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.meta-dot {
  color: rgba(255, 255, 255, 0.2);
}

.user-profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(240, 80, 80, 0.4);
  color: #ff6b6b;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline-danger:hover {
  background: rgba(240, 80, 80, 0.15);
  border-color: #ff6b6b;
}

/* Liked Songs Spotlight Card */
.liked-songs-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 36px;
  background: linear-gradient(135deg, #450af5 0%, #8e8ee5 100%);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(69, 10, 245, 0.3);
}

.liked-songs-content {
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 1;
}

.liked-songs-icon-box {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.liked-heart-icon {
  width: 36px;
  height: 36px;
  fill: #ffffff;
  color: #ffffff;
}

.liked-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.08em;
}

.liked-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin: 4px 0;
}

.liked-desc {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.8);
}

.liked-songs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

/* Library Playlists Grid */
.library-playlists-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.library-section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
}

.library-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  width: 240px;
}

.library-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.85rem;
  width: 100%;
}

.library-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.playlist-grid-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.playlist-grid-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.playlist-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #282828;
  margin-bottom: 12px;
}

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

.playlist-card-download-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1ed760;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: var(--transition);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.playlist-grid-card:hover .playlist-card-download-btn {
  opacity: 1;
  transform: translateY(0);
}

.playlist-card-download-btn:hover {
  transform: scale(1.1);
  background: #22e668;
}

.playlist-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.playlist-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-card-author {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.playlist-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.playlist-card-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.playlist-card-actions-row button {
  flex: 1;
  font-size: 0.75rem;
  padding: 6px 8px;
}

/* Auth Modal Specifics */
.auth-modal-card {
  max-width: 480px;
}

.auth-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
}

.auth-method-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: 12px;
}

.auth-badge-recommended {
  font-size: 0.65rem;
  font-weight: 800;
  color: #1ed760;
  background: rgba(29, 185, 84, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 6px;
}

.auth-method-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.auth-method-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 14px;
}

.auth-divider {
  text-align: center;
  position: relative;
  margin: 4px 0;
}

.auth-divider span {
  background: #181818;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.manual-token-input-row {
  display: flex;
  gap: 8px;
}

.manual-token-input-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: #ffffff;
  font-size: 0.82rem;
}
/* ==========================================================================
   Library Card Grid — Playlist Cards
   ========================================================================== */

.library-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.library-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.library-card-cover-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0a0a0a;
}

.library-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.library-card:hover .library-card-cover {
  transform: scale(1.05);
  filter: brightness(0.7);
}

.library-card-play-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--spotify-green);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.library-card-play-btn svg,
.library-card-play-btn i {
  width: 18px;
  height: 18px;
}

.library-card:hover .library-card-play-btn {
  opacity: 1;
  transform: translateY(0);
}

.library-card-play-btn:hover {
  background: var(--spotify-green-hover);
  transform: scale(1.08);
  box-shadow: 0 6px 16px var(--spotify-green-glow);
}

.library-card-info {
  padding: 12px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 48px;
}

.library-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.library-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-card-actions {
  padding: 8px 14px 14px;
  display: flex;
  gap: 8px;
}

.library-card-actions .btn {
  flex: 1;
  font-size: 0.75rem;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.library-card-actions .btn svg,
.library-card-actions .btn i {
  width: 13px;
  height: 13px;
}

.library-card-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

.library-card-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.library-card-actions .btn-primary {
  background: var(--spotify-green);
  color: #000;
}

.library-card-actions .btn-primary:hover {
  background: var(--spotify-green-hover);
  box-shadow: 0 2px 8px var(--spotify-green-glow);
}

/* ==========================================================================
   Library States — Loading, Empty, Error
   ========================================================================== */

.library-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  grid-column: 1 / -1;
  color: var(--text-secondary);
}

.library-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--spotify-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.library-loading p {
  font-size: 0.85rem;
}

.library-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.library-empty svg,
.library-empty i {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

.library-empty p {
  font-size: 0.85rem;
}

.library-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  grid-column: 1 / -1;
  color: var(--status-failed);
  text-align: center;
}

.library-error p {
  font-size: 0.85rem;
}

.library-error .btn {
  margin-top: 8px;
}

/* ==========================================================================
   Library Badges — Connected / Disconnected
   ========================================================================== */

.library-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.badge-connected {
  background: rgba(29, 185, 84, 0.15);
  color: #1DB954;
}

.badge-disconnected {
  background: rgba(229, 62, 62, 0.12);
  color: #e53e3e;
}

/* ==========================================================================
   Spotify Nav Pill Avatar
   ========================================================================== */

.spotify-pill-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--spotify-green);
}

/* ==========================================================================
   Accessibility — Focus-Visible
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--spotify-green);
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--spotify-green);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--spotify-green-glow);
}

.track-checkbox:focus-visible {
  outline: 2px solid var(--spotify-green);
  outline-offset: 1px;
}

/* ==========================================================================
   Smooth Tab Transitions
   ========================================================================== */

#search-section,
#library-section {
  animation: fadeSlideIn 0.25s ease-out;
}

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

/* Library playlists grid layout */
#library-playlists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

@media (max-width: 768px) {
  #library-playlists-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* ==========================================================================
   Karaoke Synced Lyrics Drawer
   ========================================================================== */

.lyrics-drawer {
  position: fixed;
  bottom: 86px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 105;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  animation: slideUpFade 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

.lyrics-drawer-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

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

.lyrics-header-icon {
  width: 20px;
  height: 20px;
  color: var(--spotify-green);
  flex-shrink: 0;
}

.lyrics-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.lyrics-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

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

.lyrics-lines-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.lyrics-lines-container::-webkit-scrollbar {
  width: 6px;
}

.lyrics-lines-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.lyrics-line {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.lyrics-line:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
}

.lyrics-line.active {
  color: var(--spotify-green-hover);
  font-size: 1.25rem;
  font-weight: 800;
  text-shadow: 0 0 16px var(--spotify-green-glow);
  transform: scale(1.02);
  background: rgba(29, 185, 84, 0.08);
}

.lyrics-line.passed {
  color: rgba(255, 255, 255, 0.2);
}

.lyrics-empty-state,
.lyrics-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.lyrics-empty-state svg,
.lyrics-empty-state i {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

/* ==========================================================================
   Mobile Transfer Modal & QR Display
   ========================================================================== */

.mobile-modal-card {
  max-width: 520px;
  width: 90%;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

.mobile-modal-icon {
  width: 28px;
  height: 28px;
  color: var(--spotify-green);
}

.qr-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  margin-bottom: 18px;
}

.qr-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.qr-tab:hover {
  color: #fff;
}

.qr-tab.active {
  background: var(--bg-surface-elevated);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.qr-display-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.qr-code-wrapper {
  background: #ffffff;
  padding: 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.qr-code-wrapper svg {
  display: block;
  max-width: 100%;
}

.qr-link-info {
  width: 100%;
  text-align: center;
}

.qr-instructions {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.qr-url-row {
  display: flex;
  gap: 8px;
}

.qr-url-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--spotify-green);
  font-size: 0.82rem;
  font-family: monospace;
}

.mobile-transfer-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mobile-feature-item svg,
.mobile-feature-item i {
  width: 16px;
  height: 16px;
  color: var(--spotify-green);
  flex-shrink: 0;
}

.mobile-feature-item b,
.mobile-feature-item code {
  color: #ffffff;
}



/* Google & Spotify Auth Modal Enhancements */
.auth-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.btn-google {
  background: #ffffff !important;
  color: #1f1f1f !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  border-radius: 28px !important;
  padding: 12px 20px !important;
  font-size: 0.92rem !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  cursor: pointer !important;
}

.btn-google:hover {
  background: #f1f3f4 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2) !important;
}

.btn-google:active {
  transform: translateY(1px) !important;
}

.btn-google .google-icon {
  flex-shrink: 0;
}

.btn-spotify {
  background: #1db954 !important;
  color: #000000 !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  border-radius: 28px !important;
  padding: 10px 20px !important;
  font-size: 0.9rem !important;
  transition: transform 0.15s ease, background-color 0.2s ease !important;
  cursor: pointer !important;
}

.btn-spotify:hover {
  background: #1ed760 !important;
  transform: translateY(-1px) !important;
}

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--text-secondary, #b3b3b3);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px;
  transition: color 0.2s ease;
  margin-top: 4px;
}

.btn-text-link:hover {
  color: #ffffff;
}

.auth-waiting-banner {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: #1ed760;
  animation: fadeIn 0.3s ease;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(30, 215, 96, 0.3);
  border-top-color: #1ed760;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* Auth Steps for sp_dc cookie flow */
.auth-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.auth-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary, #b3b3b3);
  line-height: 1.4;
}

.step-num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.2);
  color: #1db954;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.auth-step kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78rem;
  font-family: inherit;
  color: #fff;
}

.auth-step code {
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.78rem;
  color: #1db954;
  font-weight: 600;
}

.auth-status-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.auth-status-msg.error {
  background: rgba(255, 85, 85, 0.12);
  border: 1px solid rgba(255, 85, 85, 0.3);
  color: #ff6b6b;
}

.auth-status-msg.success {
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
  color: #1ed760;
}

.auth-status-msg.loading {
  background: rgba(29, 185, 84, 0.08);
  border: 1px solid rgba(29, 185, 84, 0.2);
  color: #b3b3b3;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-success {
  background: #1db954 !important;
  color: #000 !important;
  font-weight: 700 !important;
  border-radius: var(--radius-md, 8px) !important;
}

.btn-success:hover {
  background: #1ed760 !important;
}

