/* ==========================================================================
   iPod Shuffle PWA - CSS Design System & Stylesheet
   ========================================================================== */

/* Variables & Base Color Themes */
:root {
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  
  /* Layout Dimensions */
  --ipod-width: 280px;
  --ipod-height: 280px;
  --clickwheel-size: 190px;
  
  /* Transition Speeds */
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.1s ease;

  /* Ambient Blur Backdrops */
  --glass-bg: rgba(25, 25, 25, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
  
  /* Theme-specific Colors (Default Silver) */
  --ipod-primary: #e0e0e0;
  --ipod-secondary: #c8c8c8;
  --ipod-border: #b0b0b0;
  --ipod-highlight: #ffffff;
  --ipod-shadow: rgba(0, 0, 0, 0.2);
  --ipod-glow: rgba(255, 255, 255, 0.15);
  --wheel-bg: #f5f5f7;
  --wheel-border: #d2d2d7;
  --wheel-symbols: #86868b;
  --wheel-center: #e0e0e0;
  --accent-color: #0071e3;
  --accent-glow: rgba(0, 113, 227, 0.4);
}

/* --- Color Theme Classes --- */
body.theme-silver {
  --ipod-primary: #e3e3e3;
  --ipod-secondary: #c5c5c5;
  --ipod-border: #a8a8a8;
  --ipod-highlight: #ffffff;
  --ipod-shadow: rgba(0, 0, 0, 0.2);
  --ipod-glow: rgba(255, 255, 255, 0.3);
  --wheel-bg: #f5f5f7;
  --wheel-border: #dbdbdb;
  --wheel-symbols: #86868b;
  --wheel-center: #e3e3e3;
  --accent-color: #8e8e93;
  --accent-glow: rgba(255, 255, 255, 0.2);
}

body.theme-spacegray {
  --ipod-primary: #3a3a3c;
  --ipod-secondary: #242426;
  --ipod-border: #1c1c1e;
  --ipod-highlight: #555558;
  --ipod-shadow: rgba(0, 0, 0, 0.4);
  --ipod-glow: rgba(255, 255, 255, 0.05);
  --wheel-bg: #1c1c1e;
  --wheel-border: #2c2c2e;
  --wheel-symbols: #aeaeb2;
  --wheel-center: #3a3a3c;
  --accent-color: #5856d6;
  --accent-glow: rgba(88, 86, 214, 0.4);
}

body.theme-blue {
  --ipod-primary: #008cc1;
  --ipod-secondary: #005a87;
  --ipod-border: #00456a;
  --ipod-highlight: #2fc4ff;
  --ipod-shadow: rgba(0, 0, 0, 0.3);
  --ipod-glow: rgba(47, 196, 255, 0.2);
  --wheel-bg: #f5f5f7;
  --wheel-border: #cbe3f0;
  --wheel-symbols: #005a87;
  --wheel-center: #008cc1;
  --accent-color: #2fc4ff;
  --accent-glow: rgba(47, 196, 255, 0.4);
}

body.theme-green {
  --ipod-primary: #7ac143;
  --ipod-secondary: #508d27;
  --ipod-border: #3b6d19;
  --ipod-highlight: #abf177;
  --ipod-shadow: rgba(0, 0, 0, 0.3);
  --ipod-glow: rgba(171, 241, 119, 0.2);
  --wheel-bg: #f5f5f7;
  --wheel-border: #e2efd7;
  --wheel-symbols: #508d27;
  --wheel-center: #7ac143;
  --accent-color: #abf177;
  --accent-glow: rgba(171, 241, 119, 0.4);
}

body.theme-pink {
  --ipod-primary: #f26d7d;
  --ipod-secondary: #bf3f56;
  --ipod-border: #99283d;
  --ipod-highlight: #ffa0b2;
  --ipod-shadow: rgba(0, 0, 0, 0.3);
  --ipod-glow: rgba(255, 160, 178, 0.2);
  --wheel-bg: #f5f5f7;
  --wheel-border: #fce4e7;
  --wheel-symbols: #bf3f56;
  --wheel-center: #f26d7d;
  --accent-color: #ffa0b2;
  --accent-glow: rgba(255, 160, 178, 0.4);
}

body.theme-gold {
  --ipod-primary: #e5c185;
  --ipod-secondary: #bf9854;
  --ipod-border: #9a7536;
  --ipod-highlight: #ffebd0;
  --ipod-shadow: rgba(0, 0, 0, 0.25);
  --ipod-glow: rgba(255, 235, 208, 0.2);
  --wheel-bg: #f5f5f7;
  --wheel-border: #f4edd9;
  --wheel-symbols: #bf9854;
  --wheel-center: #e5c185;
  --accent-color: #ffd60a;
  --accent-glow: rgba(255, 214, 10, 0.4);
}

/* Global resets & background setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-main);
  background-color: #0f0f11;
  color: #f5f5f7;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Dynamic Ambient Glow behind the player */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, rgba(15, 15, 17, 0) 70%);
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
  transition: background 1s ease;
}

