@media (min-width: 993px) {
  .sidebar-list {
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #888 #222;
  }
  .sidebar-list::-webkit-scrollbar {
    width: 8px;
    background: #222;
  }
  .sidebar-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 2px solid #222;
  }
  .sidebar-list::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
}
/* Ensure sidebar toggle works on all devices */
.sidebar.sidebar-open {
  left: 0 !important;
}
/* Force hamburger always visible on all devices */
.hamburger {
  display: flex !important;
}
/* Sidebar open/close logic for all pages */
@media (max-width: 992px) {
  .sidebar {
    left: -260px;
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 3000;
  }
  .sidebar.sidebar-open {
    left: 0;
  }
  #sidebarBackdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 2999;
  }
  #sidebarBackdrop.active {
    display: block;
  }
}
/* Landscape phones/tablets (568px–800px) */
@media (min-width: 568px) and (max-width: 800px) {
  .navbar {
    height: 54px;
    --navbar-height: 54px;
    min-height: 54px;
    padding-top: 80px !important;
    padding-right: 8px;
    padding-bottom: 0;
    padding-left: 8px;
  }
  .nav-left {
    gap: 0.35rem;
    padding-left: 4px;
  }
  .nav-left > a {
    font-size: 0.78em;
    padding: 0 7px;
  }
  .hamburger {
    width: 32px;
    height: 32px;
    margin: 4px 4px;
  }
  .hamburger .bar {
    width: 20px;
    height: 3px;
    margin: 3px 0;
  }
  /* .sidebar width/top for this breakpoint is handled by main .sidebar rule */
  .sidebar-list {
    max-height: calc(100vh - 134px);
    overflow-y: auto;
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 10px 14px;
    font-size: 0.88em;
  }
}
/* GitHub icon for navbar search bar */
.github-icon-nav {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 50%;
  background: #fff;
    top: var(--header-height, 80px);
}
/* Prevent unwanted horizontal scrollbars */
html, body {
  overflow-x: hidden;
}
nav.navbar {
  position: fixed;
  top: 120px;
  left: 0;
  width: 100vw;
  z-index: 2000;
  display: flex !important;
}

.nav-menu {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 10px 27px rgba(0,0,0,0.3);
  z-index: 2450;
  padding: 0.5em 0;
}
.nav-menu.active {
  display: flex;
}
@media (max-width: 900px) {
  .nav-menu {
    display: none;
  }
  .nav-menu.active {
    display: flex;
  }
  .navbar {
    display: flex !important;
  }
  .navbar .nav-right > a {
    display: none !important;
  }
}
/* Search input with icon on right */
.search-input-wrapper {
  position: relative;
  display: inline-block;
}

#searchBar {
  padding-right: 2em;
      padding-top: 0 !important;}
      
#searchBar::placeholder {
  color: #888;
  font-size: 1em;
}
/* navbar.css: Styles for navbar and aside/sidebar */

/* Navbar styles */
.navbar {
  width: 100%;
  background: linear-gradient(90deg, #1e2024 0%, #011d4d 100%);
  color: #fff;
  display: flex;
  align-items: center;
      padding-top: 0 !important;
  justify-content: space-between;
  min-height: 56px;
  box-shadow: 0 2px 8px rgba(44,62,80,0.07);
  z-index: 1200;
  height: 60px;
  --navbar-height: 60px;
}


.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
      padding-top: 0 !important;
  padding-left: 25px;
}
.nav-left a {
  color: #fff;
  text-decoration: none;
  font-size: 1em;
  transition: color 0.2s;
  padding: 0 20px;

}
.nav-right {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  padding-right: 20px;

}
.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 1em;
  transition: color 0.2s;
}
.navbar a:hover {
  color: #ffd700;
  text-decoration: underline;
}
/* Hamburger icon styles - improved visibility and spacing */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: #fff;
  border-radius: 6px;
  border: 2px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 4px 8px 4px 8px;
}
.hamburger .bar {
  width: 24px;
  height: 4px;
  background-color: #7a3e1d;
  margin: 4px 0;
  border-radius: 5px;
  transition: background 0.2s;
}

