/* Import YouTube's font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* ======================= GLOBAL ======================= */
* {
  box-sizing: border-box;
}
body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: white;
  color: #0f0f0f;
  margin: 0;
  padding: 0;
  position: relative;
  min-height: 100vh;
  /* Reserve space for bottom nav if needed */
  padding-bottom: 56px; /* the height of the bottom nav */
}

/* Prevent anchor flicker on iOS tap highlight */
a {
  text-decoration: none;
  color: inherit;
}

/* ======================= HEADER & SCROLL-HIDE ======================= */
.site-header {
  /* Use black background to match your new design */
  background-color: black !important;
  position: fixed;
  top: 0;
  width: 100%;
  min-height: 56px; /* Let it grow if needed */
  z-index: 1000;
  transition: transform 0.3s ease-in-out;
}
.site-header.hide {
  transform: translateY(-100%);
}

/* We don't need the old .top-toolbar approach. If you had it, comment it out:
   .top-toolbar {
     display: flex;
     align-items: center;
     justify-content: space-between;
     height: 56px;
     padding: 0 8px;
     box-shadow: 0 1px 1px rgba(0,0,0,0.1);
   }
*/

/* The icon images sized 24px, commonly used in top controls */
.icon-img {
  width: 24px;
  height: 24px;
  object-fit: cover;
}

/* ======================= CATEGORY BAR ======================= */
.category-bar {
  overflow-x: auto;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  background-color: #fff;
}
.category-list {
  display: inline-flex;
  margin: 0;
  padding: 8px;
  list-style: none;
}
.category-item {
  font-size: 14px;
  font-weight: 300;
  padding: 6px 12px;
  margin-right: 8px;
  border-radius: 18px;
  background-color: #f2f2f2;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.category-item.active {
  background-color: #000;
  color: #fff;
}

/* ======================= SIDEBAR ======================= */
.sidebar {
  width: 240px;
  height: 100vh;
  background: #fff;
  position: fixed;
  top: 56px; /* below header */
  left: -240px;
  padding-top: 10px;
  border-right: 1px solid #e5e5e5;
  overflow-y: auto;
  transition: left 0.3s ease-in-out;
  z-index: 2000;
}
.sidebar.open {
  left: 0;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar ul li {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
}
.sidebar ul li:hover {
  background: #f5f5f5;
}

/* ======================= HOMEPAGE: SINGLE COLUMN FEED ======================= */
#video-list {
  max-width: 110vw; /* or desired feed width */
  margin: 0;
  /* 112px top padding = 56px header + ~56px category bar */
  padding: 112px 0px 24px 0px;
}

/* Each video card in the feed */
.video-item {
  background: #fff;
  margin-bottom: 16px;
  overflow: hidden;
  transition: transform 0.2s ease-in-out;
}
.video-item:hover {
  transform: scale(1.02);
}
.video-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.video-item h3 {
  font-size: 14px;
  margin: 8px 8px 4px 8px;
  line-height: 1.3;
}
.video-item p {
  margin: 0 8px 8px 8px;
  font-size: 13px;
  color: #606060;
}

/* ======================= BOTTOM NAV (3 icons) ======================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -1px 1px rgba(0,0,0,0.1);
  z-index: 1000;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  font-size: 12px;
  padding: 4px 0;
  color: #606060;
  cursor: pointer;
}
.bottom-nav-item img {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}
.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: #000;
}

/* ======================= MEDIA QUERIES ======================= */
@media (min-width: 769px) {
  /* On larger screens, you might do something else or keep as is. */
}
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
}

/* ======================= WATCH PAGE ======================= */

/* Pin the main video below the site header */
.watch-video-container {
  position: fixed;
  top: 56px;
  left: 0;
  width: 100vw;
  background-color: #000;
  z-index: 500;
}
.video-aspect-ratio {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
}
.video-aspect-ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* watch-page-content starts exactly below pinned video */
.watch-page-content {
  margin: 0 auto;
  max-width: 700px;
  background-color: #fff;
  padding-bottom: 80px; /* space for bottom sheets if needed */
  padding-left: 16px;
  padding-right: 16px;
  /* offset from pinned video: 56px header + (9/16)*vw */
  padding-top: calc(56px + (100vw * 0.5625));
}

