/* ── Sounds Tab ──────────────────────────── */

.sounds-search-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  flex-shrink: 0;
}

.sounds-search-wrap .search-input {
  flex: 1;
}

.btn-sounds {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-sounds:hover { opacity: 0.85; }

/* Controls row (volume + mode toggle) */
.sounds-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Stream mode toggle */
.sounds-mode-btn {
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  margin-left: auto;
}
.sounds-mode-local {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.sounds-mode-local:hover {
  color: var(--text);
  border-color: var(--text);
}
.sounds-mode-stream {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.sounds-mode-stream:hover {
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
}

/* Sub-tabs (Trending / Best / Results / Favorites) */
.sounds-sub-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  flex-shrink: 0;
}

.sounds-sub-tab {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.sounds-sub-tab:hover { color: var(--text); }
.sounds-sub-tab.active {
  color: #f59e0b;
  border-bottom-color: #f59e0b;
}

/* Sound grid */
.sounds-panel {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 60px;
}

.sounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

/* Individual sound card */
.sound-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}
.sound-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
  transform: translateY(-1px);
}
.sound-card:active {
  transform: scale(0.97);
}
.sound-card.playing {
  border-color: #22c55e;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

/* Favorite button on cards */
.sound-fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
  z-index: 2;
}
.sound-fav-btn:hover {
  color: #ff4d6d;
  transform: scale(1.2);
}
.sound-fav-btn.sound-fav-active {
  color: #ff4d6d;
}

.sound-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.sound-card.playing .sound-card-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.sound-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.sound-card-meta {
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Progress ring animation for playing sounds */
.sound-card.playing .sound-card-icon::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #22c55e;
  animation: sound-spin 0.8s linear infinite;
}

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

/* Status messages */
.sounds-status-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 30px 16px;
}

.sounds-status-msg .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: sound-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Volume control */
.sounds-volume-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  flex-shrink: 0;
}

.sounds-volume-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.sounds-volume-slider {
  flex: 1;
  max-width: 120px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
}
.sounds-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
}
.sounds-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  border: none;
}

.sounds-volume-val {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 28px;
  text-align: right;
}

/* Disabled banner */
#sounds-disabled-banner {
  display: none;
  background: var(--danger);
  color: #fff;
  text-align: center;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