#searchBar {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1em;
  margin-right: 0.5rem;
}


/* Sidebar styles */
.sidebar {
  position: fixed;
  top: calc(var(--header-height, 120px) + var(--navbar-height, 60px));
  left: -260px;
  width: 260px;
  height: calc(100vh - (var(--header-height, 120px) + var(--navbar-height, 60px)));
  background: #1a1a2e;
  color: #fff;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  overflow-y: hidden !important;
  scrollbar-width: auto;
  scrollbar-color: #888 #222;
  transition: left 0.3s cubic-bezier(.4,0,.2,1);
  z-index: 3000;
}

.sidebar-list {
  height: 100%;
  overflow-y: auto !important;
  scrollbar-width: auto;
  scrollbar-color: #888 #222;
}

/* Custom scrollbar for Webkit browsers */
.sidebar::-webkit-scrollbar, .sidebar-list::-webkit-scrollbar {
  width: 8px;
  background: #222;
}
.sidebar::-webkit-scrollbar-thumb, .sidebar-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 6px;
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: hidden !important;
  margin: 0;
  padding: 0;
  border-top: none;
}
.sidebar.active {
  transform: translateX(0);
  /* Do not hide overflow, always allow scroll */
}

/* Hide scrollbar for Webkit browsers when sidebar is active */
.sidebar.active::-webkit-scrollbar {
  display: none;
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-list li {
  margin: 0;
  padding: 0;
}
.sidebar-list .nav-link {
  display: block;
  padding: 12px 24px;
  color: #fff;
  text-decoration: none;
  font-size: 1em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s, color 0.2s;
  margin: 0;
}
.sidebar-list .nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #ffd700;
}

/* Ensure header and navbar set CSS variables for their heights */
.header-row {
  height: 120px;
  --header-height: 120px;
}
.navbar {
  height: 60px;
  --navbar-height: 60px;
}

/* Desktop Media Queries for Navbar and Sidebar */

/* Extra Large Desktop (min-width: 1921px) */
@media (min-width: 1921px) {
  .navbar {
    height: 70px;
    --navbar-height: 70px;
    padding: 0 50px;
  }
  .nav-left {
    gap: 2rem;
    padding-left: 40px;
  }
  .nav-left a {
    font-size: 1.2em;
    padding: 0 25px;
  }
  .nav-right {
    gap: 2rem;
    padding-right: 40px;
  }
  #searchBar {
    padding: 10px 16px;
    font-size: 1.1em;
    min-width: 350px;
  }
  .hamburger {
    width: 42px;
    height: 42px;
    display: flex;
  }
  .hamburger .bar {
    width: 28px;
    height: 5px;
  }
  /* .sidebar width/top for this breakpoint is handled by main .sidebar rule */
  .sidebar-list {
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 16px 32px;
    font-size: 1.1em;
    margin: 0;
  }
}

/* Large Desktop (1601px - 1920px) */
@media (min-width: 1601px) and (max-width: 1920px) {
  .navbar {
    height: 68px;
    --navbar-height: 68px;
    padding: 0 45px;
  }
  .nav-left {
    gap: 1.8rem;
    padding-left: 35px;
  }
  .nav-left a {
    font-size: 1.15em;
    padding: 0 22px;
  }
  .nav-right {
    gap: 1.8rem;
    padding-right: 35px;
  }
  #searchBar {
    padding: 9px 15px;
    font-size: 1.05em;
    min-width: 320px;
  }
  .hamburger {
    width: 40px;
    height: 40px;
    display: flex;
  }
  .hamburger .bar {
    width: 26px;
    height: 4.5px;
  }
  /* .sidebar width/top for this breakpoint is handled by main .sidebar rule */
  .sidebar-list {
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 15px 30px;
    font-size: 1.05em;
    margin: 0;
  }
}

