/* ====== Base ====== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0f0f0f;
  color: #f1f1f1;
}

/* ====== Topbar ====== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: #0f0f0f;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
}

.topbar__left, .topbar__center, .topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  border: 0;
  background: transparent;
  color: #f1f1f1;
  font-size: 18px;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.icon-btn:hover { background: #222; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.logo__dot {
  display: inline-flex;
  width: 26px;
  height: 18px;
  align-items: center;
  justify-content: center;
  background: #ff0033;
  color: white;
  border-radius: 5px;
  font-size: 12px;
}
.logo__text { font-weight: 700; letter-spacing: 0.2px; }

/* Search */
.search {
  display: flex;
  align-items: center;
  width: min(720px, 60vw);
  gap: 8px;
}
.search__input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #333;
  background: #121212;
  color: #f1f1f1;
  outline: none;
}
.search__input:focus { border-color: #555; }
.search__btn {
  height: 38px;
  min-width: 44px;
  border-radius: 999px;
  border: 1px solid #333;
  background: #222;
  color: #f1f1f1;
  cursor: pointer;
}
.search__btn:hover { background: #2b2b2b; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #2a6cff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* ====== Layout ====== */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid #222;
  padding: 12px 8px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow: auto;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__item {
  text-decoration: none;
  color: #f1f1f1;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.nav__item:hover { background: #222; }
.nav__item--active { background: #272727; }
.nav__divider {
  height: 1px;
  background: #222;
  margin: 10px 8px;
}

/* Content */
.content {
  padding: 16px;
}

/* Filter chips */
.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  border: 1px solid #333;
  background: #1a1a1a;
  color: #f1f1f1;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}
.chip:hover { background: #222; }
.chip--active {
  background: #f1f1f1;
  color: #111;
  border-color: transparent;
}

/* ====== Video Grid / Cards ====== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  border-radius: 14px;
  overflow: hidden;
}

.card__media {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
}

.video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.card__body {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  padding: 10px 2px 2px;
}

.channel-badge {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #333;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.title {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}

.channel, .stats {
  margin: 4px 0 0;
  font-size: 12px;
  color: #aaa;
}

/* ====== Responsive ====== */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .layout { grid-template-columns: 90px 1fr; }
  .nav__item { font-size: 12px; padding: 10px; }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .topbar__center { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
