﻿:root {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-soft: #272727;
  --text: #f1f1f1;
  --text-soft: #aaa;
  --border: #303030;
  --sidebar-width: 240px;
  --topbar-height: 56px;
  color-scheme: dark;
  font-family: "Roboto", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding-top: var(--topbar-height);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: var(--bg);
  z-index: 20;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-left,
.topbar-right {
  flex: 0 0 auto;
  gap: 8px;
}

.topbar-center {
  flex: 1;
  justify-content: center;
  gap: 12px;
}

.icon-button,
.icon-circle,
.voice-search,
.more-button {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-button,
.icon-circle,
.voice-search {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.icon-button:hover,
.icon-circle:hover,
.voice-search:hover,
.more-button:hover,
.nav-item:hover,
.chip:hover {
  background: var(--surface-soft);
}

.icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.icon-button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.brand {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  color: inherit;
  text-decoration: none;
}

.brand svg {
  width: 95px;
  height: 20px;
}

.country-code {
  color: var(--text-soft);
  font-size: 10px;
}

.search-bar {
  width: min(100%, 640px);
  display: flex;
}

.search-bar input {
  flex: 1;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: #121212;
  color: var(--text);
  outline: none;
}

.search-submit {
  width: 64px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 0 999px 999px 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.search-submit svg,
.voice-search svg,
.icon-circle svg,
.nav-item svg,
.more-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.voice-search {
  background: var(--surface);
}

.profile-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #7e57c2;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  padding: 12px;
  overflow-y: auto;
  background: var(--bg);
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar.collapsed .nav-item {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 16px 4px;
  font-size: 10px;
}

.sidebar.collapsed .nav-divider {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 12px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.nav-item.active {
  background: var(--surface-soft);
  font-weight: 500;
}

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

.content {
  margin-left: var(--sidebar-width);
  padding: 12px 24px 40px;
  transition: margin-left 0.2s ease;
}

.content.compact {
  margin-left: 72px;
}

.chips {
  position: sticky;
  top: var(--topbar-height);
  z-index: 10;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 0 16px;
  background: linear-gradient(180deg, var(--bg) 82%, rgba(15, 15, 15, 0));
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.chip.active {
  background: var(--text);
  color: var(--bg);
}

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

.thumbnail-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #222;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.video-meta {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 32px;
  gap: 12px;
  padding-top: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
}

.meta-copy {
  min-width: 0;
}

.title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.channel,
.stats {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.4;
}

.more-button {
  align-self: start;
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

@media (max-width: 960px) {
  .sidebar {
    width: 72px;
  }

  .sidebar .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 16px 4px;
    font-size: 10px;
  }

  .sidebar .nav-divider {
    display: none;
  }

  .content {
    margin-left: 72px;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 8px;
    gap: 8px;
  }

  .content {
    margin-left: 0;
    padding: 12px 12px 88px;
  }

  .sidebar {
    top: auto;
    width: 100%;
    height: 64px;
    bottom: 0;
    padding: 0 8px;
    border-top: 1px solid var(--border);
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 100%;
  }

  .sidebar .nav-item,
  .sidebar.collapsed .nav-item {
    border-radius: 0;
    height: 100%;
  }
}

@media (max-width: 560px) {
  .voice-search,
  .icon-circle:first-of-type {
    display: none;
  }

  .search-submit {
    width: 52px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .title {
    font-size: 15px;
  }
}