/* VIDEO TITLE & INFO */
.video-title {
  font-size: 16px;
  margin-top: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.video-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
}
.stats-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #606060;
}
.dot-sep {
  margin: 0 2px;
}
.more-button {
  background: none;
  border: none;
  color: #065fd4;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

/* Condensed comments snippet */
.comments-preview {
  display: block;
  background: #f2f2f2;
  color: #000;
  padding: 12px;
  margin: 12px 0;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
}

/* UP NEXT (full width) */
.suggestions {
  margin-top: 16px;
}
.suggestions h2 {
  margin-bottom: 8px;
}
#suggested-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.suggested-video {
  display: block;
  border-bottom: 1px solid #ddd;
  margin-bottom: 16px;
  padding-bottom: 12px;
}
.suggested-thumb-wrapper {
  display: block;
  width: 100%;
  position: relative;
}
.suggested-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.suggested-info-wrapper {
  display: block;
  padding: 0 4px;
}
.suggested-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.suggested-title {
  font-size: 14px;
  font-weight: 500;
  color: #000;
  max-width: 90%;
}
.suggested-menu-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.three-dots-img,
.suggested-menu-btn img {
  width: 16px !important;
  height: 16px !important;
  object-fit: cover;
}
.suggested-channel-line {
  display: flex;
  align-items: center;
  margin-top: 4px;
}
.suggested-channel-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
}
.suggested-channel-name {
  font-size: 13px;
  color: #606060;
}
.suggested-meta {
  font-size: 13px;
  color: #606060;
  margin-top: 4px;
}

/* ============== BOTTOM SHEET BASE ============== */
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0; /* pinned at bottom */
  transform: translateY(100%); /* default: off-screen (hidden) */
  transition: transform 0.3s ease-in-out;
  height: 70%;
  background-color: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  display: none;
  flex-direction: column;
}
.bottom-sheet.open {
  display: flex;
  transform: translateY(0%);
}
/* The top “handle” bar */
.sheet-handle {
  width: 40px;
  height: 4px;
  background-color: #ccc;
  border-radius: 2px;
  margin: 8px auto;
}
/* The sheet header (title + close button) */
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  border-bottom: 1px solid #eee;
}
/* Close button (the "✕") */
.sheet-close {
  background: none;
  border: none;
  font-size: 22px;
  font-weight: 100;
  cursor: pointer;
  padding: 4px;
}
/* The main content inside the sheet (scrollable) */
.sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
}

/* DESCRIPTION SHEET */
#description-content .desc-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
}
.desc-channel-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.desc-channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
}
.desc-channel-name {
  font-size: 14px;
  font-weight: 500;
}
.desc-channel-subs {
  font-size: 12px;
  color: #606060;
}
.description-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #606060;
  margin-bottom: 8px;
}
.desc-text {
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}
.tag-chip {
  display: inline-block;
  background-color: #f2f2f2;
  color: #065fd4;
  padding: 4px 8px;
  margin: 0 4px 4px 0;
  border-radius: 12px;
  font-size: 12px;
}
.desc-tags {
  margin-bottom: 8px;
}

/* COMMENTS SHEET */
.comment-list {
  margin-top: 8px;
}
.comment {
  display: flex;
  margin-bottom: 16px;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 8px;
}
.comment-content {
  flex: 1;
}
.comment-author {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}
.comment-text {
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 4px;
}
.comment-likes {
  font-size: 12px;
  color: #606060;
}

/* ACTION BUTTONS (like/dislike/share/etc.) */
.action-buttons-row {
  display: flex;
  flex-wrap: nowrap;       /* no wrapping */
  overflow-x: auto;        /* horizontal scroll if needed */
  overflow-y: hidden;      /* hide any vertical scrollbar */
  white-space: nowrap;     /* items stay on one line */
  gap: 8px;
  margin: 12px 0;
  -webkit-overflow-scrolling: touch;
}
.action-box {
  background-color: #f2f2f2;
  border-radius: 9999px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.action-box:hover {
  background-color: #e2e2e2;
}
/* 75% smaller icons => ~15px high */
.action-icon {
  height: 15px;
  width: auto;
  object-fit: contain;
  margin-right: 4px;
}
/* 75% smaller text => ~11px */
.action-text {
  font-weight: bold;
  font-size: 11px;
}

/* Like/Dislike splitted bubble */
.like-dislike-box {
  position: relative;
  pointer-events: none; /* so halves can be clicked individually */
}
.like-dislike-split {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vertical-divider {
  width: 1px;
  height: 20px;
  background-color: #999;
}
.like-half, .dislike-half {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  pointer-events: auto; /* override parent's none */
}

/* DESCRIPTION SHEET Z-INDEX */
#description-sheet {
  z-index: 10001; /* Some number greater than 9999 so it’s above other elements */
}