/* App container */
.app-container {
  position: relative;
  display: block; /* Changed from flex to block to isolate absolutely positioned drawer */
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden; /* Prevents off-screen absolute drawer from shifting center */
}

/* Main Player Workspace */
.player-workspace {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 2;
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   iPod Shuffle Skeuomorphic Styling
   ========================================================================== */

/* Top accessories bar */
.ipod-accessories {
  display: flex;
  justify-content: flex-end; /* Align switch container to the right */
  align-items: center;
  width: var(--ipod-width);
  padding: 0 10px;
  margin-bottom: 10px; /* 10px padding between switch and iPod body */
  z-index: 3;
}

/* Physical Three-way Switch (Off - Play in Order - Shuffle) */
.physical-switch-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* Center-align switch and labels container */
}

.switch-labels {
  width: 84px; /* Wider switch width for label padding */
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #8e8e93;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  text-align: center;
}

.switch-labels span {
  flex: 1;
  white-space: nowrap;
}

.three-way-switch {
  width: 84px; /* Wider switch track */
  height: 14px;
  background: #2c2c2e;
  border-radius: 7px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8), 0 1px 1px rgba(255,255,255,0.1);
  cursor: pointer;
  border: 1px solid #444;
}

.switch-handle {
  width: 22px;
  height: 12px;
  background: linear-gradient(to bottom, #f5f5f7, #aeaeb2);
  border-radius: 5px;
  position: absolute;
  top: 0px;
  left: 0px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 0.5px solid #888;
}

/* Ridges on switch handle for grip */
.switch-handle:after {
  content: '';
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  background: repeating-linear-gradient(
    to right,
    #888,
    #888 1px,
    transparent 1px,
    transparent 3px
  );
}

/* Switch positions mapping */
.three-way-switch[data-position="1"] .switch-handle {
  transform: translateX(0px);
}

.three-way-switch[data-position="2"] .switch-handle {
  transform: translateX(31px); /* Midpoint: (84 - 22) / 2 = 31px */
}

.three-way-switch[data-position="3"] .switch-handle {
  transform: translateX(62px); /* Rightmost: 84 - 22 = 62px */
}

/* The iPod Shuffle Aluminum Body */
.ipod-shuffle-device {
  width: var(--ipod-width);
  height: var(--ipod-height);
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
  /* Advanced Metallic Brushed Finish + Beveling */
  background: linear-gradient(
    135deg,
    var(--ipod-highlight) 0%,
    var(--ipod-primary) 30%,
    var(--ipod-secondary) 70%,
    var(--ipod-border) 100%
  );
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.3),
    inset 0 2px 2px var(--ipod-highlight),
    inset 0 -2px 3px var(--ipod-border);
  
  border: 1px solid var(--ipod-border);
  transition: var(--transition-smooth);
}

/* Metal Sheen / Gloss Overlay */
.metal-sheen {
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.15) 45%,
    rgba(255, 255, 255, 0) 50%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(-30deg);
  pointer-events: none;
}

/* Status LED */
.status-led-indicator {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333; /* default off */
  border: 1px solid rgba(0,0,0,0.5);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
}

