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

body {
  font-family: "Roboto", sans-serif;
  background-color: #0f0f0f;
  color: #f1f1f1;
  overflow-x: hidden;
}

/* ===== SCROLLBAR (modern, youtube-like) ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #212121;
}
::-webkit-scrollbar-thumb {
  background: #5a5a5a;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* ===== MAIN LAYOUT ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ----- HEADER / NAVBAR (YouTube style) ----- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  border-bottom: 1px solid #272727;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.menu-icon {
  font-size: 24px;
  cursor: pointer;
  color: #f1f1f1;
}
.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.logo i {
  font-size: 28px;
  color: #ff0000;
}
.logo span {
  color: white;
}
.yt {
  font-weight: 500;
}
.country-code {
  font-size: 10px;
  vertical-align: super;
  margin-left: 2px;
  color: #aaa;
}

.header-center {
  flex: 1;
  max-width: 600px;
  display: flex;
  align-items: center;
  margin: 0 20px;
}
.search-bar {
  flex: 1;
  background: #121212;
  border: 1px solid #303030;
  border-radius: 40px 0 0 40px;
  padding: 8px 16px;
  font-size: 16px;
  color: white;
  outline: none;
  font-family: inherit;
}
.search-bar:focus {
  border-color: #1c62b9;
}
.search-btn {
  background: #222222;
  border: 1px solid #303030;
  border-left: none;
  border-radius: 0 40px 40px 0;
  padding: 8px 20px;
  color: #f1f1f1;
  cursor: pointer;
  transition: 0.1s;
}
.search-btn:hover {
  background: #313131;
}
.voice-btn {
  background: #1f1f1f;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  cursor: pointer;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-right i {
  font-size: 22px;
  cursor: pointer;
}
.avatar {
  width: 32px;
  height: 32px;
  background-color: #4e4e6e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: #3f3f6b;
  cursor: pointer;
  overflow: hidden;
}

.avatar img {
  height: 100%;
}

/* ===== SIDEBAR + MAIN CONTENT (flex row) ===== */
.main-layout {
  display: flex;
  margin-top: 56px;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* SIDEBAR (collapsible style but always visible mini & full on hover?) 
       For simplicity: modern youtube style with fixed width */
.sidebar {
  width: 240px;
  background-color: #0f0f0f;
  overflow-y: auto;
  padding: 12px 0;
  transition: width 0.2s;
  flex-shrink: 0;
}
/* scroll inside sidebar */
.sidebar-nav {
  display: flex;
  flex-direction: column;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  margin: 2px 8px;
  cursor: pointer;
  transition: background 0.1s;
  color: #f1f1f1;
}
.nav-item i {
  font-size: 20px;
  width: 24px;
}
.nav-item:hover {
  background-color: #272727;
}
.active-nav {
  background-color: #272727;
  font-weight: 500;
}
.divider {
  height: 1px;
  background-color: #272727;
  margin: 12px 12px;
}
.sidebar-section-title {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 24px;
  color: #aaaaaa;
}

/* main content area (video grid) */
.content {
  flex: 1;
  overflow-y: auto;
  background-color: #0f0f0f;
  padding: 24px 32px;
}

/* chips row (categories) */
.chips-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 16px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}
.chip {
  background-color: #272727;
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.1s;
}
.chip.active {
  background-color: #fff;
  color: #0f0f0f;
}
.chip:hover {
  background-color: #3f3f3f;
}

/* VIDEO GRID (YouTube like) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px 20px;
}

.video-card {
  cursor: pointer;
  transition: transform 0.1s ease;
}
.video-card:hover {
  transform: scale(0.99);
}
.thumbnail {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #1a1a1a;
  aspect-ratio: 16 / 9;
}
.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.video-info {
  display: flex;
  margin-top: 12px;
  gap: 12px;
}
.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #3a3a4a;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  overflow: hidden;
}

.channel-avatar img {
  height: 100%;
}

.video-details h3 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.channel-name,
.meta-stats {
  font-size: 14px;
  color: #aaaaaa;
}
.meta-stats {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

/* responsive */
@media (max-width: 860px) {
  .sidebar {
    width: 72px;
  }
  .nav-item span:not(.nav-icon) {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
  }
  .nav-item i {
    margin: 0;
  }
  .sidebar-section-title,
  .divider {
    display: none;
  }
  .content {
    padding: 16px;
  }
}
@media (max-width: 660px) {
  .header-center {
    max-width: 280px;
  }
  .voice-btn {
    display: none;
  }
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 550px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* footer subtle */
.footer-note {
  text-align: center;
  margin-top: 48px;
  font-size: 12px;
  color: #606060;
  padding: 20px;
  border-top: 1px solid #272727;
}