/* Standard Desktop (1441px - 1600px) */
@media (min-width: 1441px) and (max-width: 1600px) {
  .navbar {
    height: 66px;
    --navbar-height: 66px;
    padding: 0 40px;
  }
  .nav-left {
    gap: 1.6rem;
    padding-left: 32px;
  }
  .nav-left a {
    font-size: 1.1em;
    padding: 0 21px;
  }
  .nav-right {
    gap: 1.6rem;
    padding-right: 32px;
  }
  #searchBar {
    padding: 8px 14px;
    font-size: 1.02em;
    min-width: 300px;
  }
  .hamburger {
    display: flex;
  }
  /* .sidebar width/top for this breakpoint is handled by main .sidebar rule */
  .sidebar-list {
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 14px 28px;
    font-size: 1.02em;
    margin: 0;
  }
}

/* Medium Desktop (1201px - 1440px) */
@media (min-width: 1201px) and (max-width: 1440px) {
  .navbar {
    height: 64px;
    --navbar-height: 64px;
    padding: 0 35px;
  }
  .nav-left {
    gap: 1.4rem;
    padding-left: 30px;
  }
  .nav-left a {
    font-size: 1.05em;
    padding: 0 20px;
  }
  .nav-right {
    gap: 1.4rem;
    padding-right: 30px;
  }
  #searchBar {
    padding: 7px 13px;
    font-size: 1em;
    min-width: 280px;
  }
  .hamburger {
    display: flex;
  }
  /* .sidebar width/top for this breakpoint is handled by main .sidebar rule */
  .sidebar-list {
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 13px 26px;
    font-size: 1em;
    margin: 0;
  }
}

/* Small Desktop/Large Tablet (993px - 1200px) */
@media (min-width: 993px) and (max-width: 1200px) {
  .navbar {
    height: 62px;
    --navbar-height: 62px;
    padding: 0 30px;
  }
  .nav-left {
    gap: 1.2rem;
    padding-left: 28px;
  }
  .nav-left a {
    font-size: 1em;
    padding: 0 18px;
  }
  .nav-right {
    gap: 1.2rem;
    padding-right: 28px;
  }
  #searchBar {
    padding: 6px 12px;
    font-size: 0.98em;
    min-width: 250px;
  }
  .hamburger {
    display: flex;
  }
  /* .sidebar width/top for this breakpoint is handled by main .sidebar rule */
  .sidebar-list {
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 12px 24px;
    font-size: 0.98em;
    margin: 0;
  }
}

/* Responsive styles for navbar and sidebar */
@media (max-width: 992px) {
  .navbar {
    flex-direction: row;
    min-height: 56px;
    justify-content: space-between;
    padding-top: 80px !important;
    padding-right: 12px;
    padding-bottom: 0;
    padding-left: 12px;
    flex-wrap: nowrap;
  }
  .nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0;
    flex-wrap: nowrap;
    flex: 1;
    overflow-x: auto;
  }
  .nav-left > a {
    display: inline-block !important;
    font-size: 0.85em;
    padding: 0 10px;
    white-space: nowrap;
  }
  .nav-right {
    display: none !important;
  }
  .hamburger {
    display: flex !important;
    margin: 4px 0;
    flex-shrink: 0;
  }
  .sidebar {
    width: 240px;
    top: calc(var(--header-height, 120px) + var(--navbar-height, 56px));
    margin: 0;
    padding: 0;
    left: -260px !important;
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 3000;
  }
  .sidebar.sidebar-open {
    left: 0 !important;
  }
  .sidebar-list {
    max-height: calc(100vh - 176px);
    overflow-y: auto !important;
    margin: 0;
    padding: 0;
  }
  .sidebar {
    overflow-y: auto !important;
  }
}

