/* Forum Light — Discourse-inspired styling on top of WoltLab CSS variables */

/* category badge (small, inside rows) */
.flCategoryBadge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: var(--wcfContentDimmedText);
}

.flCategoryBadge:hover {
	color: var(--wcfContentText);
	text-decoration: none;
}

/* color dots (palette derived from the category id) */
.flBadgeDot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 2px;
	flex-shrink: 0;
}

/* category sidebar box (Discourse-style) */
.flCategoryBoxList {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.flCategoryBoxItem a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 8px;
	border-radius: var(--wcfBorderRadius, 5px);
	color: var(--wcfSidebarText, var(--wcfContentText));
}

.flCategoryBoxItem a:hover {
	background-color: var(--wcfSidebarDimmedText, var(--wcfContentBorderInner));
	background-color: color-mix(in srgb, currentColor 8%, transparent);
	text-decoration: none;
}

.flCategoryBoxTitle {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.flCategoryBoxCount {
	font-size: 12px;
	color: var(--wcfSidebarDimmedText, var(--wcfContentDimmedText));
}

.flCategoryBoxLatest {
	margin-bottom: 6px;
	font-weight: 600;
}

.flCategoryBoxDepth1 a {
	padding-left: 24px;
}

.flCategoryBoxDepth2 a {
	padding-left: 40px;
}

/* topic list */
.flTopicList {
	border: 1px solid var(--wcfContentBorderInner);
	border-radius: var(--wcfBorderRadius, 5px);
	background-color: var(--wcfContentBackground);
	overflow: hidden;
}

.flTopicListHeader,
.flTopicRow {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) 150px 70px 70px 130px;
	gap: 8px;
	align-items: center;
	padding: 10px 16px;
}

.flColParticipants {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	flex-wrap: nowrap;
	overflow: hidden;
}

.flColParticipants .userAvatarImage {
	border-radius: 50%;
	width: 24px;
	height: 24px;
}

.flTopicListHeader {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--wcfContentDimmedText);
	border-bottom: 2px solid var(--wcfContentBorderInner);
	padding-top: 12px;
	padding-bottom: 8px;
}

.flTopicListHeader .flColTopic {
	grid-column: 1 / span 2;
}

.flTopicRow {
	border-bottom: 1px solid var(--wcfContentBorderInner);
}

.flTopicRow:last-child {
	border-bottom: 0;
}

.flTopicRow.flSticky {
	background-color: var(--wcfContentContainerBackground);
}

.flTopicRow.flDeleted .flTopicTitle a {
	text-decoration: line-through;
	opacity: 0.6;
}

.flTopicTitle {
	font-size: 16px;
	font-weight: 400;
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.flTopicTitle a {
	color: var(--wcfContentText);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.flTopicTitle a:hover {
	color: var(--wcfContentLinkActive);
	text-decoration: none;
}

.flTopicMeta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 2px;
	font-size: 12px;
	color: var(--wcfContentDimmedText);
}

.flColReplies,
.flColViews {
	text-align: center;
	font-size: 15px;
	color: var(--wcfContentDimmedText);
}

.flColActivity {
	text-align: right;
	font-size: 13px;
	color: var(--wcfContentDimmedText);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
}

.flLastPoster {
	font-size: 12px;
}

.flColAvatar .userAvatarImage,
.flPostAvatar .userAvatarImage {
	border-radius: 50%;
}

.flGuestAvatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background-color: var(--wcfContentContainerBackground);
	color: var(--wcfContentDimmedText);
}

