@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Open Sans", sans-serif;
}

:root {
  --white: #fff;
  --black: #000;
  --light-white-color:#f0f0f0;
  --light-gray: #e5e5e5;
  --border: #d4d4d4;
  --overlay-dark: rgba(0, 0, 0, 0.6);
  --primary-color:#3b82f6;
  --secondary-color:#404040;
  --white-color:#fff;
}

body.dark-mode{
  --white:#171717;
  --black: #d4d4d4;
  --light-white-color:#efeaea;
  --light-gray: #404040;
  --border: #737373;
  --secondary-color:#d4d4d4;
  --overlay-dark: rgba(0, 0, 0, 0.6);
}

body{
  background-color:var(--white);
}

body{
  overflow-y:hidden;
}


.container{
  display:flex;
  flex-direction:column;
  max-height:100vh;
  overflow-y:hidden;
}



header, .category-list{
  position:sticky;
  top:0;
  z-index:10;
  background:var(--white);
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.navbar i {
    font-size:1.5rem;
    color:var(--black);
}

.nav-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-center {
  flex: 1;
  max-width: 600px;
}

.search-form {
  display: flex;
  flex: 1;
  max-width: 550px;
  height: 40px;
}

.search-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 3rem 0 0 3rem;
  padding: 0.4rem 1rem;
  outline: none;
  font-size:0.9rem;
}

.search-button {
  border: 1px solid var(--border);
  border-left: none;
  background: var(--light-gray);
  border-radius: 0 3rem 3rem 0;
  padding: 0 1.25rem;
  cursor: pointer;
}

.nav-button {
  border: none;
  background: transparent;
  cursor: pointer;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-button:hover {
  background: var(--light-gray);
}

.logo-image {
  width: 120px;
}

.user-image {
  width: 34px;
  border-radius: 50%;
}

/* Layout */
.main-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.main-layout .sidebar {
  width: 280px;
  background: var(--white);
  flex-shrink: 0;
  transition: all 0.3s ease;
  border-right: 1px solid var(--border);
}

body.sidebar-hidden .sidebar {
  width: 0;
  padding: 0;
  overflow: hidden;
}

/* Sidebar links */
.link-container {
  padding: 1rem 0;
  overflow-y: auto;
  height: calc(100vh - 60px);
}

.sidebar .link-section .link-item {
  display: flex;
  align-items: center;
  font-size:0.938rem;
  white-space:nowrap;
  gap: 0.75rem;
  padding: 0.37rem 0.75rem;
  margin-bottom:0.25rem;
  text-decoration: none;
  color: var(--black);
  border-radius: 0.5rem;
}

.sidebar .link-section .link-item:hover{
  background:var(--light-gray);
}

.sidebar .link-section .link-item i{
  font-size:1.4rem;
  margin-right:0.63rem;
  margin-top:0.30rem;
}

.sidebar .link-section .section-title{
  font-size:0.938rem;
  font-weight:600;
  color:var(--black);
  padding-left:10px;
}

.sidebar .section-separator{
  height:1px;
  margin:0.625rem 0;
  background:var(--light-gray);
}

.main-layout{
  display:flex;
  overflow-y:auto;
}

.sidebar .link-container{
  overflow-y:auto;
  height:calc(100vh - 60px);
  scrollbar-width:thin;
  scrollbar-color:transparent transparent;
  padding:1rem 0 2rem;
}

.sidebar .link-container:hover{
  scrollbar-color:#a6a6a6 transparent;
}

/* Content */
.main-layout .content-wrapper {
  flex: 1;
  background: var(--white);
  overflow-x: hidden;
  padding-bottom: 2rem;
}

/* Category bar */
.category-list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}


.category-list::-webkit-scrollbar {
  display: none;
}

.category-button {
  border: none;
  background: var(--light-white-color);
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}

.category-button.active {
  background: var(--black);
  color: var(--white);
}

.category-list .category-button:hover{
  background-color:var(--light-gray);
}

/* Video grid */
.video-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.video-list .video-card{
  text-decoration:none;
}

.video-list .video-card .video-info{
  display:flex;
  gap:0.7rem;
  padding:0.7rem 0.5rem;
}

 .video-list .video-card .thumbnail-container {
  position: relative; 
}

.video-list .video-card .thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0.5rem;
}

.video-list .video-card .duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: var(--overlay-dark);
  color:var(--white-color);
  font-size: 0.875rem;
  padding: 0 0.3rem;
  border-radius: 0.3rem;
}

/* Video details */


.video-list .video-card .icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.video-list .video-card .title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
}

.video-details .title:hover {
  color:var(--primary-color);
}

.video-list .video-card p{
  font-size:0.875;
}

.video-list .video-card .channel-name{
  margin:0.25rem  0  0.15;
}

.channel-name,
.views {
  font-size: 0.9rem;
  color: gray;
}



/* =============================
   MEDIA QUERIES FOR RESPONSIVE
   ============================= */

/* Large Tablets and Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .main-layout .sidebar {
    width: 220px;
  }

  .video-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .nav-center {
    max-width: 450px;
  }

  .search-form {
    max-width: 400px;
  }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
  /* Sidebar collapses into overlay menu */
  .main-layout .sidebar {
    /* position: fixed;
    top: 60px;
    left: -280px;
    height: calc(100vh - 60px);
    width: 250px;
    z-index: 999;
    background: var(--white);
    transition: left 0.3s ease; */
  }

  body.show-sidebar .sidebar {
    left: 0;
  }

  .nav-left .menu-button {
    display: block;
  }

  .nav-center {
    display: none; /* hide search bar */
  }

  .nav-right {
    gap: 0.5rem;
  }

  .user-image {
    width: 30px;
  }

  .video-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    padding: 1rem;
  }

  .category-list {
    padding: 0.5rem;
  }
}

/* Mobile Devices (max-width: 576px) */
@media (max-width: 576px) {
  header {
    position: fixed;
    top: 0;
    width: 100%;
  }

  .main-layout {
    flex-direction: column;
    margin-top: 60px;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: -250px;
    width: 220px;
    height: calc(100vh - 60px);
    background: var(--white);
    z-index: 999;
    transition: all 0.3s ease;
  }


  body.show-sidebar .sidebar {
    left: 0;
  }

  .content-wrapper {
    padding: 0.5rem;
  }

  .video-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.8rem;
  }

  .video-list .video-card .title {
    font-size: 0.9rem;
  }

  .video-list .video-card .icon {
    width: 30px;
    height: 30px;
  }

  .category-list {
    gap: 0.4rem;
  }

  .category-button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .nav-right .theme-button {
    font-size:1.1rem;
  }

  .nav-left .logo-image {
    width: 90px;
  }
}

/* Extra Small Devices (max-width: 400px) */
@media (max-width: 400px) {
  .menu-button i {
    display:none;
  }

  .video-list {
    grid-template-columns: 1fr;
  }

  .nav-left .logo-image {
    width: 90px;
    margin-left:-3.5rem;
  }

  .video-list .video-card .title {
    font-size: 0.85rem;
  }

  .user-image {
    width: 29px;
  }
}



