/* YouTube tab styles: filter panel, channel column, channel header and channel search. */

/* The panel's top block (cat#32–#36; md:L41954–42035) --------------------------- */

.yt-panel-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.yt-panel-top .ct-panel-part {
  margin: 0;
}

/* The HSK levels, shown only while the study language has them (video-panel.js); numbers need less room than words,
   so the eight choices share one row. */
.ct-panel-hsk:empty {
  display: none;
}

.ct-panel-hsk .ct-choice {
  padding: 0 6px;
}

/* The tab's own button at the channel column's heading (YouTube's channel search, Bilibili's "add"): a round icon. */
.yt-search-channels {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-label);
  cursor: pointer;
}

.yt-search-channels:hover {
  background: var(--hover);
  color: var(--selected-text);
}

/* The duration slider's "5m" label is nudged 16 px left (cat#33, md:L41987). */
.yt-duration-slider .ct-slider-label[data-index="1"] {
  margin-left: -16px;
}

/* The channel search (cat#58–#66; md:L41447–41950) ------------------------------------ */

.yt-discover {
  width: min(720px, calc(100vw - 32px));
  max-height: min(80vh, 900px);
}

.yt-discover-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yt-discover-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

/* The same dialog holding only the field (Bilibili's, bilibili/channel-add.js): no room kept for search results. */
.yt-discover.is-field-only .yt-discover-body {
  min-height: 0;
}

.yt-discover-bar {
  display: flex;
  gap: 8px;
}

.yt-discover-field {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
}

.yt-discover-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 16px/1.4 var(--font);
  outline: none;
}

.yt-discover-field:focus-within {
  border-color: var(--accent);
}

.yt-discover-results {
  overflow-y: auto;
}

.yt-discover-center {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}

.yt-discover-none {
  color: color-mix(in srgb, var(--ink) 53.3%, transparent);
}

.yt-discover-error {
  color: oklch(from #f87171 min(l, var(--max-lightness, 1)) c h);
}

/* "Thêm kênh từ YouTube" under the search (channel-add.js, S368). */
.yt-channel-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.yt-channel-add-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  font-weight: 600;
}

.yt-channel-add-status {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 73.3%, transparent);
}

.yt-channel-add-status:empty {
  display: none;
}

.yt-channel-add-status.is-error {
  color: oklch(from #f87171 min(l, var(--max-lightness, 1)) c h);
}

.yt-discover-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.yt-found {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}

.yt-found:hover {
  background: var(--hover);
}

.yt-found-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.yt-found-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.yt-found-title {
  font-weight: 500;
}

.yt-found-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.yt-found-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.yt-found-like {
  color: var(--accent-soft);
}

.yt-found-desc {
  display: -webkit-box;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink) 73.3%, transparent);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