.led-glow {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

/* LED Play state (Flashes green) */
.led-playing .led-glow {
  opacity: 1;
  background-color: #00ff66;
  box-shadow: 0 0 12px #00ff66, 0 0 4px #00ff66;
  animation: led-blink-green 2.5s infinite ease-in-out;
}

/* LED Pause state (Pulses amber) */
.led-paused .led-glow {
  opacity: 1;
  background-color: #ff9f00;
  box-shadow: 0 0 12px #ff9f00, 0 0 4px #ff9f00;
  animation: led-pulse-amber 1.8s infinite ease-in-out;
}

/* LED Error / Sync state (Solid red/orange) */
.led-syncing .led-glow {
  opacity: 1;
  background-color: #00bcd4;
  box-shadow: 0 0 12px #00bcd4, 0 0 4px #00bcd4;
  animation: led-pulse-blue 0.8s infinite ease-in-out;
}

.led-error .led-glow {
  opacity: 1;
  background-color: #ff3b30;
  box-shadow: 0 0 12px #ff3b30, 0 0 4px #ff3b30;
}

/* Keyframes for LED States */
@keyframes led-blink-green {
  0%, 100% { opacity: 0.3; }
  85%, 90% { opacity: 1; }
}

@keyframes led-pulse-amber {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

@keyframes led-pulse-blue {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* --- Click Wheel --- */
.click-wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: var(--clickwheel-size);
  height: var(--clickwheel-size);
  z-index: 2;
}

.click-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--wheel-bg);
  border: 1px solid var(--wheel-border);
  box-shadow: 
    inset 0 4px 6px rgba(0, 0, 0, 0.12),
    inset 0 -2px 3px rgba(255, 255, 255, 0.8),
    0 10px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
}

/* Wheel Button base styles */
.wheel-btn {
  position: absolute;
  background: none;
  border: none;
  outline: none;
  color: var(--wheel-symbols);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color 0.15s ease, transform 0.1s ease;
  z-index: 3;
}

/* Active pressed states for buttons */
.wheel-btn:active {
  color: #000;
  transform: scale(0.92);
}

body.theme-spacegray .wheel-btn:active {
  color: #fff;
}

/* Volume Up */
.vol-up {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 40px;
}

.vol-up:active {
  transform: translateX(-50%) scale(0.92);
}

/* Volume Down */
.vol-down {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 40px;
}

.vol-down:active {
  transform: translateX(-50%) scale(0.92);
}

/* Previous Track */
.prev-song {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 50px;
}

.prev-song:active {
  transform: translateY(-50%) scale(0.92);
}

/* Next Track */
.next-song {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 50px;
}

.next-song:active {
  transform: translateY(-50%) scale(0.92);
}

/* Center Play/Pause Button */
.center-button {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--ipod-highlight) 0%,
    var(--ipod-primary) 40%,
    var(--ipod-secondary) 100-30%,
    var(--ipod-border) 100%
  );
  border: 1px solid var(--wheel-border);
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 -1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  outline: none;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.center-button:active {
  transform: scale(0.94);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.play-pause-icon {
  color: var(--wheel-symbols);
  display: flex;
  justify-content: center;
  align-items: center;
}

.center-button:active .play-pause-icon {
  color: #000;
}

body.theme-spacegray .center-button:active .play-pause-icon {
  color: #fff;
}

.hidden {
  display: none !important;
}

/* Apple-style Branding Text */
.brand-text {
  position: absolute;
  bottom: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
}

body.theme-spacegray .brand-text {
  color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Visualizer and Toast Status
   ========================================================================== */
.info-visualizer-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
}

.audio-visualizer {
  width: 100%;
  height: 60px;
  background: transparent;
  border-radius: 12px;
  opacity: 0.8;
  pointer-events: none;
}

.toast-status {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 400;
  color: #aeaeb2;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  min-width: 160px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ==========================================================================
   Control Panel Dashboard Drawer
   ========================================================================== */

.dashboard-drawer {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transform: translateX(420px);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through closed drawer to elements underneath */
}

.dashboard-drawer.open {
  transform: translateX(0);
  pointer-events: auto; /* Enable clicks inside drawer when open */
}

/* Drawer Handle to reveal it */
.drawer-handle {
  position: absolute;
  left: -48px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 80px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-right: none;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
  cursor: pointer;
  display: flex;
  pointer-events: auto; /* Handle must always be clickable */
  justify-content: center;
  align-items: center;
  box-shadow: -10px 0 20px rgba(0,0,0,0.3);
}

.handle-bar {
  width: 4px;
  height: 30px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.dashboard-drawer.open .handle-bar {
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
}

/* Drawer Content Inner */
.drawer-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 2rem;
  gap: 1.5rem;
}

/* Drawer Header */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 1rem;
}

.drawer-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.network-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.network-badge.online {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  border: 1.5px solid rgba(48, 209, 88, 0.3);
}

.network-badge.offline {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1.5px solid rgba(255, 69, 58, 0.3);
}

/* Sections */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.control-section h3 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: #8e8e93;
  letter-spacing: 1px;
}

