/* The top bar (list_view's title, menu button and "+" tag bar) and the
   drawer (main_menu) -- drawer.js, track-list.js's renderFeedHeader. */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  padding: 1rem 0;
  background: var(--bg);
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
}

/* Matches .container's max-width/padding exactly, so the hamburger and tag
   bubble line up with the list items' edges instead of the viewport's. */
.topbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.topbar-titles {
  text-align: center;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
}

.topbar-titles:hover {
  background: rgba(var(--fg-rgb), 0.08);
}

.app-title {
  font-size: 1.2rem;
  margin: 0;
}

#feed-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.15rem 0 0;
}

.icon-button {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

#menu-toggle {
  position: absolute;
  left: 1rem;
}

#drawer-close {
  font-size: 1.6rem;
}

.icon-button:hover {
  background: rgba(var(--fg-rgb), 0.08);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.tag-bar {
  position: absolute;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer-backdrop);
  background: rgba(0,0,0,0.5);
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  width: 280px;
  max-width: 84vw;
  background: var(--card-bg);
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.2s ease;
}

/* Slid off-screen rather than display: none, so it animates. */
.drawer.hidden {
  transform: translateX(-100%);
  visibility: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.08);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.drawer-brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex: none;
}

.drawer-brand-name {
  font-size: 0.95rem;
}

.drawer-section-label {
  margin: 0.9rem 1.2rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.feed-list {
  overflow-y: auto;
  padding: 0.6rem;
}

.drawer-divider {
  border: none;
  border-top: 1px solid rgba(var(--fg-rgb), 0.08);
  margin: 0;
}

.drawer-footer {
  padding: 0.6rem;
}

.feed-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
}

.feed-item:hover {
  background: rgba(var(--fg-rgb), 0.06);
}

.feed-item.active {
  background: var(--accent);
  color: var(--on-accent);
}

.feed-item-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.feed-item.active .feed-item-count {
  color: var(--on-accent);
  opacity: 0.8;
}

@media (max-width: 480px) {
  .topbar-inner { padding: 0 0.8rem; }
  #menu-toggle { left: 0.8rem; }
  .tag-bar { right: 0.8rem; }
  .app-title { font-size: 1.05rem; }
}
