/* ── What's Happening Sidebar ─────────────────────────────── */

/* Two-column layout wrapper for pages that carry the sidebar */
.sidebar-page {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}
.sidebar-page .sidebar-main {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar shell ──────────────────────────────────────────── */
.sidebar-widget {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  max-height: calc(100vh - var(--nav-height) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-widget::-webkit-scrollbar { width: 4px; }
.sidebar-widget::-webkit-scrollbar-track { background: transparent; }
.sidebar-widget::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Header ─────────────────────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 3px 5px;
  border-radius: var(--r);
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}
.sidebar-icon-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

/* ── Staff indicator ────────────────────────────────────────── */
.sidebar-staff-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent-2);
  opacity: .6;
  border: 1px solid currentColor;
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 10px;
}

/* ── Sections ───────────────────────────────────────────────── */
.sidebar-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-section-title svg { flex-shrink: 0; opacity: .8; }

/* ── Event rows ─────────────────────────────────────────────── */
.sidebar-event {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-event:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-event:first-child { padding-top: 0; }
.sidebar-event-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-event-meta {
  font-size: 11px;
  color: var(--text-3);
}
.sidebar-event-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: .04em;
}
.sidebar-event-live::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: sidebar-pulse 1.6s ease-in-out infinite;
}
@keyframes sidebar-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.8); }
}

/* ── Forum rows ─────────────────────────────────────────────── */
.sidebar-thread {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-thread:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-thread:first-child { padding-top: 0; }
.sidebar-thread-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.sidebar-thread-title:hover { color: var(--accent-2); }
.sidebar-thread-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

/* ── Marketplace rows ───────────────────────────────────────── */
.sidebar-listing {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-listing:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-listing:first-child { padding-top: 0; }
.sidebar-listing-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-listing-meta { font-size: 11px; color: var(--text-3); }

/* ── LFG / Online single-line blocks ────────────────────────── */
.sidebar-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-stat-label { font-size: 13px; color: var(--text-2); }
.sidebar-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
}
.sidebar-browse-link {
  font-size: 11px;
  color: var(--accent-2);
  text-decoration: none;
  opacity: .8;
}
.sidebar-browse-link:hover { opacity: 1; text-decoration: underline; }

/* ── Footer: refresh + timestamp ────────────────────────────── */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 6px;
}
.sidebar-timestamp {
  font-size: 10px;
  color: var(--text-3);
}

/* ── Empty section states ───────────────────────────────────── */
.sidebar-empty {
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
}

/* ── Globally hidden staff notice ───────────────────────────── */
.sidebar-hidden-notice {
  background: var(--bg-2);
  border: 1px dashed var(--border-2, var(--border));
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

/* ── Override inner wrap classes when inside sidebar layout ─── */
/* Removes the standalone max-width / auto-margin so sidebar-page controls layout */
.sidebar-page .forum-wrap,
.sidebar-page .market-wrap,
.sidebar-page .guilds-wrap,
.sidebar-page .page-wrap,
.sidebar-page .events-wrap,
.sidebar-page .lfg-wrap {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* ── Restore button (appears when user has hidden the sidebar) ── */
.sidebar-restore-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--r) 0 0 var(--r);
  padding: 12px 8px;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
  box-shadow: -2px 0 8px rgba(0,0,0,.15);
}
.sidebar-restore-btn:hover {
  color: var(--accent-2);
  background: var(--bg-3);
}

/* ── Responsive: collapse sidebar below 900px ───────────────── */
@media (max-width: 900px) {
  .sidebar-page { flex-direction: column; }
  .sidebar-widget {
    width: 100%;
    position: static;
    max-height: none;
    order: -1;
  }
}