/* Color Pickers */
.color-picker-grid {
  display: flex;
  gap: 0.6rem;
}

.color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: #fff;
  transform: scale(1.1);
}

.color-btn.silver { background: #e3e3e3; }
.color-btn.spacegray { background: #3a3a3c; }
.color-btn.blue { background: #008cc1; }
.color-btn.green { background: #7ac143; }
.color-btn.pink { background: #f26d7d; }
.color-btn.gold { background: #e5c185; }

/* Cache Status Panel */
.cache-status-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cache-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

#cacheRatio {
  color: #fff;
}

#cacheBytes {
  color: #8e8e93;
}

/* Progress Bar */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
  width: 0%;
  transition: width 0.3s ease;
}

.sync-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 4px;
}

.control-btn {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sync-btn {
  background: var(--accent-color);
  color: #fff;
}

.sync-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.sync-btn:disabled {
  background: #2c2c2e;
  color: #8e8e93;
  cursor: not-allowed;
}

.clear-btn {
  background: rgba(255, 69, 58, 0.1);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.2);
}

.clear-btn:hover {
  background: rgba(255, 69, 58, 0.2);
}

.sync-note {
  font-size: 11px;
  color: #8e8e93;
  line-height: 1.4;
}

/* Playlist / Song Catalog */
.playlist-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-box input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 12px;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-main);
  outline: none;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--accent-color);
  background: rgba(255,255,255,0.08);
}

.song-list-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(0,0,0,0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.loading-songs, .no-songs {
  padding: 2rem;
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
}

/* Song Rows */
.song-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background 0.15s ease;
  gap: 12px;
}

.song-row:hover {
  background: rgba(255,255,255,0.03);
}

.song-row.active {
  background: rgba(255,255,255,0.06);
}

.song-status-icon {
  display: flex;
  align-items: center;
  color: #8e8e93;
}

.song-row.active .song-status-icon {
  color: var(--accent-color);
}

.song-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* truncate text safety */
}

.song-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #f5f5f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 11px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-duration {
  font-size: 11px;
  color: #8e8e93;
  font-family: var(--font-mono);
}

.song-offline-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #30d158;
}

.song-row.not-downloaded .song-offline-badge {
  color: rgba(255,255,255,0.15);
}

/* PWA Install Banner */
.install-banner {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.15) 0%, rgba(88, 86, 214, 0.15) 100%);
  border: 1.5px solid rgba(0, 113, 227, 0.3);
  padding: 1.2rem;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.install-banner h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.install-banner p {
  font-size: 11px;
  color: #aeaeb2;
  line-height: 1.3;
}

.install-btn {
  background: #fff;
  color: #000;
  flex: none;
  font-weight: 800;
  padding: 8px 16px;
}

.install-btn:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   Mobile / Responsive Layout Adapters
   ========================================================================== */

@media (max-width: 768px) {
  body {
    flex-direction: column;
    justify-content: flex-start;
  }
  
  .player-workspace {
    width: 100%;
    height: 60vh;
    flex: none;
    padding-top: 3rem;
  }

  .dashboard-drawer {
    width: 100%;
    height: 48vh;
    top: auto;
    bottom: calc(-48vh + 48px); /* Positioned physically below the viewport except for handle */
    right: 0;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    transform: translateY(0);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    pointer-events: none; /* Let clicks pass through closed drawer on mobile */
  }

  .dashboard-drawer.open {
    transform: translateY(calc(-48vh + 48px)); /* Slide up on-screen */
    pointer-events: auto; /* Enable drawer interaction when open on mobile */
  }

  .drawer-handle {
    left: 50%;
    top: -24px;
    transform: translateX(-50%);
    width: 80px;
    height: 24px;
    border-bottom: none;
    border-left: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.15);
  }

  .handle-bar {
    width: 30px;
    height: 4px;
  }

  .drawer-content {
    padding: 1.5rem;
    padding-top: 1rem;
  }
}
