* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --yt-red: #ff0000;
  --yt-black: #0f0f0f;
  --yt-dark: #181818;
  --yt-darker: #1a1a1a;
  --yt-border: #303030;
  --yt-text: #f1f1f1;
  --yt-muted: #aaaaaa;
  --yt-hover: #272727;
  --yt-chip: #272727;
  --yt-chip-active: #f1f1f1;
  --sidebar-width: 240px;
  --topbar-height: 56px;
}

body {
  background: var(--yt-black);
  color: var(--yt-text);
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

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

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--yt-black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid var(--yt-border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  background: none;
  border: none;
  color: var(--yt-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-yt {
  background: var(--yt-red);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 18px;
}

.logo-text { font-weight: 500; font-size: 18px; }
.logo-sub { font-size: 10px; color: var(--yt-muted); vertical-align: super; margin-left: 2px; }

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 600px;
}

.search-bar {
  display: flex;
  flex: 1;
}

.search-input {
  flex: 1;
  background: var(--yt-black);
  border: 1px solid var(--yt-border);
  border-right: none;
  color: var(--yt-text);
  padding: 8px 16px;
  font-size: 16px;
  border-radius: 40px 0 0 40px;
  outline: none;
}

.search-input:focus { border-color: #1c62b9; }

.search-btn {
  background: var(--yt-chip);
  border: 1px solid var(--yt-border);
  color: var(--yt-text);
  padding: 0 20px;
  border-radius: 0 40px 40px 0;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
}

.search-btn:hover { background: #3d3d3d; }

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

.icon-btn {
  background: none;
  border: none;
  color: var(--yt-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}

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

.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #065fd4;
  color: white;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  background: var(--yt-black);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  z-index: 90;
  scrollbar-width: none;
}

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

.sidebar-section { padding: 12px 0; border-bottom: 1px solid var(--yt-border); }
.sidebar-section:last-child { border-bottom: none; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 12px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  margin: 0 4px;
  font-size: 14px;
  transition: background 0.1s;
}

.sidebar-item:hover { background: var(--yt-hover); }
.sidebar-item.active { background: var(--yt-hover); font-weight: 600; }

.sidebar-icon { font-size: 20px; min-width: 24px; text-align: center; }

.sidebar-label { font-size: 14px; }

.sidebar-section-title {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--yt-text);
}

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 0;
}

/* ── CHIPS ── */
.chips-bar {
  position: sticky;
  top: var(--topbar-height);
  background: var(--yt-black);
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 80;
  border-bottom: 1px solid var(--yt-border);
}

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

.chip {
  background: var(--yt-chip);
  color: var(--yt-text);
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.1s;
}

.chip:hover { background: #3d3d3d; }

.chip.active {
  background: var(--yt-chip-active);
  color: var(--yt-black);
  font-weight: 600;
}

/* ── VIDEO GRID ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0;
  padding: 16px 24px;
}

.video-card {
  cursor: pointer;
  border-radius: 12px;
  overflow: visible;
  padding: 0 4px 24px;
  transition: transform 0.1s;
}

.video-card:hover { transform: scale(1.01); }

.thumbnail-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--yt-dark);
}

.thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--yt-muted);
}

.thumbnail-placeholder .big-icon { font-size: 36px; }

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-meta {
  display: flex;
  gap: 12px;
  padding: 12px 4px 0;
}

.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.video-info { flex: 1; min-width: 0; }

.video-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.video-channel { font-size: 13px; color: var(--yt-muted); margin-bottom: 2px; }
.video-stats { font-size: 13px; color: var(--yt-muted); }

/* ── WATCH PAGE ── */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  padding: 24px;
  max-width: 1800px;
}

.watch-main {}

.video-player {
  width: 100%;
  padding-bottom: 56.25%;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--yt-dark);
}

.player-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.player-icon { font-size: 64px; }

.player-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding: 0 40px;
}

.player-sub { color: var(--yt-muted); font-size: 15px; }

.watch-title {
  font-size: 20px;
  font-weight: 700;
  margin: 16px 0 8px;
  line-height: 1.3;
}

.watch-meta {
  color: var(--yt-muted);
  font-size: 14px;
  margin-bottom: 12px;
}

.watch-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.action-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--yt-chip);
  border: none;
  color: var(--yt-text);
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.action-pill:hover { background: #3d3d3d; }
.action-pill.red { background: var(--yt-text); color: var(--yt-black); }
.action-pill.red:hover { background: #d0d0d0; }

.watch-description {
  background: var(--yt-hover);
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.watch-description h3 { font-size: 15px; margin-bottom: 8px; }
.watch-description p { color: var(--yt-muted); margin-bottom: 8px; }
.watch-description strong { color: var(--yt-text); }

.metric-row {
  display: flex;
  gap: 24px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--yt-text);
}

.metric-lbl { font-size: 12px; color: var(--yt-muted); }

/* sidebar recommendations */
.watch-sidebar {}

.up-next-label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.rec-card {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
}

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

.rec-thumb {
  width: 160px;
  height: 90px;
  border-radius: 8px;
  background: var(--yt-dark);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  position: relative;
  overflow: hidden;
}

.rec-info { flex: 1; }
.rec-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-channel { font-size: 12px; color: var(--yt-muted); }
.rec-stats { font-size: 12px; color: var(--yt-muted); }

/* ── ABOUT PAGE ── */
.about-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.about-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 60px;
}

.about-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: #065fd4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  color: white;
  margin-bottom: 24px;
}

.about-name { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.about-handle { font-size: 16px; color: var(--yt-muted); margin-bottom: 16px; }
.about-stats-row { display: flex; gap: 32px; margin-bottom: 24px; }
.about-stat-val { font-size: 24px; font-weight: 700; }
.about-stat-lbl { font-size: 13px; color: var(--yt-muted); }

.about-text { font-size: 15px; line-height: 1.7; color: #ccc; }

.section-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--yt-border); }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 48px; }

.skill-card {
  background: var(--yt-dark);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 20px;
}

.skill-icon { font-size: 28px; margin-bottom: 12px; }
.skill-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.skill-desc { font-size: 13px; color: var(--yt-muted); line-height: 1.5; }

/* Tags */
.tag {
  display: inline-block;
  background: var(--yt-chip);
  color: var(--yt-text);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin: 3px;
}

.tag.red { background: rgba(255,0,0,0.15); color: #ff6b6b; }
.tag.blue { background: rgba(6,95,212,0.2); color: #6bb5ff; }
.tag.green { background: rgba(0,150,100,0.2); color: #5de0b5; }

/* ── CONTACT PAGE ── */
.contact-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.contact-card {
  background: var(--yt-dark);
  border: 1px solid var(--yt-border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}

.contact-label { font-size: 13px; color: var(--yt-muted); margin-bottom: 4px; }
.contact-val { font-size: 16px; font-weight: 500; }

/* ── ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--yt-black); }
::-webkit-scrollbar-thumb { background: var(--yt-border); border-radius: 4px; }

/* ── SEARCH OVERLAY ── */
.search-results {
  background: var(--yt-dark);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  position: absolute;
  top: 48px;
  left: 0; right: 0;
  z-index: 200;
  overflow: hidden;
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
}

.search-result-item:hover { background: var(--yt-hover); }

.search-wrap { position: relative; flex: 1; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .watch-layout { grid-template-columns: 1fr; }
  .about-hero { grid-template-columns: 1fr; }
}
