body {
  margin: 0;
  font-family: Roboto, Arial, sans-serif;
  background-color: #f9f9f9;
}

/* Top Nav */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
  fill: #000;
}

/* Logo styles */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 60px;   /* same as YouTube’s */
  width: auto;
}

.search {
  flex: 1;
  max-width: 600px;
  margin: 0 40px;
  display: flex;
  align-items: center;
  height: 40px;
  /* make search bar height consistent */
}

.search input {
  flex: 1;
  padding: 0 12px;
  /* remove vertical padding */
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 40px 0 0 40px;
  font-size: 16px;
  outline: none;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  height: 100%;
  /* match container height */
}

.search button {
  width: 64px;
  border: 1px solid #ccc;
  border-radius: 0 40px 40px 0;
  background: #f8f8f8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  /* match input height */
}

.search button:hover {
  background: #f0f0f0;
}

.search button svg {
  width: 20px;
  /* smaller than before */
  height: 20px;
  fill: #606060;
}

.user-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.user-actions svg {
  width: 24px;
  height: 24px;
  fill: #606060;
  cursor: pointer;
}

.profile {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

/* Responsive Search Bar for Mobile */
@media (max-width: 480px) {
  .search {
    flex: none;
    width: auto;
    margin: 0 10px;
    position: relative;
  }
  .search input {
    display: none;
    position: absolute;
    top: 40px; /* Below topbar */
    left: 0;
    width: 200px;
    max-width: 80vw;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: display 0.3s, opacity 0.3s;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
  }
  .search input.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .search button {
    width: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 1px solid #ccc;
    border-left: none;
    background: #f8f8f8;
  }
}

/* Sidebar - compact style */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 72px;
  /* compact width */
  background: #fff;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 999;
  padding-top: 10px;
}

.sidebar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  text-decoration: none;
  color: #333;
  font-size: 11px;
}

.sidebar a .icon {
  font-size: 20px;
  margin-bottom: 6px;
  color: #606060;
}

/* Scroll arrows */
.scroll-btn {
  background: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #606060;
  font-size: 20px;
  position: absolute;
  top: 0;
  z-index: 1000;
}

.scroll-btn.left {
  left: 0;
}

.scroll-btn.right {
  right: 0;
}

.scroll-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Expandable drawer (big nav) */
/* Drawer */
.drawer {
  position: fixed;
  top: 56px;
  /* below topbar */
  left: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid #ddd;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 2000;
  overflow-y: auto;
  padding-top: 10px;
}

.drawer.active {
  transform: translateX(0);
}

.drawer a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

.drawer a:hover {
  background: #f2f2f2;
}

/* Content shifts when drawer is open */
.content {
  margin-top: 10px;
  /* only accounts for topbar */
}

.content.shifted {
  margin-left: 240px;
  /* match drawer width */
}

/* Hide overlay if we are pushing instead */
.overlay {
  display: none;
}

/* Categories row wrapper */
.categories-wrapper {
  position: sticky;
  top: 56px;
  left: 72px;
  /* offset for small sidebar */
  right: 0;
  height: 48px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  z-index: 900;
  overflow-x: hidden;
  /* ✅ keeps scroll arrows working but doesn’t hide chips */
}

.categories {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  white-space: nowrap;
  flex: 1;
  padding: 0 80px;
  /* remove left padding */
  scrollbar-width: none;
}

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

.chip {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 16px;
  background: #f2f2f2;
  cursor: pointer;
  flex-shrink: 0;
}

.chip.active {
  background: #000;
  color: #fff;
}
/* Scroll arrows - prevent overlap on chips */
.scroll-btn {
  background: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #606060;
  font-size: 20px;
  position: absolute;
  top: 0;
  z-index: 1000;
  transition: background 0.2s;
  box-shadow: 0 0 10px rgba(0,0,0,0.03); /* subtle shadow */
  pointer-events: auto;
}

.scroll-btn.left {
  left: 0;
}

.scroll-btn.right {
  right: 0;
}

