/* =============================================
   SEARCH PAGE — xhchannel Style
   ============================================= */

/* Layout */
.xh-search-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 124px);
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

@media(min-width: 1200px) {
  .xh-search-layout {
    max-width: 1346px;
  }
}

/* ===== FILTER SIDEBAR ===== */
.search-filter-sidebar {
  flex: 0 0 220px;
  width: 220px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.search-filter-sidebar::-webkit-scrollbar {
  width: 3px;
}

.search-filter-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sfb-inner {
  padding: 6px 0 32px;
}

/* Section block */
.sfb-section {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.sfb-section:last-child {
  border-bottom: none;
}

/* Section heading with optional collapse arrow */
.sfb-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 9px;
  cursor: default;
  user-select: none;
}

.sfb-title .material-symbols-outlined {
  font-size: 16px;
  color: var(--text-muted);
  transition: transform var(--trans);
  cursor: pointer;
}

.sfb-title.collapsed .material-symbols-outlined {
  transform: rotate(-90deg);
}

/* Orientation chips row */
.sfb-orientation {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sfb-orientation-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--trans);
  width: 100%;
  text-align: left;
}

.sfb-orientation-btn:hover,
.sfb-orientation-btn.active {
  color: var(--red);
  background: rgba(244, 67, 54, .07);
}

.sfb-orientation-btn .material-symbols-outlined {
  font-size: 15px;
}

/* Sort select */
.sfb-select-wrap {
  position: relative;
}

.sfb-select {
  width: 100%;
  padding: 6px 28px 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  transition: border-color var(--trans);
}

.sfb-select:focus {
  outline: none;
  border-color: var(--red);
}

.sfb-select-icon {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Chips row */
.sfb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sfb-chip {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--trans);
  line-height: 1.6;
}

.sfb-chip:hover,
.sfb-chip.active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(244, 67, 54, .08);
}

/* Duration slider */
.sfb-slider-wrap {
  padding: 4px 2px 2px;
}

.sfb-range {
  width: 100%;
  accent-color: var(--red);
  cursor: pointer;
  height: 4px;
}

.sfb-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.sfb-slider-labels span {
  font-size: 10px;
  color: var(--text-muted);
}

.sfb-slider-value {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  margin-top: 4px;
}

/* Date chips */
.sfb-date-chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sfb-date-chip {
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--trans);
  width: 100%;
}

.sfb-date-chip:hover,
.sfb-date-chip.active {
  color: var(--red);
  background: rgba(244, 67, 54, .07);
}

/* Category search input */
.sfb-cat-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 7px;
  transition: border-color var(--trans);
}

.sfb-cat-search:focus-within {
  border-color: var(--red);
}

.sfb-cat-search .material-symbols-outlined {
  font-size: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sfb-cat-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--text);
  min-width: 0;
}

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

.sfb-cat-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
 
  overflow-y: auto;
  scrollbar-width: thin;
}

.sfb-cat {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 7px;
  border-radius: var(--radius);
  transition: all var(--trans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.sfb-cat:hover,
.sfb-cat.active {
  color: var(--red);
  background: rgba(244, 67, 54, .07);
}

.sfb-cat.sfb-hidden {
  display: none;
}

/* Toggle switch */
.sfb-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 8px;
  padding: 2px 0;
}

.sfb-toggle-label {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.3;
}

.sfb-toggle-input {
  display: none;
}

.sfb-toggle-slider {
  width: 34px;
  height: 19px;
  background: var(--bg-hover);
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--trans);
  border: 1px solid var(--border);
}

.sfb-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--trans), background var(--trans);
}

.sfb-toggle-input:checked + .sfb-toggle-slider {
  background: var(--red);
  border-color: var(--red);
}

.sfb-toggle-input:checked + .sfb-toggle-slider::after {
  transform: translateX(15px);
  background: #fff;
}

/* ===== MAIN CONTENT ===== */
.xh-search-main {
  flex: 1;
  min-width: 0;
  min-width: 300px;
  padding: 14px 18px;
}

/* Search header */
.xh-search-header {
  margin-bottom: 12px;
}

.xh-search-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.xh-search-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

.xh-search-count {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Content type tabs */
.xh-search-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
}

.xh-stab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--trans);
  white-space: nowrap;
  display: inline-block;
}

.xh-stab:hover {
  color: var(--text);
}

.xh-stab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 600;
}

/* Related search tags */
.xh-search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 0 6px;
}

.xh-search-tag {
  padding: 3px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-dim);
  transition: all var(--trans);
  white-space: nowrap;
  line-height: 1.6;
}

.xh-search-tag:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Results grid */
.xh-search-grid {
  margin-top: 8px;
}

/* Empty state */
.xh-search-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.xh-search-empty .material-symbols-outlined {
  font-size: 52px;
  margin-bottom: 10px;
  opacity: .5;
}

.xh-search-empty h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 5px;
}

.xh-search-empty p {
  font-size: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .search-filter-sidebar {
    flex: 0 0 185px;
    width: 185px;
  }
}

@media (max-width: 900px) {
  .search-filter-sidebar {
    flex: 0 0 160px;
    width: 160px;
  }
  .sfb-orientation-btn {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .search-filter-sidebar {
    display: none;
  }
  .xh-search-main {
    padding: 10px 12px;
  }
  .xh-search-title {
    font-size: 15px;
  }
}
