/* Nội dung › YouTube: the filter panel, the channel column, a channel's
   header and the channel search (frontend/panel/content/youtube/). Sizes and
   colours are those output/reference/behaviours/content-catalogue.md reads
   from the reference, cited per block. */

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

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

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

.yt-sort {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.yt-sort-slot {
  flex: 1 1 auto;
  min-width: 0;
}

.yt-search-channels {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text-strong);
  cursor: pointer;
}

.yt-search-channels:hover {
  background: linear-gradient(var(--hover), var(--hover)), var(--surface-raised);
}

/* 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;
}

/* A channel's own parts of the header (cat#37–#42, #67–#70; md:L44415–45128; the frame: ../playlists.css) ---- */

/* The order's choices carry their pictures (cat#35). */
.yt-sort .ct-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.yt-header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.yt-header-count {
  padding: 2px 8px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  font-size: 15px;
}

.yt-header-youtube {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}

.yt-similar-heading {
  margin-bottom: 6px;
  color: var(--text-label);
  font-size: 12px;
}

.yt-similar-row {
  display: flex;
  gap: 12px;
  overflow: hidden;
}

.yt-similar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 56px;
  cursor: pointer;
}

.yt-similar-avatar,
.yt-similar-more {
  border-radius: 50%;
  object-fit: cover;
}

.yt-similar-more {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}

.yt-similar-name {
  width: 100%;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink) 60%, transparent);
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yt-skeleton {
  display: block;
  background: color-mix(in srgb, var(--ink) 7.8%, transparent);
  animation: yt-pulse 1.5s ease-in-out infinite;
}

.yt-skeleton.is-round {
  border-radius: 50%;
}

.yt-skeleton.is-text {
  width: 100%;
  height: 10px;
  border-radius: 4px;
}

@keyframes yt-pulse {
  50% {
    opacity: 0.4;
  }
}

@media (max-width: 900px) {
  .yt-header-meta {
    justify-content: center;
  }

  .yt-similar-item {
    width: 48px;
  }

  .yt-similar-row {
    justify-content: center;
  }
}

/* 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,
.yt-found-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.yt-found-link {
  color: var(--text-muted);
  text-decoration: none;
}

.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;
}
