/* ==========================================================================
   Design System & Premium Aesthetics (Spotify Clone - OpenLoFi)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  /* Theme Colors */
  --bg-primary: #09090b;       /* Deep Onyx */
  --bg-secondary: #121215;     /* Dark Charcoal */
  --bg-tertiary: #1c1c22;      /* Lighter Slate */
  
  --accent: #10b981;           /* Emerald Green */
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-hover: #34d399;
  
  --text-primary: #f4f4f5;     /* Pure white-ish */
  --text-secondary: #a1a1aa;   /* Muted zinc */
  --text-muted: #52525b;       /* Dark zinc */
  
  /* Glassmorphism */
  --glass-bg: rgba(18, 18, 21, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-glow: rgba(255, 255, 255, 0.02);
  
  /* Layout Dimensions */
  --sidebar-width: 260px;
  --player-height: 90px;
  --mobile-nav-height: 65px;
  
  /* System Values */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  height: 100dvh; /* dynamic viewport height fixes the mobile bottom-bar shift */
  width: 100vw;
  user-select: none;
}

button {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

input {
  font-family: inherit;
  outline: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Lock Screen / Passcode Overlay
   ========================================================================== */
#lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #18181b 0%, #09090b 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#lock-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-card {
  width: 340px;
  padding: 40px 30px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: pulse-glow 3s infinite alternate;
}

.lock-logo {
  width: 70px;
  height: 70px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.lock-card h1 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.lock-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.passcode-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 30px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--text-muted);
  transition: var(--transition);
}

.dot.active {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.dot.error {
  background-color: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 12px #ef4444;
  animation: shake 0.3s ease-in-out;
}

/* Keypad Grid */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  max-width: 260px;
  margin: 0 auto;
}

.key {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 22px;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
}

.key:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.key:active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(0.95);
}

.key.backspace {
  font-size: 16px;
}

/* ==========================================================================
   Main Application Layout
   ========================================================================== */
#app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr var(--player-height);
  height: 100vh;
  height: 100dvh; /* dynamic viewport height fixes the mobile bottom-bar shift */
  width: 100vw;
}

/* Sidebar navigation */
aside {
  grid-row: 1;
  grid-column: 1;
  background-color: #040405;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-left: 8px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.brand-name {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  text-decoration: none;
}

.nav-item i {
  font-size: 18px;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding-left: 13px;
}

.sidebar-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
}

