* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Roboto', Arial, sans-serif; background: #0f0f0f; color: #fff; }
a { text-decoration: none; color: inherit; }

/* ===== HEADER ===== */
.header { position: fixed; top: 0; left: 0; right: 0; height: 56px; background: #0f0f0f; display: flex; align-items: center; padding: 0 16px; z-index: 100; border-bottom: 1px solid #303030; }
.header-left { display: flex; align-items: center; gap: 16px; min-width: 200px; }
.menu-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 8px; border-radius: 50%; }
.menu-btn:hover { background: #272727; }
.logo { display: flex; align-items: center; gap: 2px; font-size: 20px; font-weight: 700; }
.logo svg { width: 90px; height: 20px; }
.header-center { flex: 1; display: flex; justify-content: center; max-width: 732px; margin: 0 auto; }
.search-form { display: flex; width: 100%; max-width: 560px; }
.search-input { flex: 1; height: 40px; background: #121212; border: 1px solid #303030; border-right: none; border-radius: 20px 0 0 20px; padding: 0 16px; color: #fff; font-size: 16px; outline: none; }
.search-input:focus { border-color: #3ea6ff; }
.search-btn { height: 40px; width: 64px; background: #222; border: 1px solid #303030; border-radius: 0 20px 20px 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.search-btn:hover { background: #333; }
.header-right { display: flex; align-items: center; gap: 8px; min-width: 200px; justify-content: flex-end; }
.icon-btn { background: none; border: none; color: #fff; cursor: pointer; padding: 8px; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #272727; }
.avatar { width: 32px; height: 32px; border-radius: 50%; }

/* ===== CATEGORIES ===== */
.categories { position: fixed; top: 56px; left: 0; right: 0; height: 56px; background: #0f0f0f; display: flex; align-items: center; padding: 0 24px; gap: 12px; overflow-x: auto; z-index: 90; border-bottom: 1px solid #303030; }
.categories::-webkit-scrollbar { display: none; }
.category-chip { padding: 6px 12px; background: #272727; border: none; border-radius: 8px; color: #fff; font-size: 14px; white-space: nowrap; cursor: pointer; }
.category-chip:hover { background: #3d3d3d; }
.category-chip.active { background: #fff; color: #0f0f0f; }

/* ===== SIDEBAR ===== */
.main { display: flex; padding-top: 112px; }
.sidebar { width: 240px; min-width: 240px; padding: 12px 0; overflow-y: auto; height: calc(100vh - 112px); position: fixed; }
.sidebar.hidden { display: none; }
.sidebar-item { display: flex; align-items: center; gap: 24px; padding: 8px 24px; font-size: 14px; cursor: pointer; border-radius: 10px; margin: 0 12px; }
.sidebar-item:hover { background: #272727; }
.sidebar-item.active { background: #272727; font-weight: 500; }
.sidebar-item .material-icons { font-size: 20px; }
.sidebar-divider { height: 1px; background: #303030; margin: 12px 0; }
.sidebar-title { padding: 8px 24px; font-size: 14px; font-weight: 500; color: #aaa; }
.content { flex: 1; padding: 16px 24px; margin-left: 240px; }

/* ===== VIDEO GRID ===== */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px 16px; }
.video-card { cursor: pointer; }
.video-card:hover .thumbnail img { border-radius: 0; }
.thumbnail { position: relative; width: 100%; aspect-ratio: 16/9; overflow: hidden; border-radius: 12px; background: #1a1a1a; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; transition: border-radius 0.2s; }
.duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); padding: 2px 4px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.video-info { display: flex; gap: 12px; margin-top: 12px; }
.video-info .avatar { width: 36px; height: 36px; flex-shrink: 0; margin-top: 2px; }
.video-details { flex: 1; }
.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-meta { font-size: 12px; color: #aaa; }
.verified { font-size: 14px; margin-left: 2px; vertical-align: middle; }

/* ===== WATCH PAGE ===== */
.watch-page { display: flex; gap: 24px; padding: 16px 24px; }
.video-player { flex: 1; }
.player-container { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.player-container img { width: 100%; height: 100%; object-fit: cover; }
.watch-info { padding: 16px 0; }
.watch-title { font-size: 20px; font-weight: 500; line-height: 1.4; }
.watch-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; gap: 12px; }
.watch-views { font-size: 14px; color: #aaa; }
.watch-actions { display: flex; gap: 8px; }
.action-btn { display: flex; align-items: center; gap: 6px; background: #272727; border: none; color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 14px; cursor: pointer; }
.action-btn:hover { background: #3d3d3d; }
.channel-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid #303030; margin-top: 16px; }
.channel-left { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.channel-left .avatar { width: 40px; height: 40px; }
.channel-name { font-size: 16px; font-weight: 500; }
.channel-subs { font-size: 12px; color: #aaa; }
.subscribe-btn { background: #fff; color: #0f0f0f; border: none; padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; }
.subscribe-btn:hover { background: #d9d9d9; }
.description { background: #272222; border-radius: 12px; padding: 12px; margin-top: 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.related-section { width: 400px; flex-shrink: 0; }
.related-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.related-card { display: flex; gap: 8px; margin-bottom: 8px; cursor: pointer; padding: 4px; border-radius: 8px; }
.related-card:hover { background: #272727; }
.related-thumb { width: 168px; height: 94px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #1a1a1a; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-info { flex: 1; }
.related-video-title { font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-video-meta { font-size: 12px; color: #aaa; margin-top: 4px; }

/* ===== CHANNEL PAGE ===== */
.channel-page { }
.channel-banner { width: 100%; height: 200px; object-fit: cover; }
.channel-header { display: flex; align-items: center; gap: 24px; padding: 24px 48px; }
.channel-header .avatar { width: 80px; height: 80px; }
.channel-header-info h1 { font-size: 24px; font-weight: 500; }
.channel-header-info .meta { font-size: 14px; color: #aaa; margin-top: 4px; }
.channel-header-info .description { font-size: 14px; color: #aaa; margin-top: 8px; max-width: 600px; }
.channel-actions { display: flex; gap: 8px; margin-left: auto; }
.subscribe-btn-lg { background: #fff; color: #0f0f0f; border: none; padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; }
.subscribe-btn-lg:hover { background: #d9d9d9; }
.channel-tabs { display: flex; gap: 0; border-bottom: 1px solid #303030; padding: 0 48px; }
.channel-tab { padding: 16px 24px; font-size: 14px; font-weight: 500; color: #aaa; cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; }
.channel-tab:hover { color: #fff; }
.channel-tab.active { color: #fff; border-bottom-color: #fff; }
.channel-content { padding: 24px 48px; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.playlist-card { cursor: pointer; border-radius: 12px; overflow: hidden; background: #272727; }
.playlist-card:hover { background: #3d3d3d; }
.playlist-thumb { position: relative; width: 100%; aspect-ratio: 16/9; background: #1a1a1a; }
.playlist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.playlist-count { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.8); padding: 4px 8px; border-radius: 4px; font-size: 12px; }
.playlist-card-info { padding: 8px 12px; }
.playlist-card-info h3 { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.playlist-card-info p { font-size: 12px; color: #aaa; }
.about-section { max-width: 700px; }
.about-section h3 { font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.about-section p { font-size: 14px; color: #aaa; line-height: 1.6; margin-bottom: 20px; }
.about-stats { display: flex; gap: 40px; margin-bottom: 20px; }
.about-stat .num { font-size: 14px; font-weight: 500; }
.about-stat .label { font-size: 12px; color: #aaa; margin-top: 4px; }
.about-links a { color: #3ea6ff; font-size: 14px; display: block; margin-bottom: 8px; }

/* ===== YOU (Profile) PAGE ===== */
.you-page { padding: 32px 48px; }
.you-header { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.you-header .avatar { width: 64px; height: 64px; }
.you-header-info h1 { font-size: 20px; font-weight: 500; }
.you-header-info .meta { font-size: 14px; color: #aaa; margin-top: 2px; }
.you-section { margin-bottom: 32px; }
.you-section-title { font-size: 16px; font-weight: 500; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.you-section-title span.see-all { font-size: 14px; color: #3ea6ff; cursor: pointer; }
.you-grid { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.you-grid::-webkit-scrollbar { display: none; }
.you-chip { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #272727; border: none; border-radius: 8px; color: #fff; font-size: 14px; white-space: nowrap; cursor: pointer; }
.you-chip:hover { background: #3d3d3d; }
.you-chip .material-icons { font-size: 20px; }
.you-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: #0f0f0f; border-top: 1px solid #303030; z-index: 200; align-items: center; justify-content: space-around; padding: 0 8px; }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: #aaa; font-size: 10px; cursor: pointer; padding: 4px 12px; border-radius: 8px; }
.bottom-nav-item .material-icons { font-size: 24px; }
.bottom-nav-item.active { color: #fff; }
.bottom-nav-item:hover { background: #272727; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .content { margin-left: 0; }
}

@media (max-width: 768px) {
  .bottom-nav { display: flex; }

  /* Header compact */
  .header { padding: 0 8px; height: 48px; }
  .header-left { min-width: auto; gap: 4px; }
  .header-left .logo { display: none; }
  .header-center { flex: 1; margin: 0; max-width: none; }
  .header-right { min-width: auto; gap: 4px; }
  .header-right .icon-btn { width: 36px; height: 36px; padding: 6px; }
  .header-right .icon-btn:nth-child(2) { display: none; }
  .header-right .avatar { width: 28px; height: 28px; }

  /* Search compact */
  .search-form { max-width: none; }
  .search-input { height: 36px; font-size: 14px; border-radius: 18px 0 0 18px; padding: 0 12px; }
  .search-btn { height: 36px; width: 48px; border-radius: 0 18px 18px 0; }

  /* Categories */
  .categories { top: 48px; padding: 0 8px; gap: 8px; }
  .category-chip { padding: 5px 10px; font-size: 13px; }

  /* Layout */
  .main { padding-top: 100px; }
  .sidebar { display: none !important; }
  .content { padding: 8px 8px 72px; margin-left: 0 !important; }
  .watch-page { margin-left: 0 !important; padding: 8px 8px 72px; flex-direction: column; }
  .channel-page { margin-left: 0 !important; padding-bottom: 72px; }
  .you-page { margin-left: 0 !important; padding: 16px 12px 72px; }
  .video-grid { grid-template-columns: 1fr; gap: 20px; }
  .video-info { gap: 8px; }
  .video-info .avatar { width: 32px; height: 32px; }

  /* Channel mobile */
  .channel-banner { height: 120px; }
  .channel-header { padding: 16px; flex-direction: column; text-align: center; }
  .channel-header .avatar { width: 64px; height: 64px; }
  .channel-header-info h1 { font-size: 18px; }
  .channel-header-info .description { font-size: 13px; }
  .channel-actions { margin-left: 0; margin-top: 8px; }
  .channel-tabs { padding: 0 12px; overflow-x: auto; }
  .channel-tab { padding: 12px 16px; font-size: 13px; white-space: nowrap; }
  .channel-content { padding: 12px; }
  .playlist-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* You page mobile */
  .you-header { flex-direction: column; text-align: center; gap: 12px; }
  .you-header .avatar { width: 72px; height: 72px; }
  .you-grid { gap: 8px; }

  /* Watch */
  .related-section { width: 100%; }
  .watch-actions { flex-wrap: wrap; }
  .action-btn { padding: 6px 12px; font-size: 12px; }
  .about-stats { flex-wrap: wrap; gap: 20px; }
}
