/* ═══════════════════════════════════════════
   Bekar — Premium Immersive Design System
   Glassmorphism · Neon Glow · Micro-Animations
   ═══════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  --bg-primary: #050510;
  --bg-secondary: #0a0a1a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --bg-elevated: rgba(15, 15, 30, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #f0f0f5;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-muted: rgba(255, 255, 255, 0.28);

  --accent: #a78bfa;
  --accent-secondary: #22d3ee;
  --accent-tertiary: #f472b6;
  --accent-dim: rgba(167, 139, 250, 0.12);
  --accent-glow: rgba(167, 139, 250, 0.06);
  --accent-bright: #c4b5fd;

  --gradient-primary: linear-gradient(135deg, #a78bfa, #22d3ee);
  --gradient-warm: linear-gradient(135deg, #f472b6, #a78bfa);
  --gradient-cool: linear-gradient(135deg, #22d3ee, #a78bfa);
  --gradient-bg: linear-gradient(145deg, #050510 0%, #0d0d25 30%, #0a0a1a 60%, #0f0520 100%);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(167, 139, 250, 0.2);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(167, 139, 250, 0.15);
  --shadow-glow-accent: 0 4px 30px rgba(167, 139, 250, 0.2);

  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'DM Sans', sans-serif;

  --nav-height: 64px;

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --speed-fast: 0.15s;
  --speed-normal: 0.3s;
  --speed-slow: 0.5s;
}

/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Buttons — bold display font everywhere */
button {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* Consistent press feedback on every button (all pointer types) */
button:active {
  transform: scale(0.94);
  transition-duration: var(--speed-fast);
}

a,
input,
.track-card,
.similar-card,
.library-track-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  font-family: var(--font-body);
  background: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Ambient animated background */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 600px 600px at 20% 20%, rgba(167, 139, 250, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 80%, rgba(34, 211, 238, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 60% 30%, rgba(244, 114, 182, 0.05) 0%, transparent 70%);
  animation: ambientDrift 25s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes ambientDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(30px, -20px) rotate(1deg); }
  66% { transform: translate(-20px, 15px) rotate(-1deg); }
  100% { transform: translate(10px, -10px) rotate(0.5deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.2);
  border-radius: 4px;
}

@media (hover: hover) and (pointer: fine) {
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(167, 139, 250, 0.35);
  }
}

::selection {
  background: rgba(167, 139, 250, 0.3);
  color: #fff;
}

/* ── Particle Canvas ── */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* ── App Container ── */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px calc(var(--nav-height) + 160px);
}

/* ══════════════════════════════════════════
   HEADER — Glassmorphism
   ══════════════════════════════════════════ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(5, 5, 16, 0.9) 40%, rgba(5, 5, 16, 0.6) 70%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.35));
  transition: all var(--speed-normal) var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) {
  .brand:hover .brand-icon {
    filter: drop-shadow(0 0 16px rgba(167, 139, 250, 0.55));
    transform: scale(1.12) rotate(-6deg);
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   BOTTOM NAV — Floating Glass Dock
   ══════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 250;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  background: rgba(8, 8, 20, 0.82);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border-top: 1px solid rgba(167, 139, 250, 0.1);
}

.bottom-nav::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.35;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 120px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
  position: relative;
}

.nav-btn svg {
  transition: all var(--speed-normal) var(--ease-spring);
}

.nav-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 40px;
  height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: var(--gradient-primary);
  box-shadow: 0 2px 14px rgba(167, 139, 250, 0.6);
  transition: transform var(--speed-normal) var(--ease-spring);
}

@media (hover: hover) and (pointer: fine) {
  .nav-btn:hover {
    color: var(--text-secondary);
  }
}

@media (hover: hover) and (pointer: fine) {
  .nav-btn:hover svg {
    transform: translateY(-2px);
  }
}

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

.nav-btn.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-btn.active svg {
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.5));
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════
   VIEWS — Transitions
   ══════════════════════════════════════════ */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 0.4s var(--ease-smooth);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ══════════════════════════════════════════
   HERO — Immersive Landing
   ══════════════════════════════════════════ */
.hero-search {
  text-align: center;
  padding: 70px 0 40px;
  position: relative;
}

