/* ==========================================================================
   VibeSound Dark Theme & Fluid Animation Styles
   ========================================================================== */

:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --tg-viewport-height: 100vh;

  --bg-primary: #080b12;
  --bg-secondary: #0f1422;
  --bg-card: rgba(18, 24, 40, 0.85);
  --bg-card-hover: rgba(28, 36, 58, 0.95);
  --bg-glass: rgba(15, 20, 35, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #7928ca;
  --accent-pink: #ff0080;
  --accent-gold: #fbbf24;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --player-height: 84px;
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Telegram WebApp Custom Theme Overrides */
body.is-tg-webapp {
  --bg-primary: var(--tg-theme-bg-color, #080b12);
  --bg-secondary: var(--tg-theme-secondary-bg-color, #0f1422);
  min-height: var(--tg-viewport-height, 100vh);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow orbs in background */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f46e5 0%, rgba(79, 70, 229, 0) 70%);
  top: -150px;
  left: 15%;
}

.glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #06b6d4 0%, rgba(6, 182, 212, 0) 70%);
  bottom: 10%;
  right: 10%;
}

.glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ec4899 0%, rgba(236, 72, 153, 0) 70%);
  top: 40%;
  left: 60%;
  opacity: 0.2;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--player-height) + 30px);
  transition: var(--transition-smooth);
}

/* ==========================================================================
   Top Header Navigation
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(8, 11, 18, 0.75);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.brand-icon .bar {
  width: 4px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px;
}
.brand-icon .b1 { height: 14px; animation: bounce 1.2s infinite ease-in-out; }
.brand-icon .b2 { height: 22px; animation: bounce 1.2s infinite ease-in-out 0.2s; }
.brand-icon .b3 { height: 18px; animation: bounce 1.2s infinite ease-in-out 0.4s; }
.brand-icon .b4 { height: 12px; animation: bounce 1.2s infinite ease-in-out 0.1s; }

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

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.brand-name span {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.9), rgba(6, 182, 212, 0.9));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.35);
}

.badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

/* ==========================================================================
   Search Hero Section & Centered-to-Top Animation
   ========================================================================== */
.search-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

/* Initial Centered State */
.search-section.centered {
  min-height: 65vh;
  padding: 40px 20px;
}

.hero-content {
  text-align: center;
  max-width: 680px;
  margin-bottom: 32px;
  transition: opacity 0.4s ease, transform 0.5s ease, max-height 0.6s ease, margin 0.5s ease;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Search Bar Box */
.search-bar-wrapper {
  width: 100%;
  max-width: 740px;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: var(--transition-smooth);
}

.search-bar-box {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: rgba(22, 29, 48, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 35px rgba(99, 102, 241, 0.15);
  transition: all 0.3s ease;
  overflow: hidden;
}

.search-bar-box:focus-within {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 45px rgba(0, 242, 254, 0.25);
  transform: translateY(-2px);
}

.search-icon-box {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 10px;
}

.search-input {
  flex: 1 1 0%;
  min-width: 0;
  width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 8px 0;
}

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

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: color 0.2s;
}

.clear-btn:hover {
  color: var(--text-primary);
}

.search-btn {
  background: linear-gradient(135deg, #06b6d4, #4f46e5);
  border: none;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.4);
  transition: all 0.25s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.6);
}

.search-btn:active {
  transform: scale(0.98);
}

/* Quick Tags */
.quick-tags {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  transition: opacity 0.35s ease;
}

.tag-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.tag-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   DOCKED STATE (Smoothly positioned at top of content, scrolls away naturally)
   ========================================================================== */
.search-section.docked-top {
  min-height: auto;
  padding: 14px 20px;
  position: relative;
  top: auto;
  z-index: 10;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.search-section.docked-top .hero-content {
  display: none !important;
}

.search-section.docked-top .search-bar-box {
  padding: 6px 8px 6px 16px;
  background: rgba(20, 26, 44, 0.95);
}

.search-section.docked-top .search-input {
  font-size: 1rem;
  padding: 6px 0;
  min-width: 0;
  width: 0;
  flex: 1 1 0%;
}

.search-section.docked-top .search-btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-section.docked-top .quick-tags {
  display: none;
}

/* ==========================================================================
   Main Content Area & Results
   ========================================================================== */
.content-section {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  animation: fadeIn 0.4s ease forwards;
}

.meta-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-right {
  display: flex;
  align-items: center;
}

.count-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.query-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* Animated Results Container */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* ==========================================================================
   PLAYLISTS & COLLECTIONS SECTION
   ========================================================================== */
.playlists-section {
  margin-bottom: 36px;
  animation: fadeIn 0.4s ease forwards;
}

.playlists-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.playlists-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.playlists-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.playlists-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.playlists-grid::-webkit-scrollbar {
  height: 6px;
}

.playlists-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.playlists-grid::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 3px;
}

