/**
 * Discovery Bar Component
 * Reusable topic filter/discovery bar component
 * Used on: explore page, profile pages, topic pages, leaderboard
 */

/* ============================================================================
   Discovery Bar Section
   ============================================================================ */

.discovery-bar-section {
  position: relative;
  padding: 0.5rem 0 1rem;
  margin-bottom: 0.25rem;
}

/* ============================================================================
   Discovery Bar Container
   ============================================================================ */

.discovery-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.discovery-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md, 8px);
  min-width: 0;
}

/* ============================================================================
   Discovery Links
   ============================================================================ */

.discovery-links-wrapper {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.discovery-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.1rem 0;
}

.discovery-links::-webkit-scrollbar {
  display: none;
}

/* ============================================================================
   Discovery Link Pills
   ============================================================================ */

.discovery-link {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-text-secondary, #888);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.discovery-link:hover {
  color: white;
  background: rgba(0, 168, 255, 0.2);
  border-color: rgba(0, 168, 255, 0.4);
  box-shadow: 0 0 8px rgba(0, 168, 255, 0.3);
}

.discovery-link.active {
  color: white;
  background: rgba(0, 168, 255, 0.25);
  border-color: rgba(0, 168, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.4);
}

/* ============================================================================
   Discovery Search Pill
   ============================================================================ */

.discovery-search-pill {
  position: relative;
  overflow: hidden;
  /* Active blue style by default */
  color: white;
  background: rgba(0, 168, 255, 0.25);
  border-color: rgba(0, 168, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.4);
}

.discovery-search-pill svg {
  flex-shrink: 0;
  margin-left: 0.3rem;
  transition: opacity 0.2s ease;
}

.discovery-search-pill .discovery-search-input {
  width: 0;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: white;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.discovery-search-pill .discovery-search-input:focus {
  outline: none;
  box-shadow: none;
}

.discovery-search-pill .discovery-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* Expanded state */
.discovery-search-pill.expanded {
  background: rgba(0, 168, 255, 0.3);
  border-color: rgba(0, 168, 255, 0.6);
}

.discovery-search-pill.expanded .discovery-search-input {
  width: 80px;
  opacity: 1;
  margin-left: 0.25rem;
}

/* ============================================================================
   No Results Message
   ============================================================================ */

.discovery-no-results {
  font-size: 0.75rem;
  color: var(--color-text-muted, #666);
  font-style: italic;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

/* ============================================================================
   Active Filters Row
   ============================================================================ */

.active-filters-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
}

.active-filters-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #666);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.active-filters-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 168, 255, 0.15);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.75rem;
  color: white;
}

.filter-pill-text {
  font-weight: 500;
}

.filter-pill-remove {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s ease;
}

.filter-pill-remove:hover {
  color: white;
}

.clear-all-filters-btn {
  font-size: 0.7rem;
  color: var(--color-text-muted, #666);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
}

.clear-all-filters-btn:hover {
  color: white;
}

/* ============================================================================
   Profile Page Variant
   Minimal adjustments for profile pages
   ============================================================================ */

.profile-topic-filter-section {
  margin-bottom: 1rem;
}

.profile-discovery-bar-wrapper {
  padding: 0;
}

.profile-discovery-bar {
  background: transparent;
  border: none;
  padding: 0.5rem 0;
}

/* ============================================================================
   Topic Filter Bar Variant (Centered)
   For topic pages and other centered layouts
   ============================================================================ */

.topic-filter-bar-wrapper {
  margin-bottom: 1rem;
}

.topic-filter-bar-wrapper .discovery-bar {
  justify-content: center;
}

.topic-filter-bar-wrapper .discovery-links-wrapper {
  flex: 0 1 auto;
  max-width: 100%;
}

.topic-filter-bar-wrapper .discovery-links {
  justify-content: center;
}

/* ============================================================================
   Mobile Responsive
   ============================================================================ */

@media (max-width: 768px) {
  .discovery-bar-section {
    padding: 0.25rem 0 0.5rem;
  }

  .discovery-bar {
    padding: 0.35rem 0.5rem;
  }

  .discovery-links {
    gap: 0.3rem;
  }

  .discovery-link {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }

  .active-filters-row {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
  }

  .active-filters-pills {
    width: 100%;
    order: 2;
  }
}