/* Floating orb behind hero */
.hero-search::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  animation: heroOrb 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes heroOrb {
  0% { transform: translate(-50%, -60%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -65%) scale(1.1); opacity: 0.8; }
  100% { transform: translate(-50%, -55%) scale(0.95); opacity: 0.5; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -2.5px;
  line-height: 1.05;
  margin-bottom: 14px;
  position: relative;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent-tertiary));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s ease infinite;
  position: relative;
}

.gradient-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent-tertiary));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s ease infinite;
  filter: blur(35px);
  opacity: 0.4;
  z-index: -1;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* Search — Glowing */
.search-wrapper {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--speed-normal) var(--ease);
}

.search-wrapper:focus-within .search-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.4));
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 50px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--speed-normal) var(--ease);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.search-input:focus {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(15, 15, 30, 0.6);
  box-shadow:
    0 0 0 4px rgba(167, 139, 250, 0.08),
    0 0 40px rgba(167, 139, 250, 0.1),
    inset 0 0 20px rgba(167, 139, 250, 0.02);
}

.search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: all var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .search-clear:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
  }
}

/* Tags — Animated Pills */
.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.tag {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
  letter-spacing: 0.4px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.tag::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--speed-normal) var(--ease);
  border-radius: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .tag:hover {
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.2);
  }
}

@media (hover: hover) and (pointer: fine) {
  .tag:hover::before {
    opacity: 0.15;
  }
}

.tag:active {
  transform: translateY(0) scale(0.97);
}

/* ══════════════════════════════════════════
   SECTION HEADERS
   ══════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.results-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg-glass);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   RESULTS GRID
   ══════════════════════════════════════════ */
.results-section {
  margin-top: 20px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 8px;
}

/* ══════════════════════════════════════════
   TRACK CARD — Glassmorphism
   ══════════════════════════════════════════ */
.track-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
  position: relative;
}

.track-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  opacity: 0;
  transition: opacity var(--speed-normal) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .track-card:hover {
    border-color: var(--border-hover);
    transform: translateX(4px);
  }
}

@media (hover: hover) and (pointer: fine) {
  .track-card:hover::before {
    opacity: 1;
  }
}

.track-card.playing {
  background: var(--accent-dim);
  border-color: rgba(167, 139, 250, 0.2);
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.08);
}

.track-card.playing .card-title {
  color: var(--accent-bright);
}

/* Card Art */
.card-art-wrap {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  z-index: 1;
}

.card-album-art {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  transition: all var(--speed-normal) var(--ease);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .track-card:hover .card-album-art {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }
}

.track-card.playing .card-album-art {
  border-radius: 50%;
  animation: spin-album 10s linear infinite;
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

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

/* Equalizer */
.card-equalizer {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--speed-normal) var(--ease);
}

.track-card.playing .card-equalizer {
  opacity: 1;
}

.eq-bar {
  width: 2.5px;
  background: var(--accent);
  border-radius: 1.5px;
  animation: eq-bounce 0.8s ease-in-out infinite;
  box-shadow: 0 0 4px var(--accent);
}

.eq-bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq-bar:nth-child(2) { height: 70%; animation-delay: 0.15s; }
.eq-bar:nth-child(3) { height: 50%; animation-delay: 0.3s; }
.eq-bar:nth-child(4) { height: 80%; animation-delay: 0.45s; }

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* Card Info */
.card-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.card-title {
  font-size: 0.87rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
  transition: color var(--speed-normal) var(--ease);
}

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

.card-duration {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.card-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .card-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: scale(1.1);
  }
}

.card-btn.saved {
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .card-btn.saved:hover {
    color: var(--accent-bright);
    background: var(--accent-dim);
  }
}

/* ══════════════════════════════════════════
   SIMILAR SECTION — Horizontal Scroll
   ══════════════════════════════════════════ */
.similar-section {
  margin-top: 36px;
}

.similar-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.similar-carousel::-webkit-scrollbar {
  display: none;
}

.similar-card {
  flex: 0 0 170px;
  scroll-snap-align: start;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
  backdrop-filter: blur(10px);
  position: relative;
}

.similar-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--speed-normal) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .similar-card:hover {
    border-color: transparent;
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-glow-accent);
  }
}

@media (hover: hover) and (pointer: fine) {
  .similar-card:hover::before {
    opacity: 0.3;
  }
}