/* post list (topic view) */
.flPostList {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.flPost {
	display: flex;
	gap: 16px;
	padding: 20px 0;
	border-bottom: 1px solid var(--wcfContentBorderInner);
}

.flPost.flDeleted {
	opacity: 0.65;
	background-color: var(--wcfContentContainerBackground);
}

.flPostAvatar {
	flex-shrink: 0;
	width: 48px;
}

.flPostContent {
	flex: 1;
	min-width: 0;
}

.flPostHeader {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 8px;
	gap: 8px;
}

.flPostAuthor {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.flOriginalPoster,
.flDeletedBadge {
	font-size: 11px;
	font-weight: 400;
	padding: 1px 8px;
	border-radius: 10px;
	background-color: var(--wcfContentContainerBackground);
	color: var(--wcfContentDimmedText);
}

.flDeletedBadge {
	background-color: rgba(204, 0, 1, 0.1);
	color: #c00;
}

.flPostMeta {
	font-size: 12px;
	color: var(--wcfContentDimmedText);
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.flPostMeta a {
	color: var(--wcfContentDimmedText);
}

.flPostMessage {
	overflow-wrap: break-word;
}

.flPostFooter {
	margin-top: 12px;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
}

.flPostActions {
	margin-left: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.flPostActions .inlineList {
	justify-content: flex-end;
}

/* unread markers */
.flUnreadDot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background-color: var(--wcfButtonPrimaryBackground);
	flex-shrink: 0;
}

.flTopicRow.flUnread .flTopicTitle a {
	font-weight: 600;
}

/* icon action row (vote, copy link, report) */
.flIconAction {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: 0;
	padding: 4px 6px;
	cursor: pointer;
	color: var(--wcfContentDimmedText);
	border-radius: var(--wcfBorderRadius, 5px);
	font-size: 13px;
	vertical-align: middle;
}

.flIconAction:hover {
	color: var(--wcfContentText);
	background-color: var(--wcfContentContainerBackground);
}

.flVoteButton.active {
	color: var(--wcfButtonPrimaryBackground);
}

.flVoteButton.flVoteDown.active {
	color: #c0392b;
}

.flVoteStatic {
	cursor: default;
}

.flVoteStatic:hover {
	color: var(--wcfContentDimmedText);
	background: none;
}

.flVoteCount:empty {
	display: none;
}

/* composer attachments */
.flComposerAttachments {
	margin-top: 12px;
}

/* infinite scroll sentinel */
.flScrollSentinel {
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.flScrollSentinel.active::after {
	content: "";
	width: 20px;
	height: 20px;
	border: 2px solid var(--wcfContentBorderInner);
	border-top-color: var(--wcfContentText);
	border-radius: 50%;
	animation: flSpin 0.8s linear infinite;
}

@keyframes flSpin {
	to { transform: rotate(360deg); }
}

/* reply references (Discourse-style) */
.flReplyRef {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 8px;
	border-radius: 12px;
	background-color: var(--wcfContentContainerBackground);
	color: var(--wcfContentDimmedText);
	font-size: 12px;
}

.flReplyRef:hover {
	color: var(--wcfContentText);
	text-decoration: none;
}

.flReplyRef img,
.flPostRepliesList img {
	border-radius: 50%;
	width: 20px;
	height: 20px;
}

.flPostRepliesBlock {
	flex: 1;
	min-width: 0;
	padding-top: 4px;
}

.flRepliesToggle {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	color: var(--wcfContentDimmedText);
}

.flRepliesToggle:hover {
	color: var(--wcfContentText);
	text-decoration: none;
}

.flRepliesToggle.open fa-icon {
	transform: rotate(180deg);
}

.flPostRepliesInline {
	margin-top: 8px;
	padding: 8px 0 4px 14px;
	border-left: 3px solid var(--wcfContentBorderInner);
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.flPostRepliesInline.loading {
	min-height: 32px;
	background: linear-gradient(90deg, transparent, var(--wcfContentContainerBackground), transparent);
	background-size: 200% 100%;
	animation: flLoadingShimmer 1s linear infinite;
}

@keyframes flLoadingShimmer {
	to { background-position: -200% 0; }
}

.flInlineReplyHeader {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
}

.flInlineReplyHeader img {
	border-radius: 50%;
	width: 24px;
	height: 24px;
}

.flInlineReplyTime {
	font-size: 12px;
	font-weight: 400;
	color: var(--wcfContentDimmedText);
}

.flInlineReplyMessage {
	margin-top: 4px;
	font-size: 14px;
	overflow-wrap: break-word;
}

.flPost.flHighlight {
	animation: flHighlightFade 2s ease-out;
}

@keyframes flHighlightFade {
	0%, 40% { background-color: color-mix(in srgb, var(--wcfButtonPrimaryBackground) 12%, transparent); }
	100% { background-color: transparent; }
}

/* docked composer (Discourse-style) */
.flComposerTrigger {
	margin-top: 30px;
	display: flex;
	justify-content: flex-end;
}

.flComposer {
	position: fixed;
	bottom: 0;
	left: 50%;
	transform: translate(-50%, 110%);
	width: min(96vw, 950px);
	z-index: 300;
	background-color: var(--wcfContentBackground);
	border: 1px solid var(--wcfContentBorderInner);
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.18);
	transition: transform 0.2s ease;
}

.flComposer.open {
	transform: translate(-50%, 0);
}

.flComposer.open.minimized {
	transform: translate(-50%, calc(100% - 42px));
}

.flComposerHeader {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 14px;
	background-color: var(--wcfButtonPrimaryBackground);
	color: var(--wcfButtonPrimaryText);
	border-radius: 9px 9px 0 0;
	cursor: default;
}

.flComposerHeader strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	flex: 1;
}

.flComposerAvatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}

.flComposerHeaderButtons {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.flComposerHeaderButtons button {
	background: none;
	border: 0;
	padding: 4px 6px;
	cursor: pointer;
	color: var(--wcfButtonPrimaryText);
	opacity: 0.85;
}

.flComposerHeaderButtons button:hover {
	opacity: 1;
}

.flComposer.minimized #flComposerMinimize fa-icon {
	transform: rotate(180deg);
}

.flComposerBody {
	padding: 12px 16px 14px;
	max-height: min(60vh, 520px);
	overflow-y: auto;
}

.flComposerBody .formSubmit {
	margin-top: 10px;
}

body.flComposerActive .pageFooter {
	margin-bottom: 60px;
}

/* responsive */
@media (max-width: 768px) {
	.flTopicListHeader {
		display: none;
	}

	.flTopicRow {
		grid-template-columns: 40px minmax(0, 1fr);
		grid-template-areas:
			"avatar topic"
			"avatar meta";
	}

	.flColAvatar {
		grid-area: avatar;
	}

	.flColTopic {
		grid-area: topic;
	}

	.flColParticipants,
	.flColReplies,
	.flColViews {
		display: none;
	}

	.flColActivity {
		grid-area: meta;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		gap: 8px;
	}

	.flTopicTitle a {
		white-space: normal;
	}

	.flPost {
		gap: 10px;
	}
}