.playlist-menu {
  flex: 1;
  overflow-y: auto;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.playlist-menu-header {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 16px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.add-playlist-btn:hover {
  color: var(--accent);
}

.playlist-menu-item {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-align: left;
}

.playlist-menu-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.lock-app-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: #f87171;
  transition: var(--transition);
}

.lock-app-btn:hover {
  background-color: rgba(239, 68, 68, 0.08);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
main {
  grid-row: 1;
  grid-column: 2;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

/* Top bar / Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  position: sticky;
  top: 0;
  background-color: rgba(18, 18, 21, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 90;
}

.search-container {
  position: relative;
  width: 320px;
}

.search-container i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background-color: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--glass-border);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

.profile-name {
  font-size: 14px;
  font-weight: 500;
}

/* Page Views */
.view-content {
  padding: 32px;
  display: none;
  flex-direction: column;
  gap: 32px;
}

.view-content.active {
  display: flex;
  animation: fadeIn 0.4s ease-in-out;
}

/* Home View components */
.hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-info {
  max-width: 500px;
  z-index: 2;
}

.hero-tag {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.hero-btn {
  background-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

.hero-art {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  transform: rotate(6deg);
  transition: var(--transition);
  z-index: 2;
}

.hero-card:hover .hero-art {
  transform: rotate(0deg) scale(1.05);
}

/* Category grid scrollable row */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
}

.scroll-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.category-pill {
  flex-shrink: 0;
  padding: 10px 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.category-pill:hover, .category-pill.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.category-pill.active {
  background-color: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* Song Card Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.song-card {
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.song-card:hover {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
}

.card-art-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
  background-color: var(--bg-tertiary);
}

.card-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.song-card:hover .card-art {
  transform: scale(1.05);
}

.card-play-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--accent);
  color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

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

.card-play-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.1);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-category {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Playlist / Detail View Header */
.detail-header {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.detail-art {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  background-color: var(--bg-tertiary);
}

.detail-info h2 {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1;
}

.detail-meta {
  color: var(--text-secondary);
  font-size: 14px;
}

.tracklist-container {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.track-row {
  display: grid;
  grid-template-columns: 40px 1fr 120px 60px;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

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

.track-row.active {
  color: var(--accent);
}

.track-num {
  color: var(--text-secondary);
  font-size: 14px;
}

.track-row.active .track-num {
  color: var(--accent);
}

.track-title-cell {
  font-size: 14px;
  font-weight: 500;
}

.track-cat-cell {
  font-size: 13px;
  color: var(--text-secondary);
}

.track-action-cell {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.favorite-btn:hover {
  color: #ef4444;
}

.favorite-btn.active {
  color: #ef4444;
}

/* Settings View styling */
.settings-section {
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.settings-info h4 {
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-info p {
  color: var(--text-secondary);
  font-size: 12px;
}

.settings-btn {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

.settings-btn:hover {
  background-color: var(--text-muted);
  color: var(--text-primary);
}

/* Change Passcode Form */
.settings-change-passcode-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px dashed var(--glass-border);
}

.settings-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.settings-form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 576px) {
  .settings-form-row {
    grid-template-columns: 1fr;
  }
}

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

.settings-form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.settings-input {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  text-align: center;
  letter-spacing: 0.2em;
}

.settings-input:focus {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.settings-input::placeholder {
  color: var(--text-muted);
  letter-spacing: normal;
}

.settings-feedback {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
  animation: fadeIn 0.3s ease;
}

.settings-feedback.success {
  display: block;
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.settings-feedback.error {
  display: block;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  animation: shake 0.3s ease-in-out;
}

.settings-save-btn {
  align-self: flex-start;
  background-color: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.settings-save-btn:hover {
  background-color: var(--accent-hover);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* ==========================================================================
   Persistent Playback Bar
   ========================================================================== */
#player-bar {
  grid-row: 2;
  grid-column: 1 / span 2;
  background-color: #040405;
  border-top: 1px solid var(--glass-border);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: center;
  padding: 0 24px;
  z-index: 200;
}

/* Left - track info */
.player-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.player-art-container {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--bg-tertiary);
  position: relative;
}

.player-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-track-details {
  display: flex;
  flex-direction: column;
  max-width: 150px;
}

.player-track-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.player-track-cat {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Center - controls & progress */
.player-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-btn {
  font-size: 15px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.control-btn:hover {
  color: var(--text-primary);
  transform: scale(1.05);
}

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

.control-btn.play-pause {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--text-primary);
  color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
}

.control-btn.play-pause:hover {
  background-color: #ffffff;
  transform: scale(1.08);
}

/* Slider Bar styling */
.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 500px;
}

.time-stamp {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 32px;
}

.slider-wrapper {
  flex: 1;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.slider-bar {
  width: 100%;
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-full);
  position: relative;
}

.slider-fill {
  height: 100%;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  width: 0%;
  position: absolute;
  left: 0;
  top: 0;
  transition: width 0.1s linear;
}

.slider-wrapper:hover .slider-fill {
  background-color: var(--accent);
}

.slider-handle {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background-color: #ffffff;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) translateX(-50%);
  left: 0%;
  opacity: 0;
  transition: opacity 0.1s, left 0.1s linear;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.slider-wrapper:hover .slider-handle {
  opacity: 1;
}

/* Right - volume and misc */
.player-misc-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 120px;
}

/* ==========================================================================
   Mobile Nav Bar
   ========================================================================== */
#mobile-nav-bar {
  display: none;
  grid-row: 3;
  grid-column: 1;
  background-color: #040405;
  border-top: 1px solid var(--glass-border);
  justify-content: space-around;
  align-items: center;
  height: var(--mobile-nav-height);
  z-index: 150;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  padding: 8px 16px;
  text-decoration: none;
}

.mobile-nav-item i {
  font-size: 18px;
}

.mobile-nav-item.active {
  color: var(--accent);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.05); }
  100% { box-shadow: 0 0 35px rgba(16, 185, 129, 0.15); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ==========================================================================
   Responsive Styling (Mobile-first adaptions)
   ========================================================================== */
@media (max-width: 768px) {
  #app-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto var(--mobile-nav-height);
  }
  
  aside {
    display: none; /* Hide desktop sidebar */
  }
  
  main {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 20px;
  }
  
  header {
    padding: 16px 20px;
  }
  
  .search-container {
    width: 200px;
  }
  
  .view-content {
    padding: 20px;
  }
  
  .hero-card {
    padding: 24px;
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .hero-art {
    width: 140px;
    height: 140px;
    transform: rotate(0deg);
  }
  
  .hero-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .bento-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }
  
  .song-card {
    padding: 10px;
  }
  
  .card-play-btn {
    opacity: 1; /* Always visible on mobile touch */
    transform: translateY(0);
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  /* Player bar adaptions for mobile */
  #player-bar {
    grid-row: 2;
    grid-column: 1;
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
    height: 64px;
  }
  
  .player-track-info {
    min-width: 0;
  }
  
  .player-art-container {
    width: 40px;
    height: 40px;
  }
  
  .player-track-details {
    max-width: 160px;
  }
  
  .player-controls-container {
    grid-column: 2;
    align-items: flex-end;
  }
  
  .progress-container {
    display: none; /* Hide progress bar in collapsed bar */
  }
  
  .playback-buttons {
    gap: 12px;
  }
  
  .control-btn.prev, .control-btn.next, .control-btn.shuffle, .control-btn.repeat {
    display: none; /* Hide auxiliary buttons in collapsed bar */
  }
  
  .player-misc-container {
    display: none; /* Hide volume controls */
  }
  
  #mobile-nav-bar {
    display: flex; /* Show bottom nav on mobile */
  }
  
  .track-row {
    grid-template-columns: 30px 1fr 40px;
  }
  
  .track-cat-cell {
    display: none; /* Hide category cell in tracklist on mobile */
  }

  /* Mobile performance + zoom fixes */
  .glass, header, #player-bar, .lock-card, .olf-modal {
    backdrop-filter: none;              /* blur is a major mobile GPU cost */
    -webkit-backdrop-filter: none;
  }
  header { background-color: var(--bg-secondary); }
  .search-input { font-size: 16px; }    /* >=16px stops iOS auto-zoom on focus */
  #mobile-nav-bar { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .lock-card { width: 88vw; max-width: 340px; }
}