.similar-card.playing {
  border-color: rgba(167, 139, 250, 0.3);
  background: var(--accent-dim);
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.15);
}

.similar-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.similar-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  transition: transform var(--speed-slow) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .similar-card:hover .similar-card-img {
    transform: scale(1.08);
  }
}

.similar-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--speed-normal) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .similar-card:hover .similar-card-overlay {
    opacity: 1;
  }
}

/* Touch devices: overlay actions always visible & no sticky hover shifts */
@media (hover: none) {
  .similar-card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent 60%);
    align-items: flex-end;
    justify-content: flex-end;
    padding: 8px;
  }

  .similar-play-btn,
  .similar-save-btn {
    width: 34px;
    height: 34px;
  }

  .track-card:active,
  .library-track-card:active {
    background: var(--bg-glass-hover);
    transition-duration: var(--speed-fast);
  }

  .similar-card:active {
    transform: scale(0.97);
    transition-duration: var(--speed-fast);
  }

  .tag:active {
    border-color: var(--accent);
    color: #fff;
  }
}

.similar-play-btn,
.similar-save-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease-spring);
  backdrop-filter: blur(10px);
}

.similar-play-btn {
  background: var(--accent);
  color: #000;
  box-shadow: 0 2px 16px rgba(167, 139, 250, 0.4);
}

.similar-save-btn {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (hover: hover) and (pointer: fine) {
  .similar-play-btn:hover,
  .similar-save-btn:hover {
    transform: scale(1.15);
  }
}

.similar-save-btn.saved {
  color: var(--accent);
  border-color: rgba(167, 139, 250, 0.3);
}

.similar-card-meta {
  padding: 12px;
}

.similar-card-title {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.similar-card-artist {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Download All */
.download-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .download-all-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.1);
  }
}

/* ══════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-visual {
  margin-bottom: 20px;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 0 24px rgba(167, 139, 250, 0.25));
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  letter-spacing: 0.2px;
}

/* ══════════════════════════════════════════
   LIBRARY
   ══════════════════════════════════════════ */
.library-header-section {
  padding: 56px 0 28px;
  text-align: center;
}

.library-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.library-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 8px;
}

.library-track-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--speed-normal) var(--ease);
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .library-track-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border);
    transform: translateX(4px);
  }
}

.library-track-card.playing {
  background: var(--accent-dim);
  border-color: rgba(167, 139, 250, 0.15);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.08);
}

.lib-card-art {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.lib-card-info {
  flex: 1;
  min-width: 0;
}

.lib-card-title {
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.lib-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
  padding: 2px 8px;
  background: var(--accent-glow);
  border-radius: var(--radius-full);
  border: 1px solid rgba(167, 139, 250, 0.1);
}

.lib-delete-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .lib-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
  }
}

.library-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.library-empty svg {
  margin-bottom: 16px;
  filter: drop-shadow(0 0 16px rgba(167, 139, 250, 0.15));
  animation: float 4s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   ABOUT — Profile Card
   ══════════════════════════════════════════ */
.about-section {
  display: flex;
  justify-content: center;
  padding: 64px 0 40px;
}

.about-card {
  position: relative;
  max-width: 480px;
  width: 100%;
  text-align: center;
  padding: 44px 32px 36px;
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.5;
}

.about-avatar {
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 24px rgba(167, 139, 250, 0.3));
  animation: float 4s ease-in-out infinite;
}

.about-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-role {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 18px;
}

.about-bio {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 26px;
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.about-badge {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--accent-glow);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

/* ══════════════════════════════════════════
   PLAYER BAR — Immersive Glass
   ══════════════════════════════════════════ */
.player-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(10, 10, 26, 0.75);
  border-top: 1px solid rgba(167, 139, 250, 0.1);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  transition: transform 0.4s var(--ease-spring);
}

.player-bar::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.4;
}

.player-bar.hidden {
  transform: translateY(calc(100% + var(--nav-height)));
}

.player-bar.visible {
  transform: translateY(0);
}

/* Progress */
.player-progress-wrap {
  padding: 0 16px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.player-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  transition: height var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .player-progress-wrap:hover .player-progress-bar {
    height: 5px;
  }
}

