/* ==========================================================================
   SoundVault Тон: Edition Filters & Source Badges (Deep Space Palette)
   No purple gradients. Матовая космическая тема (#0d0e12, #161820).
   ========================================================================== */

/* ── Блок панели фильтров поиска ── */
.ton-search-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.ton-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 0 6px 0;
}

/* ── Компактный аккуратный тумблер/pill "Только оригиналы" ── */
.ton-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #8b92a0;
  background: #11131a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.ton-filter-pill:hover {
  color: #ececec;
  background: #161820;
  border-color: rgba(255, 255, 255, 0.16);
}

.ton-filter-pill-switch {
  position: relative;
  width: 26px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.18s ease;
  flex-shrink: 0;
}

.ton-filter-pill-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #70747f;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease;
}

/* Активное состояние тумблера */
.ton-filter-pill.active {
  color: #ffffff;
  background: #161820;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ton-filter-pill.active .ton-filter-pill-switch {
  background: rgba(74, 222, 128, 0.25);
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.ton-filter-pill.active .ton-filter-pill-thumb {
  transform: translateX(12px);
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

/* ── Разметка строки трека: контейнер заголовка и бейджей ── */
.row .inf {
  min-width: 0;
}

.row-title-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.row-title-wrap b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.row-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* ── Базовый стиль бейджа (аккуратный, компактный, не броский) ── */
.ton-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 4.5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #8b92a0;
  opacity: 0.75;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ton-badge:hover {
  opacity: 1;
}

/* ── Бейджи типов изданий (Edition Types) ── */
.badge-edition {
  font-size: 8.5px;
}

/* Original */
.badge-edition.badge-original {
  background: rgba(74, 222, 128, 0.06);
  border-color: rgba(74, 222, 128, 0.15);
  color: #86efac;
}

/* Slowed */
.badge-edition.badge-slowed {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

/* Sped Up / Nightcore / Daycore */
.badge-edition.badge-sped-up,
.badge-edition.badge-sped_up {
  background: rgba(251, 146, 60, 0.06);
  border-color: rgba(251, 146, 60, 0.15);
  color: #fdba74;
}

/* Remix / Club Mix / Mashup */
.badge-edition.badge-remix {
  background: rgba(99, 102, 241, 0.07);
  border-color: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

/* Other Edit / 8D Audio / Bass Boosted / Fan Edit */
.badge-edition.badge-other-edit,
.badge-edition.badge-other_edit {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
}

/* ── Бейджи источников (Честные источники: мягкие, не перекрывающие) ── */
.badge-source {
  font-size: 8.5px;
  font-weight: 500;
  text-transform: none;
  background: rgba(255, 255, 255, 0.03);
}

/* SoundCloud */
.badge-source.badge-source-soundcloud {
  background: rgba(255, 85, 0, 0.06);
  border-color: rgba(255, 85, 0, 0.16);
  color: #ff884d;
}

/* Deezer */
.badge-source.badge-source-deezer {
  background: rgba(0, 199, 183, 0.06);
  border-color: rgba(0, 199, 183, 0.16);
  color: #5eead4;
}

/* YouTube */
.badge-source.badge-source-youtube {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
}

/* Audius */
.badge-source.badge-source-audius {
  background: rgba(204, 30, 237, 0.10);
  border-color: rgba(204, 30, 237, 0.24);
  color: #e879f9;
}

/* Jamendo */
.badge-source.badge-source-jamendo {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.26);
  color: #fcd34d;
}

/* Честный редирект: "SoundCloud → YouTube" / "Deezer → YouTube" */
.badge-source.badge-source-redirect,
.badge-source.badge-source-soundcloud-youtube,
.badge-source.badge-source-deezer-youtube {
  background: #161820;
  border-color: rgba(251, 146, 60, 0.35);
  color: #fdba74;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.badge-source.badge-source-redirect .badge-arrow {
  color: #94a3b8;
  margin: 0 1px;
  font-weight: 400;
}

/* Состояние строки при скрытии фильтром */
.row.edition-hidden {
  display: none !important;
}

/* Анимация пульса при прогреве */
@keyframes prewarm-glow {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

.badge-source.is-prewarming {
  animation: prewarm-glow 1.2s infinite ease-in-out;
}

/* ── Мобильная адаптация бейджей: ультракомпактные, не перекрывают заголовок и кнопки ── */
@media (max-width: 768px) {
  .row-title-wrap {
    gap: 4px;
    max-width: 100%;
  }
  .row-badges {
    gap: 3px;
    flex-shrink: 0;
  }
  .ton-badge {
    font-size: 8px;
    padding: 0.5px 3.5px;
    border-radius: 2px;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
  }
}