.playlist-card {
  flex: 0 0 160px;
  width: 160px;
  scroll-snap-align: start;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  font-family: inherit;
  outline: none;
}

.playlist-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
}

.playlist-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: #151a2d;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.playlist-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.playlist-card:hover .playlist-cover img {
  transform: scale(1.06);
}

.playlist-cover.no-cover,
.playlist-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, #1e2438, #111522);
}

.playlist-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.playlist-card:hover .playlist-cover-overlay {
  opacity: 1;
}

.playlist-play-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.6);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.playlist-card:hover .playlist-play-icon {
  transform: scale(1);
}

.playlist-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(8, 11, 18, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

.playlist-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-card-sub {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 500;
  margin-top: -4px;
}

/* ==========================================================================
   PLAYLIST DETAIL VIEW
   ========================================================================== */
.playlist-view {
  animation: fadeIn 0.35s ease forwards;
}

.back-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

.playlist-hero {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  background: linear-gradient(180deg, rgba(30, 41, 69, 0.5) 0%, rgba(15, 20, 35, 0.7) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  backdrop-filter: blur(16px);
  flex-wrap: wrap;
}

.playlist-hero-cover {
  width: 170px;
  height: 170px;
  min-width: 170px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  background: #111522;
}

.playlist-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist-hero-info {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.playlist-type-badge {
  align-self: flex-start;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.playlist-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.playlist-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.playlist-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
  flex-wrap: wrap;
}

/* ==========================================================================
   MULTI-SELECTION FLOATING BOTTOM BAR
   ========================================================================== */
.selection-bar {
  position: fixed;
  bottom: calc(var(--player-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 24, 42, 0.95);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-full);
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 90;
  animation: slideUpCenter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.selection-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.selection-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.selection-info strong {
  color: var(--accent-cyan);
  font-weight: 700;
}

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

.selection-clear-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.selection-clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.selection-download-btn {
  background: linear-gradient(135deg, #059669, #10b981);
  border: none;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.selection-download-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.selection-download-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   SONG ITEM CARD
   ========================================================================== */
.song-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  gap: 18px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.song-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 25px rgba(99, 102, 241, 0.15);
}

.song-card.is-playing {
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 242, 254, 0.25);
  background: linear-gradient(90deg, rgba(20, 30, 52, 0.9) 0%, rgba(18, 24, 40, 0.95) 100%);
}

.song-card.is-selected {
  border-color: rgba(0, 242, 254, 0.45);
  background: rgba(18, 30, 54, 0.95);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.15);
}

/* Checkbox on track card */
.track-select {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.track-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.track-select-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.track-select:hover .track-select-box {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
}

.track-checkbox:checked + .track-select-box {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

.track-checkbox:checked + .track-select-box::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Left: Large Cover Art */
.card-cover-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  min-width: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  background: #111522;
  flex-shrink: 0;
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.song-card:hover .card-cover-img {
  transform: scale(1.06);
}

.card-cover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.card-cover-wrapper:hover .card-cover-overlay,
.song-card.is-playing .card-cover-overlay {
  opacity: 1;
}

.overlay-play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

/* Right: Song Information & Controls */
.card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}

.card-header-info {
  display: flex;
  flex-direction: column;
}

.song-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-artist {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chip-quality {
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.2);
}

/* Actions Row: Play, Download, Rating */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.action-buttons-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-card-play {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(79, 70, 229, 0.2));
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--accent-cyan);
}

.btn-card-play:hover {
  background: linear-gradient(135deg, #06b6d4, #4f46e5);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

.btn-card-play.is-playing {
  background: linear-gradient(135deg, #06b6d4, #4f46e5);
  color: #fff;
}

.play-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-label {
  font-weight: 500;
}

.btn-card-download:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Rating Stars Component */
.rating-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stars-box {
  display: flex;
  align-items: center;
  gap: 3px;
}

.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.2);
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-btn:hover {
  transform: scale(1.25);
  color: var(--accent-gold);
}

.star-btn.active {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.rating-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-gold);
}

/* Equalizer Wave in Play Button */
.mini-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.mini-equalizer span {
  width: 3px;
  background: currentColor;
  border-radius: 1px;
  animation: miniWave 0.8s infinite ease-in-out;
}
.mini-equalizer span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.mini-equalizer span:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.mini-equalizer span:nth-child(3) { height: 9px; animation-delay: 0.2s; }

@keyframes miniWave {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

/* ==========================================================================
   LOADING & EMPTY STATES
   ========================================================================== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 20px;
}

.music-wave-loader {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
}

.music-wave-loader span {
  width: 6px;
  height: 40px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 3px;
  animation: wavePulse 1.2s infinite ease-in-out;
}
.music-wave-loader span:nth-child(1) { animation-delay: -0.4s; }
.music-wave-loader span:nth-child(2) { animation-delay: -0.2s; }
.music-wave-loader span:nth-child(3) { animation-delay: 0s; }
.music-wave-loader span:nth-child(4) { animation-delay: 0.2s; }
.music-wave-loader span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wavePulse {
  0%, 40%, 100% { transform: scaleY(0.3); }
  20% { transform: scaleY(1); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 1rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

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

/* Panels */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.view-panel {
  animation: fadeIn 0.35s ease forwards;
}

.active-view {
  animation: fadeIn 0.35s ease forwards;
}

/* ==========================================================================
   PERSISTENT BOTTOM AUDIO PLAYER
   ========================================================================== */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background: rgba(10, 14, 25, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease forwards;
}

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

.player-mini-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  z-index: 20;
  transition: height 0.15s ease;
}

.player-mini-progress:hover {
  height: 6px;
}

.mini-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

.player-container {
  max-width: 1300px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Left: Current Track Meta */
.player-track-info {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 280px;
  min-width: 200px;
}

.player-cover-box {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: #1e2438;
}

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

.cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

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

.player-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.player-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
}

.player-icon-btn:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.player-icon-btn.liked {
  color: #f43f5e;
}

/* Center: Player Controls & Progress */
.player-center {
  flex: 1;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.15s;
}

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

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

.play-btn-main {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, background 0.2s;
}

.play-btn-main:hover {
  transform: scale(1.08);
  background: var(--accent-cyan);
}

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

.progress-bar-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 36px;
}

#time-current { text-align: right; }
#time-total { text-align: left; }

.progress-container {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: height 0.2s ease;
}

.progress-container:hover {
  height: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 3px;
  position: relative;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.progress-container:hover .progress-handle {
  transform: translate(-50%, -50%) scale(1);
}

/* Right: Volume & Download Button */
.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  width: 280px;
  min-width: 200px;
}

.volume-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 85px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.btn-download-bar {
  background: linear-gradient(135deg, #059669, #10b981);
  border: none;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-download-bar:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   TOAST NOTIFICATIONS (Positioned below header, never overlapping tabs)
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(20, 26, 44, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--accent-cyan);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease forwards;
}

.toast.toast-success { border-left-color: #10b981; }
.toast.toast-info { border-left-color: #00f2fe; }
.toast.toast-error { border-left-color: #ef4444; }

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

/* Utility Helpers */
.hidden { display: none !important; }

/* Animated Equalizer inside playing track card */
.card-eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-left: 6px;
  vertical-align: middle;
}

.card-eq-bars span {
  width: 3px;
  background: var(--accent-cyan);
  border-radius: 1px;
  animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.card-eq-bars span:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.card-eq-bars span:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.card-eq-bars span:nth-child(3) { height: 9px; animation-delay: 0.5s; }
.card-eq-bars span:nth-child(4) { height: 12px; animation-delay: 0.2s; }

@keyframes eqBounce {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* Tactile Micro-Interactions */
button:active, .tag-chip:active, .playlist-card:active {
  transform: scale(0.96) !important;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1) !important;
}

/* Card staggered entrance */
.song-card {
  animation: cardEntrance 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   MOBILE & TELEGRAM MINI APP (TMA) RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
  /* Safe-area padding adjustments */
  .app-container {
    padding-bottom: calc(var(--player-height) + var(--safe-area-bottom) + 20px);
  }

  /* Header & Navigation */
  .top-nav {
    padding: calc(10px + var(--safe-area-top)) 14px 10px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-brand {
    gap: 8px;
  }

  .nav-brand .brand-name {
    font-size: 1.15rem;
  }

  .nav-tabs {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
    gap: 5px;
    white-space: nowrap;
    border-radius: var(--radius-full);
  }

  .tab-btn svg {
    width: 15px;
    height: 15px;
  }

  /* Search Hero Section */
  .search-section.centered {
    padding: 24px 16px 20px 16px;
  }

  .hero-badge {
    font-size: 0.72rem;
    padding: 4px 10px;
    margin-bottom: 14px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.3rem);
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .hero-subtitle {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 22px;
  }

  .search-bar-wrapper {
    max-width: 100%;
    padding: 0 12px;
  }

  .search-bar-box {
    padding: 4px 6px 4px 12px;
    gap: 6px;
    border-radius: var(--radius-full);
  }

  .search-icon-box {
    margin-right: 6px;
  }

  .search-input {
    font-size: 0.88rem;
    padding: 8px 0;
    min-width: 0;
    width: 0;
    flex: 1 1 0%;
  }

  .search-btn {
    padding: 7px 14px;
    font-size: 0.82rem;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .quick-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-top: 14px;
    gap: 6px;
  }

  .quick-tags::-webkit-scrollbar {
    display: none;
  }

  .tag-label {
    display: none;
  }

  .tag-chip {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: var(--radius-full);
  }

  /* Content area */
  .content-section {
    padding: 12px 14px;
  }

  .results-meta {
    padding: 0 4px 12px 4px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .count-text {
    font-size: 0.95rem;
  }

  /* Playlists Grid */
  .playlists-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .playlist-card {
    padding: 8px;
    border-radius: var(--radius-md);
  }

  .playlist-card-title {
    font-size: 0.85rem;
  }

  .playlist-card-sub {
    font-size: 0.7rem;
  }

  /* Playlist Hero Detail View */
  .playlist-hero {
    padding: 16px;
    gap: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .playlist-hero-cover {
    width: 110px;
    height: 110px;
  }

  .playlist-hero-actions {
    gap: 8px;
  }

  .playlist-hero-actions button {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  /* SONG CARD: Modern Horizontal Compact Card on Mobile */
  .results-container {
    gap: 10px;
  }

  .song-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  .card-cover-wrapper {
    width: 54px;
    height: 54px;
    min-width: 54px;
    border-radius: 8px;
    overflow: hidden;
  }

  .overlay-play-btn {
    width: 28px;
    height: 28px;
  }

  .overlay-play-btn svg {
    width: 14px;
    height: 14px;
  }

  .card-details {
    flex: 1;
    min-width: 0; /* Ensures ellipsis works inside flex children */
  }

  .card-header-info {
    margin-bottom: 4px;
  }

  .song-title {
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
  }

  .song-artist {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }

  .card-meta-chips {
    gap: 5px;
    margin-top: 4px;
  }

  .chip {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .card-actions {
    margin-top: 6px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .action-buttons-left {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-card-action {
    padding: 5px 10px;
    font-size: 0.75rem;
    gap: 4px;
    border-radius: var(--radius-full);
  }

  .btn-card-action svg {
    width: 13px;
    height: 13px;
  }

  .rating-widget {
    gap: 3px;
  }

  .rating-label {
    display: none; /* Hide label on mobile to save space */
  }

  .star-btn {
    font-size: 0.82rem;
    padding: 2px;
  }

  .rating-value {
    font-size: 0.72rem;
  }

  /* Multi-Selection Floating Bar */
  .selection-bar {
    width: calc(100% - 24px);
    max-width: 440px;
    bottom: calc(70px + var(--safe-area-bottom) + 10px);
    padding: 8px 14px;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 242, 254, 0.3);
  }

  .selection-info {
    font-size: 0.8rem;
    gap: 6px;
  }

  .selection-clear-btn {
    padding: 5px 10px;
    font-size: 0.76rem;
  }

  .selection-download-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 4px;
  }

  /* Bottom Player Bar on Mobile */
  .player-bar {
    height: calc(68px + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
  }

  .player-container {
    padding: 0 12px;
    gap: 10px;
  }

  .player-track-info {
    width: auto;
    flex: 1;
    min-width: 0;
    gap: 10px;
  }

  .player-cover-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 6px;
  }

  .player-title {
    font-size: 0.85rem;
  }

  .player-artist {
    font-size: 0.72rem;
  }

  #player-rate-btn {
    padding: 4px;
  }

  .player-center {
    flex: 0 0 auto;
    max-width: none;
    gap: 0;
  }

  .player-controls {
    gap: 8px;
  }

  .play-btn-main {
    width: 38px;
    height: 38px;
  }

  .play-btn-main svg {
    width: 18px;
    height: 18px;
  }

  .ctrl-btn {
    padding: 4px;
  }

  .progress-bar-wrapper {
    display: none; /* Mobile uses the full-width mini-progress bar at top edge of player */
  }

  .player-right {
    display: none; /* Hardware volume buttons used on phone; download available in card/archive */
  }

  /* Toast notifications centered on mobile */
  .toast-container {
    top: calc(64px + var(--safe-area-top));
    left: 14px;
    right: 14px;
    align-items: center;
  }

  .toast {
    width: 100%;
    max-width: 360px;
    font-size: 0.82rem;
    padding: 10px 14px;
  }
}

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

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

  .card-cover-wrapper {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }

  .song-title {
    font-size: 0.86rem;
  }

  .btn-card-action {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .search-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .search-btn span {
    font-size: 0.78rem;
  }
}

/* Feature Toggle: Recommendations & Ratings disabled (code preserved) */
#tab-recommendations,
#tab-ratings,
#view-recommendations,
#view-ratings,
.rating-widget,
.rating-label,
.rating-value {
  display: none !important;
}