.player-progress {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: 3px;
  transition: width 0.1s linear;
  position: relative;
}

.player-progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--speed-fast) var(--ease);
  box-shadow: 0 0 10px var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .player-progress-wrap:hover .player-progress::after {
    opacity: 1;
  }
}

/* Player Content */
.player-content {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

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

.player-album-art-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
  position: relative;
}

.player-album-art-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

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

.player-meta {
  min-width: 0;
}

.player-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .ctrl-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
    transform: scale(1.05);
  }
}

.ctrl-btn.play-btn {
  width: 44px;
  height: 44px;
  background: var(--gradient-primary);
  color: #000;
  box-shadow: 0 2px 20px rgba(167, 139, 250, 0.3);
}

@media (hover: hover) and (pointer: fine) {
  .ctrl-btn.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 28px rgba(167, 139, 250, 0.45);
  }
}

.ctrl-btn.play-btn:active {
  transform: scale(0.95);
}

/* Extras */
.player-extras {
  display: flex;
  align-items: center;
  gap: 14px;
}

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: all var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .volume-slider:hover {
    height: 4px;
  }
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
  transition: all var(--speed-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 14px rgba(167, 139, 250, 0.6);
  }
}

.player-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: right;
}

/* Visualizer */
.visualizer-canvas {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.12;
  z-index: 1;
}

/* ══════════════════════════════════════════
   SKELETON — Shimmer
   ══════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    rgba(167, 139, 250, 0.05) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-load 1.5s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-card {
  height: 72px;
}

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

/* ══════════════════════════════════════════
   TOASTS — Glassmorphism
   ══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height) + 96px);
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(15, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s var(--ease-spring);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.25);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(52, 211, 153, 0.1);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(239, 68, 68, 0.1);
}

.toast-icon {
  font-size: 1rem;
}

.toast.removing {
  animation: toast-out 0.25s var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
  }
}

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

/* ══════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════ */
.hidden {
  display: none !important;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 640px) {
  .app-container {
    padding: 0 16px 200px;
  }

  .hero-title {
    font-size: 2.2rem;
    letter-spacing: -1.5px;
  }

  .hero-search {
    padding: 50px 0 30px;
  }

  .nav-btn {
    min-width: 0;
    flex: 1;
    max-width: 140px;
    padding: 0 6px;
  }

  .nav-btn span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .about-card {
    padding: 36px 20px 30px;
  }

  .player-extras .volume-wrap {
    display: none;
  }

  .results-grid,
  .library-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Result cards: uniform touch targets & spacing */
  .track-card,
  .library-track-card {
    gap: 10px;
    padding: 10px 12px;
  }

  .card-actions {
    gap: 2px;
  }

  .card-btn,
  .lib-delete-btn {
    width: 40px;
    height: 40px;
  }

  .skeleton-card {
    height: 74px;
  }

  .similar-card {
    flex: 0 0 145px;
  }

  .search-input {
    padding: 14px 44px 14px 46px;
    font-size: 0.88rem;
  }

  .player-content {
    gap: 12px;
    padding: 8px 16px;
  }

  .ctrl-btn.play-btn {
    width: 40px;
    height: 40px;
  }

  .toast-container {
    bottom: calc(var(--nav-height) + 86px);
    right: 12px;
    left: 12px;
  }

  .toast {
    font-size: 0.78rem;
  }
}

@media (max-width: 380px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .card-btn,
  .lib-delete-btn {
    width: 36px;
    height: 36px;
  }

  .card-art-wrap,
  .card-album-art {
    width: 46px;
    height: 46px;
  }

  .lib-card-art {
    width: 46px;
    height: 46px;
  }

  .track-card,
  .library-track-card {
    gap: 8px;
    padding: 10px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .search-tags {
    gap: 6px;
  }

  .tag {
    padding: 6px 12px;
    font-size: 0.68rem;
  }
}

/* ══════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  body::before {
    animation: none !important;
  }
}

/* ══════════════════════════════════════════
   FOOTER — Refined
   ══════════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: 48px 0 calc(var(--nav-height) + 24px);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  letter-spacing: 0.3px;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.3;
}

.site-footer p {
  opacity: 0.7;
  transition: opacity var(--speed-normal) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .site-footer p:hover {
    opacity: 1;
  }
}