/* ── Pinned Messages popover ─────────────────────────────────────────
   Portal-rendered dropdown anchored to the ChannelHeader pin icon
   button. Shows the channel's pinned messages in reverse
   chronological order, same style as Discord / Fluxer. */

.overlay {
	position: fixed;
	inset: 0;
	z-index: var(--z-index-modal, 10000);
	pointer-events: none;
}

.popover {
	/* Scoped custom properties for this component's sizing
	   constants, so they live next to the component that uses them
	   instead of cluttering global.css. The track-size + thumb
	   formula follow Fluxer's auto-hide scroller pattern: an 8px
	   track with a 4px visible thumb (4px = 8px track - 2px border
	   on each side, drawn via background-clip: padding-box). The
	   scoped --scrollbar-thumb-bg override resets the global
	   color-mix value to the literal rgba Fluxer uses here. */
	--pins-popout-header-height: 68px;
	--scroller-track-size: 8px;
	--scrollbar-thumb-bg: rgba(121, 122, 124, 0.4);

	position: absolute;
	pointer-events: auto;
	background-color: var(--background-primary);
	border: 1px solid var(--background-header-secondary);
	border-radius: 12px;
	box-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.2),
		0 8px 24px -4px rgba(0, 0, 0, 0.45),
		0 20px 48px -8px rgba(0, 0, 0, 0.3);
	width: 480px;
	max-width: calc(100vw - 24px);
	max-height: min(calc(100vh - 120px), 720px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	min-height: var(--pins-popout-header-height);
	flex-shrink: 0;
	box-sizing: border-box;
}

.headerIcon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: var(--text-primary);
	flex-shrink: 0;
}

.title {
	font-weight: 600;
	font-size: 1rem;
	color: var(--text-primary);
	line-height: 1.25;
	margin: 0;
}

.body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 4px 0;

	/* Firefox — thin scrollbar, transparent thumb by default, track
	   transparent always. Flips to the real thumb color on hover. */
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
	transition: scrollbar-color 0.15s ease;
}

.body:hover {
	scrollbar-color: var(--scrollbar-thumb-bg) transparent;
}

/* WebKit — auto-hide scrollbar. Track stays transparent; thumb
   background is transparent by default so the bar is invisible,
   and fades in only on hover. The transparent border + padding-box
   background-clip collapses the visible thumb width to
   max(2px, track-size - 4px) — 4px visible thumb inside an 8px
   track. */
.body::-webkit-scrollbar {
	width: var(--scroller-track-size);
	height: var(--scroller-track-size);
}

.body::-webkit-scrollbar-track {
	background-color: transparent;
}

.body::-webkit-scrollbar-thumb {
	background-color: transparent;
	border: 2px solid transparent;
	border-radius: 999px;
	background-clip: padding-box;
	min-height: 40px;
	transition: background-color 0.15s ease;
}

.body:hover::-webkit-scrollbar-thumb {
	background-color: var(--scrollbar-thumb-bg);
}

.body::-webkit-scrollbar-corner {
	background-color: transparent;
}

/* Hide the up/down arrow buttons some platforms (notably macOS
   Chrome with "Show scroll arrows" enabled) render at the ends
   of the track. Fluxer and Discord both suppress these for a
   cleaner look. */
.body::-webkit-scrollbar-button {
	display: none;
	width: 0;
	height: 0;
}

.loading {
	padding: 16px 20px;
	text-align: center;
	font-size: 0.8125rem;
	color: var(--text-primary-muted);
}

/* Fluxer-style empty state — mirrors the ChannelDetailsDrawer pin
   empty state so mobile and desktop feel consistent. */
.empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 24px;
	text-align: center;
}

.emptyIcon {
	color: var(--text-primary-muted);
	margin-bottom: 4px;
}

.emptyTitle {
	font-size: 1rem;
	font-weight: 800;
	color: var(--text-primary);
}

.emptyBody {
	font-size: 0.8125rem;
	color: var(--text-primary-muted);
	line-height: 1.4;
	max-width: 280px;
}