@media (max-width: 768px) {
  .navbar {
    height: 56px;
    --navbar-height: 56px;
    min-height: 56px;
    padding-top: 80px !important;
    padding-right: 8px;
    padding-bottom: 0;
    padding-left: 8px;
    margin-top: 0 !important;
    top: 0 !important;
  }
  .nav-left {
    gap: 0.3rem;
  }
  .nav-left > a {
    font-size: 0.8em;
    padding: 0 8px;
  }
  .sidebar {
    width: 220px;
    top: calc(var(--header-height, 80px) + var(--navbar-height, 56px));
    margin: 0;
    padding: 0;
  }
  .sidebar-list {
    max-height: calc(100vh - 136px);
    overflow-y: auto !important;
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 12px 20px;
    font-size: 0.95em;
  }
  .hamburger {
    width: 34px;
    height: 34px;
  }
  .hamburger .bar {
    width: 22px;
    height: 3.5px;
  }
}

@media (max-width: 600px) {
  .header-row {
    height: 80px;
    --header-height: 80px;
  }
  .navbar {
    height: 52px;
    --navbar-height: 52px;
    min-height: 52px;
    padding-top: 80px !important;
    padding-right: 6px;
    padding-bottom: 0;
    padding-left: 6px;
    margin-top: 0 !important;
    top: 0 !important;
  }
  .nav-left {
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-left::-webkit-scrollbar {
    display: none;
  }
  .nav-left > a {
    font-size: 0.75em;
    padding: 0 6px;
  }
  #searchBar {
    font-size: 0.9em;
    padding: 5px 10px;
    margin-right: 0.3rem;
  }
  .hamburger {
    width: 32px;
    height: 32px;
    margin: 4px 4px;
  }
  .hamburger .bar {
    width: 20px;
    height: 3px;
    margin: 3px 0;
  }
  .sidebar {
    width: 200px;
    top: calc(var(--header-height, 80px) + var(--navbar-height, 52px));
    margin: 0;
    padding: 0;
  }
  .sidebar-list {
    max-height: calc(100vh - 132px);
    overflow-y: auto !important;
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 10px 16px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  .navbar {
    height: 50px;
    --navbar-height: 50px;
    min-height: 50px;
    padding-top: 80px !important;
    padding-right: 4px;
    padding-bottom: 0;
    padding-left: 4px;
    margin-top: 0 !important;
    top: 0 !important;
  }
  .nav-left {
    gap: 0.2rem;
  }
  .nav-left > a {
    font-size: 0.7em;
    padding: 0 5px;
  }
  .hamburger {
    width: 30px;
    height: 30px;
    margin: 2px;
  }
  .hamburger .bar {
    width: 18px;
    height: 2.5px;
    margin: 2.5px 0;
  }
  .sidebar {
    width: 180px;
    top: calc(var(--header-height, 80px) + var(--navbar-height, 50px));
    margin: 0;
    padding: 0;
  }
  .sidebar-list {
    max-height: calc(100vh - 130px);
    margin: 0;
    padding: 0;
  }
  .sidebar-list .nav-link {
    padding: 8px 14px;
    font-size: 0.85em;
  }
}

@media (max-width: 360px) {
  .navbar {
    height: 48px;
    --navbar-height: 48px;
    min-height: 48px;
    padding-top: 80px !important;
    padding-right: 3px;
    padding-bottom: 0;
    padding-left: 3px;
    margin-top: 0 !important;
    top: 0 !important;
  }
  .nav-left {
    gap: 0.15rem;
  }
  .nav-left > a {
    font-size: 0.65em;
    padding: 0 4px;
  }
  .hamburger {
    width: 28px;
    height: 28px;
  }
  .hamburger .bar {
    width: 16px;
    height: 2px;
    margin: 2px 0;
  }
  .sidebar {
    width: 160px;
    top: calc(var(--header-height, 80px) + var(--navbar-height, 48px));
    margin: 0;
    padding: 0;
  }
  .sidebar-list {
    max-height: calc(100vh - 134px);
    overflow-y: auto !important;
    margin: 0;
    padding: 0;
  }
  .sidebar {
    overflow-y: auto !important;
    padding: 8px 12px;
    font-size: 0.8em;
  }
}