/* =========================
   SIDEBAR — LOCKED
   Stable layout contract.
   Do not refactor unless redesigning navigation.
   ========================= */

:root {
  --sidebar-width: 66px;
  --sidebar-bg: #101010;
  --sidebar-border: transparent;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --sidebar-active-bg: rgba(255, 255, 255, 0.12);
  --sidebar-indicator: #ffffff;
}

/* ===========================
   DESKTOP SIDEBAR
=========================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;

  width: var(--sidebar-width);
  height: 100vh;

  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 20px 0;
  gap: 24px;

  border-right: none;

  z-index: 20;
}

.sidebar-top,
.sidebar-middle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.sidebar-middle {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  
  width: 48px;
  height: 48px;
  
  background: none;
  
  color: #E6E6E6;
  transition: opacity 0.25s ease;
}

.logo-link:hover {
  opacity: 0.7;
}

.logo-svg {
  display: block;
  width: 43px;
  height: 43px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;

  background: none;
  border: none;
  cursor: pointer;

  opacity: 1;
  transition:
    opacity 0.15s ease;
}

.nav-icon-btn img {
  width: 26px;
  height: 26px;
  display: block;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.nav-icon-btn:hover {
  opacity: 0.6;
}

.nav-icon-btn.active {
  opacity: 1;
  background-color: var(--sidebar-active-bg);
  border-radius: 8px;
}

.nav-icon-btn  {
  fill: #fff;
}

/* ===========================
   MOBILE TOP NAVBAR
=========================== */

.mobile-navbar {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  
  height: 64px;
  
  background: var(--bg-base);
  
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.mobile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.25s ease;
}

.mobile-logo:hover {
  opacity: 0.7;
}

.mobile-logo-svg {
  display: block;
  width: 40px;
  height: 40px;
}

/* Mobile menu and search buttons (in navbar) */
.mobile-menu-btn,
.mobile-search-btn {
  display: none; /* Hidden on desktop */
  width: 44px;
  height: 44px;
  
  background: none; /* Remove background */
  border: none; /* Remove border */
  
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mobile-menu-btn:hover,
.mobile-search-btn:hover {
  opacity: 0.7;
}

.mobile-menu-btn:active,
.mobile-search-btn:active {
  opacity: 0.5;
}

.mobile-menu-btn img,
.mobile-search-btn img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Show navbar and buttons on mobile */
@media (max-width: 768px) {
  .mobile-navbar {
    display: flex;
  }
  
  .mobile-menu-btn,
  .mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Add top padding to content to account for fixed navbar */
  .content {
    padding-top: 64px;
  }
}

/* ===========================
   MOBILE SIDEBAR (separate from desktop)
=========================== */

.mobile-sidebar {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  
  background: var(--bg-base);
  
  z-index: 1000;
  
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  overflow-y: auto;
}

.mobile-sidebar.open {
  transform: translateX(0);
}

.mobile-sidebar-close {
  position: absolute;
  top: 20px;
  right: 20px;
  
  width: 40px;
  height: 40px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  background: none;
  border: none;
  
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mobile-sidebar-close:hover {
  opacity: 0.7;
}

.mobile-sidebar-close:active {
  opacity: 0.5;
}

.mobile-sidebar-close img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.mobile-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 80px 20px 20px 20px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 16px;
  
  padding: 14px 16px;
  
  background: none;
  border-radius: 10px;
  
  color: var(--text-primary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  
  transition: background 0.2s ease;
}

.mobile-nav-link:hover {
  background: var(--interactive-hover);
}

.mobile-nav-link.active {
  background: var(--interactive-active);
}

.mobile-nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.mobile-nav-icon path,
.mobile-nav-icon g {
  stroke: currentColor;
  fill: none;
}

/* Show mobile sidebar on mobile */
@media (max-width: 768px) {
  .mobile-sidebar {
    display: block;
  }
}

/* ===========================
   MOBILE NAVIGATION
========================= */

/* Backdrop overlay (mobile only) */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile styles - Hide desktop sidebar on mobile, show mobile sidebar instead */
@media (max-width: 768px) {
  .mobile-backdrop {
    display: block;
  }
  
  /* Hide desktop sidebar on mobile - mobile sidebar is used instead */
  .sidebar {
    display: none !important; /* !important to override default flex */
  }
  
  /* Content shifts when sidebar is hidden on mobile */
  .content {
    margin-left: 0 !important;
  }
}