﻿:root {
  --yt-bg: #0f0f0f;
  --yt-elev: #181818;
  --yt-elev-2: #272727;
  --yt-border: #303030;
  --yt-text: #f1f1f1;
  --yt-text-soft: #aaaaaa;
  --yt-accent: #ff0000;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--yt-bg);
  color: var(--yt-text);
  font-family: Roboto, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.yt-topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--yt-bg);
}

.topbar-left,
.topbar-right {
  width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-right {
  justify-content: flex-end;
}

.topbar-center {
  min-width: 0;
  flex: 1;
  max-width: 732px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.icon-pill {
  border: 0;
  background: transparent;
  color: var(--yt-text);
  cursor: pointer;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.icon-btn:hover {
  background: #242424;
}

.icon-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 500;
  background: #242424;
}

.yt-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
}

.yt-logo-icon {
  color: var(--yt-accent);
  font-size: 15px;
  line-height: 1;
}

.yt-logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.yt-search {
  flex: 1;
  min-width: 0;
  display: flex;
  height: 40px;
}

.yt-search input {
  flex: 1;
  min-width: 90px;
  border: 1px solid var(--yt-border);
  border-right: 0;
  border-radius: 20px 0 0 20px;
  background: #121212;
  color: var(--yt-text);
  padding: 0 16px;
  font-size: 16px;
}

.yt-search input:focus {
  outline: 1px solid #1c62b9;
}

.search-btn {
  width: 64px;
  border: 1px solid var(--yt-border);
  border-radius: 0 20px 20px 0;
  background: #222;
  color: var(--yt-text);
  cursor: pointer;
}

.mic-btn {
  background: #181818;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3f51b5;
  font-size: 15px;
  font-weight: 700;
}

.yt-shell {
  margin-top: 56px;
}

.yt-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 240px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 12px;
}

.nav-block {
  display: grid;
  gap: 2px;
}

.nav-heading {
  margin: 10px 12px 6px;
  color: var(--yt-text-soft);
  font-size: 14px;
  font-weight: 500;
}

.divider {
  height: 1px;
  margin: 10px 0;
  background: var(--yt-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
}

.nav-item:hover {
  background: #232323;
}

.nav-item.active {
  background: #272727;
  font-weight: 500;
}

.nav-ico {
  width: 14px;
  display: inline-flex;
  justify-content: center;
  font-size: 12px;
  color: #7a7a7a;
}

.yt-main {
  margin-left: 240px;
  padding: 8px 24px 28px;
}

.chip-row {
  position: sticky;
  top: 56px;
  z-index: 25;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 0;
  background: var(--yt-bg);
}

.chip {
  flex: 0 0 auto;
  padding: 0 12px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  font-size: 14px;
  line-height: 32px;
  background: #272727;
  color: var(--yt-text);
}

.chip.active {
  background: var(--yt-text);
  color: #0f0f0f;
  font-weight: 500;
}

.error {
  margin: 8px 0 14px;
  background: #6b1a1a;
  border: 1px solid #943535;
  color: #ffd5d5;
  border-radius: 12px;
  padding: 12px 14px;
}

.yt-grid {
  display: grid;
  gap: 24px 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.yt-card {
  min-width: 0;
}

.thumb-wrap,
.result-thumb-wrap,
.related-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.thumb,
.result-thumb,
.related-thumb {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.86);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 12px;
  font-weight: 500;
}

.card-meta-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
}

.channel-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #2f2f2f;
  color: #fff;
}

.channel-dot.big {
  width: 42px;
  height: 42px;
}

.meta-text,
.result-meta,
.related-meta {
  min-width: 0;
}

.title,
.result-title,
.related-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  font-size: 16px;
  font-weight: 500;
}

.author,
.stats {
  color: var(--yt-text-soft);
  font-size: 14px;
}

.author {
  display: block;
  margin-top: 4px;
}

.stats {
  margin: 2px 0 0;
}

.results-main {
  max-width: 1500px;
}

.result-list {
  display: grid;
  gap: 16px;
}

.result-item {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.result-desc {
  margin-top: 8px;
  color: var(--yt-text-soft);
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watch-shell {
  display: block;
}

.watch-sidebar {
  display: none;
}

.watch-layout {
  margin-top: 56px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 402px;
  gap: 24px;
}

.player-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.player-wrap iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}

.watch-title {
  margin: 14px 0 12px;
  font-size: 20px;
  line-height: 1.3;
}

.watch-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.watch-channel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-name {
  margin: 0;
  font-weight: 500;
}

.channel-subs {
  margin: 2px 0 0;
  color: var(--yt-text-soft);
  font-size: 13px;
}

.subscribe-btn {
  margin-left: 10px;
  height: 36px;
  border-radius: 18px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  background: var(--yt-text);
  color: #0f0f0f;
  font-size: 14px;
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.description-box {
  margin-top: 12px;
  background: #272727;
  border-radius: 12px;
  padding: 12px;
}

.description-box p {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.42;
}

.related-col {
  align-content: start;
}

.related-chips {
  position: static;
  padding-top: 0;
  margin-bottom: 8px;
}

.related-item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.related-title {
  font-size: 14px;
}

@media (max-width: 1080px) {
  .topbar-left,
  .topbar-right {
    width: auto;
  }

  .icon-pill {
    display: none;
  }

  .watch-layout {
    grid-template-columns: 1fr;
  }

  .result-item {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .yt-sidebar {
    display: none;
  }

  .yt-main {
    margin-left: 0;
    padding-inline: 12px;
  }

  .yt-grid {
    grid-template-columns: 1fr;
  }

  .topbar-center {
    max-width: none;
  }

  .mic-btn {
    display: none;
  }

  .result-item {
    grid-template-columns: 1fr;
  }

  .watch-layout {
    padding: 12px;
    margin-top: 56px;
  }

  .related-item {
    grid-template-columns: 42% minmax(0, 1fr);
  }
}

