/* UI Improvements CSS */

/* Trending section */
.trending-container {
  display: flex;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
  position: relative; /* Ensure proper positioning context */
}

.trending-label {
  font-weight: 500;
  margin-right: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.trending-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.trending-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  color: var(--text);
  display: flex;
  align-items: center;
}

.trending-tag:hover {
  background-color: var(--surface-hover);
  transform: translateY(-1px);
}

.tag-count {
  background-color: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.8rem;
  margin-left: 5px;
  font-weight: 500;
}

/* Search button and container */
.search-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
  z-index: 5; /* Ensure it's above other elements */
}

.search-toggle:hover {
  background-color: var(--surface-hover);
  transform: translateY(-1px);
}

.search-toggle:active {
  transform: scale(0.95);
}

.search-toggle svg {
  color: var(--muted);
}

/* Base styles for search container - positioning handled in search-layout.css */
.search-container {
  display: none;
  width: 100%;
}

.search-container.active {
  display: flex;
}

#search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s;
}

#search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

#search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

#search-button:hover {
  color: var(--primary);
}

/* View controls */
.view-controls {
  display: none;
  justify-content: center;
  margin: 10px 0;
  gap: 10px;
}

.view-controls.visible,
.view-controls.has-bookmarks {
  display: flex;
}

.view-controls button {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text);
}

.view-controls button.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Search filter section */
.search-filter-section {
  position: relative;
  width: 100%;
}

/* Responsive styles */
@media (max-width: 768px) {
  .trending-container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .trending-label {
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .trending-tag {
    padding: 4px 10px;
    font-size: 0.8rem;
  }
  
  .tag-count {
    padding: 1px 4px;
    font-size: 0.7rem;
  }
}