.scroll-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Scroll arrows - prevent overlap on chips */
.scroll-btn {
  background: #fff;
  border: none;
  outline: none;
  cursor: pointer;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #606060;
  font-size: 20px;
  position: absolute;
  top: 0;
  z-index: 1000;
  transition: background 0.2s;
  box-shadow: 0 0 10px rgba(0,0,0,0.03); /* subtle shadow */
  pointer-events: auto;
}

.scroll-btn.left {
  left: 0;
}

.scroll-btn.right {
  right: 0;
}

.scroll-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Default content layout (below only the topbar) */
.content {
  margin-top: 10px;
  /* just the topbar height */
  margin-left: 72px;
  /* account for compact sidebar */
  padding: 16px;
}

/* When categories bar is present */
.categories-wrapper + .content {
  margin-top: 10px;
  /* 10px topbar + 48px categories */
  padding-top: 0;
  /* remove extra gap */
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.video-card {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 🔥 Fix black bars */
.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  /* enforce 16:9 ratio */
  overflow: hidden;
  border-radius: 12px;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* crop instead of showing black padding */
  display: block;
}

.duration,
.live-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

.duration {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

.live-badge {
  background: red;
  color: #fff;
  font-weight: bold;
}

.video-info {
  display: flex;
  margin-top: 8px;
  gap: 12px;
}

.channel-icon img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.video-text {
  flex: 1;
}

.video-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
  color: #000;
}

.video-meta {
  font-size: 12px;
  color: #606060;
}

.sponsored {
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 12px;
  background: #fff8f0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .categories-wrapper {
    left: 0;
  }
  .content {
    margin-left: 0;
  }
  .search {
    max-width: 100%;
    margin: 0 10px;
  }
}

/* 🎤 Voice Search Button (outside search bar) */
.voice-btn {
  background: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.voice-btn:hover {
  background: #eee;
}

/* 🎤 Voice Search Button */
.search #voiceBtn {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-left: none;
  background: #f8f8f8;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  font-size: 16px;
}

/* ➕ Create Dropdown */
.create-dropdown {
  position: relative;
}

#createBtn {
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 36px;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  min-width: 160px;
  z-index: 2000;
}

.dropdown-menu a {
  padding: 10px 14px;
  text-decoration: none;
  color: #000;
  font-size: 14px;
  display: block;
}

.dropdown-menu a:hover {
  background: #f2f2f2;
}


/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
  position: fixed;        /* stays in place even when scrolling */
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid #ddd;
  display: none;          /* hidden on desktop; revealed via media query */
  justify-content: space-around;
  align-items: center;
  z-index: 9999;          /* keep it above everything */
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  /* prevent page content from hiding behind the nav */
  body {
    padding-bottom: 56px;  /* equal to nav height */
  }
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mobile-bottom-nav .icon {
  font-size: 22px;
  line-height: 1;
}

.mobile-bottom-nav .center-btn .icon {
  font-size: 28px;
  background: gray;          /* YouTube-style red circle */
  color: #fff;
  border-radius: 50%;
  padding: 8px 12px;
  margin-top: -16px;        /* make it pop up slightly */
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  /* Give bottom space to page content so nav doesn’t cover it */
  body {
    padding-bottom: 56px;
  }
}


/* ===== Reset any conflicting styles earlier ===== */
.shorts-section {
  width: 90vw;
  max-width: none;
  margin: 32px 0;
  box-sizing: border-box;
}

.shorts-heading {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

/* The grid: horizontal layout on desktop */
.shorts-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 16px;
  width: 100%;
}

/* Tablet / medium screens: reduce columns */
@media (max-width: 1024px) {
  .shorts-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Mobile: 2 columns, hide 5th and further until “Show more” */
@media (max-width: 768px) {
  .shorts-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .shorts-grid .short-card:nth-child(n + 5) {
    display: none !important;
  }
}

.short-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.short-card iframe {
  width: 100%;
  aspect-ratio: 9 / 16;
  border: none;
  display: block;
}

.short-info {
  padding: 8px 12px;
}

.short-title {
  font-size: 14px;
  margin: 0 0 4px;
}

.short-views {
  font-size: 12px;
  color: #666;
}

/* Show More button styling */
.show-more-btn {
  display: block;
  margin: 16px auto 0;
  padding: 10px 20px;
  background: #e41e26;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
}



