/**
 * Federation Manager — RP/OOC forum layout (Track A).
 * Scoped to .fedman-rp-* so non-RP forums are unaffected.
 */

/* Hide wpForo's native add-topic button on RP forums (CSS fallback to the JS). */
.fedman-rp-forum .wpf-head-bar-right { display: none !important; }

/* ---- A2/A3/A7 action bar (replaces the header-label row) ---- */
.fedman-rp-actionbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 10px 0;
	margin-bottom: 6px;
	background: transparent;
}
.fedman-rp-actionbar-right {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
/* Buttons: no background fill (outlined/plain), per design. */
.fedman-rp-create,
.fedman-rp-subscribe {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	white-space: nowrap;
	font-size: 14px;
}
.fedman-rp-create { font-weight: 700; }
.fedman-rp-create:hover,
.fedman-rp-subscribe:hover { opacity: .75; }
/* The relocated native wpForo search keeps its own styling. */
.fedman-rp-search-slot { display: inline-flex; align-items: center; }
.fedman-rp-subscribe-slot { display: inline-flex; align-items: center; }
.fedman-rp-subscribe-slot .wpf-feed { display: none; } /* no RSS in the action bar */

/* Native wpForo controls placed inside our action bar: strip the default fill so
   they match the no-background design. */
.fedman-rp-actionbar #add_wpftopic,
.fedman-rp-actionbar .add_wpftopic,
.fedman-rp-actionbar .wpf-button {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
	box-shadow: none;
	font-weight: 700;
}
.fedman-rp-subscribe-slot .wpf-subscribe-forum,
.fedman-rp-subscribe-slot .wpf-unsubscribe-forum,
.fedman-rp-subscribe-slot span { cursor: pointer; }

/* ---- A4 4-column row ---- */
.fedman-rp-thread {
	border-bottom: 1px solid #2c2c34;
}

/* ---- Unread highlight ----
   wpForo flags a row with `.wpf-unread-topic` (via wpforo_unread() in the row
   wrapper) when the logged-in user has unseen posts in that topic. Scoped under
   #wpforo #wpforo-wrap to outweigh base row rules without !important. */
#wpforo #wpforo-wrap .fedman-rp-thread.wpf-unread-topic {
	background: rgba(245, 179, 1, .07);
	box-shadow: inset 3px 0 0 #f5b301;
}
#wpforo #wpforo-wrap .fedman-rp-thread.wpf-unread-topic .fedman-rp-title-line a {
	font-weight: 800;
}
#wpforo #wpforo-wrap .fedman-rp-thread.wpf-unread-topic .fedman-rp-title-line::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 8px;
	border-radius: 50%;
	background: #f5b301;
	vertical-align: middle;
}
.fedman-rp-row {
	display: grid;
	grid-template-columns: 84px 1fr 120px 150px;
	align-items: center;
	gap: 14px;
	padding: 14px 10px;
}
/* Scoped under #wpforo #wpforo-wrap (+ img.avatar) to outweigh wpForo's
   own `#wpforo #wpforo-wrap img.avatar` base rule without !important. */
#wpforo #wpforo-wrap .fedman-rp-avatar img.avatar {
	border-radius: 50%;
	width: 70px;
	height: 70px;
	max-width: none;
	object-fit: cover;
}

/* ---- A5 title stack: title -> continues-from -> tags -> author ----
   Scoped under #wpforo #wpforo-wrap to outweigh wpForo's base link/title rules
   (e.g. `#wpforo #wpforo-wrap .wpfl-4 ... a {font-size:14px}`) without !important. */
#wpforo #wpforo-wrap .fedman-rp-title-line {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}
#wpforo #wpforo-wrap .fedman-rp-title-line a {
	font-size: 20px;
	line-height: 1.3;
	text-decoration: none;
}
#wpforo #wpforo-wrap .fedman-rp-posttype-badge {
	display: inline;
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
	margin-right: 6px;
	background: transparent;
	color: inherit;
	opacity: .7;
}
.fedman-rp-continues {
	font-size: 12px;
	color: #9aa0ad;
	margin-top: 3px;
	font-style: italic;
}
.fedman-rp-tags {
	margin-top: 5px;
	font-size: 12px;
}
.fedman-rp-author {
	margin-top: 4px;
	font-size: 12px;
	color: #9aa0ad;
}
.fedman-rp-author a { color: #ff3333; text-decoration: none; }

/* ---- A6 metrics + date ---- */
.fedman-rp-metrics {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 12px;
	color: #9aa0ad;
	text-align: center;
}
.fedman-rp-metric strong { color: #e6e6e6; }
/* D4 rating metric: star + average + vote count, sharing the metrics column look. */
.fedman-rp-rating-star { color: #f5b301; }
.fedman-rp-rating-count { opacity: .7; }
.fedman-rp-date {
	text-align: right;
	font-size: 12px;
	color: #9aa0ad;
}
.fedman-rp-date-rel {
	cursor: pointer;
	border-bottom: 1px dashed #555;
}
.fedman-rp-date-rel.fedman-rp-date-abs {
	border-bottom-style: solid;
	color: #cfcfcf;
}

/* ---- A11 Post Type field in the composer ---- */
.fedman-rp-posttype-field {
	margin: 10px 0;
}
.fedman-rp-posttype-field select {
	min-width: 180px;
	padding: 6px 8px;
}

/* RP composer: Post Type to the left of Post Title on the same row. Scoped under
   #wpforo so the flex children beat wpForo's `.wpf-field { width:100% }`. */
#wpforo #wpforo-wrap .fedman-rp-compose-row {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
	margin-bottom: 6px;
}
#wpforo #wpforo-wrap .fedman-rp-compose-row .fedman-rp-posttype-field {
	flex: 0 0 200px;
	margin: 0;
}
#wpforo #wpforo-wrap .fedman-rp-compose-row > .wpf-field:not(.fedman-rp-posttype-field) {
	flex: 1 1 260px;
	width: auto;
}

/* ---- A10/D5 autocomplete dropdown (tags + "Continued from") ----
   Light, high-contrast; scoped under #wpforo so the readable colors win over
   composer styles (the dark variant was unreadable in the light composer). */
#wpforo #wpforo-wrap .fedman-rp-ac-list {
	position: absolute;
	z-index: 9999;
	background: #ffffff;
	border: 1px solid #c9cdd6;
	border-radius: 6px;
	max-height: 220px;
	overflow-y: auto;
	min-width: 200px;
	box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
#wpforo #wpforo-wrap .fedman-rp-ac-item {
	padding: 7px 12px;
	cursor: pointer;
	color: #222;
	font-size: 13px;
}
#wpforo #wpforo-wrap .fedman-rp-ac-item:hover,
#wpforo #wpforo-wrap .fedman-rp-ac-item.active { background: #eef2ff; color: #111; }

/* ---- responsive ---- */
@media (max-width: 782px) {
	.fedman-rp-row {
		grid-template-columns: 48px 1fr;
		grid-template-areas:
			"avatar title"
			"meta   meta"
			"date   date";
	}
	.fedman-rp-avatar { grid-area: avatar; }
	.fedman-rp-title  { grid-area: title; }
	.fedman-rp-metrics {
		grid-area: meta;
		flex-direction: row;
		gap: 14px;
		text-align: left;
	}
	.fedman-rp-date { grid-area: date; text-align: left; }
	.fedman-rp-avatar img { width: 40px; height: 40px; }
}

/* ---- Track D (D4): RP topic rating widget (poo + 5 stars) ---- */
#wpforo #wpforo-wrap .fedman-rating {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 10px 0 4px;
	padding: 6px 0;
}
#wpforo #wpforo-wrap .fedman-rating-icons {
	display: inline-flex;
	gap: 5px;
}
#wpforo #wpforo-wrap .fedman-rating-icon {
	font-size: 20px;
	line-height: 1;
	color: #6b6b73;
	cursor: default;
	transition: color .12s ease, transform .12s ease;
}
#wpforo #wpforo-wrap .fedman-rating.is-interactive .fedman-rating-icon {
	cursor: pointer;
}
#wpforo #wpforo-wrap .fedman-rating.is-interactive .fedman-rating-icon:hover {
	transform: scale(1.12);
}
#wpforo #wpforo-wrap .fedman-rating-icon.is-on.fedman-rating-star {
	color: #f5b301;
}
#wpforo #wpforo-wrap .fedman-rating-icon.is-on.fedman-rating-poo {
	color: #8a5a2b;
}
#wpforo #wpforo-wrap .fedman-rating-agg {
	font-size: 13px;
	color: #9aa0ad;
}
#wpforo #wpforo-wrap .fedman-rating-avg {
	font-weight: 700;
	color: #e6e6e6;
}
#wpforo #wpforo-wrap .fedman-rating.is-saving {
	opacity: .6;
	pointer-events: none;
}

/* ---- Track D (D5): "Continued from" composer field ---- */
#wpforo #wpforo-wrap .fedman-cf-select { width: 100%; max-width: 100%; padding: 6px 8px; }

/* ---- Phase 9 (T052): wrestler @mention link ---- */
#wpforo #wpforo-wrap a.wnf-mention {
	font-weight: 600;
	color: #ff3333;
	text-decoration: none;
	background: rgba(255, 51, 51, .09);
	padding: 0 3px;
	border-radius: 3px;
}
#wpforo #wpforo-wrap a.wnf-mention:hover { text-decoration: underline; }

/* ---- Phase 9 (T052): @mention autocomplete dropdown (reuses the AC list look) ---- */
#wpforo #wpforo-wrap .fedman-mention-list {
	position: absolute;
	z-index: 100000;
}

/* ---- Phase 9 (T052 B): wrestler @mention. The trigger is the "@" TinyMCE toolbar
   button (tinymce-fedman-mention.js); clicking it slides the search panel out,
   anchored under the button. ---- */
/* Custom mention glyph (SVG injected into the toolbar button). */

#wpforo #wpforo-wrap .fedman-mention-toolbar-btn .fedman-mention-ico,
#wpforo #wpforo-wrap .mce-fedman-mention-toolbar-btn .fedman-mention-ico {
	display: block;
	width: 24px;
	height: 24px;
}
#wpforo #wpforo-wrap .fedman-mention-field { margin: 8px 0; }
#wpforo #wpforo-wrap .fedman-mention-wrap { position: relative; }
#wpforo #wpforo-wrap .fedman-mention-search {
	position: relative;
	margin-top: 6px;
	width: 280px;
	max-width: 90vw;
	padding: 8px;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
#wpforo #wpforo-wrap .fedman-mention-search::before {
	content: "@ Mention a wrestler";
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 600;
	opacity: .7;
}
#wpforo #wpforo-wrap .fedman-mention-input { width: 100%; padding: 6px 8px; box-sizing: border-box; }
#wpforo #wpforo-wrap .fedman-mention-results { left: 0; right: 0; }

/* ---- Phase 3 (013): the RP "Create a Post" submit button doubles as the word
   counter. Below the minimum (.fedman-sg-counting) it reads as a muted counter and
   submission is blocked; at/above (.fedman-sg-ready) it is the normal submit button.
   .fedman-sg-pop plays a one-shot scale pop on the below->ready transition. ---- */
#wpforo #wpforo-wrap input.wpf-button.fedman-submit-gate {
	transition: background-color .18s ease, color .18s ease, transform .12s ease;
}
#wpforo #wpforo-wrap input.wpf-button.fedman-sg-counting {
	background: #7a7f87;
	border-color: #7a7f87;
	color: #fff;
	cursor: default;
	opacity: .9;
}
#wpforo #wpforo-wrap input.wpf-button.fedman-sg-pop {
	animation: fedmanSgPop .36s ease;
}
@keyframes fedmanSgPop {
	0%   { transform: scale(1); }
	45%  { transform: scale(1.12); }
	100% { transform: scale(1); }
}

/* ---- Search & Tag results: two privacy-safe sections (no WP user exposed).
   Section 1 = matching wrestler profiles (name links only); Section 2 = posts
   created by/containing the term, attributed to the post-time wrestler. ---- */
.fedman-search-section { margin: 22px 0; }
.fedman-search-heading {
	margin: 0 0 10px;
	padding-bottom: 6px;
	border-bottom: 2px solid #f5b301;
	font-size: 18px;
}
.fedman-search-wrestler-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 10px;
}
.fedman-search-wrestler-list li { margin: 0; }
.fedman-search-wrestler-list li a {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 8px 18px 8px 8px;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	background: #fafafb;
	text-decoration: none;
}
.fedman-search-wrestler-list li a:hover {
	border-color: #f5b301;
	background: rgba(245,179,1,.08);
}
.fedman-search-wrestler-list li a img {
	width: 70px;
	height: 70px;
	border-radius: 6px;
	object-fit: cover;
	display: block;
	flex: 0 0 auto;
}
.fedman-search-wrestler-name {
	font-weight: 600;
	font-size: 20px;
	line-height: 1.2;
}
.fedman-search-posts .wpf-shead-author,
.fedman-search-posts .wpf-spost-author { width: 16%; }
.fedman-search-posts .wpf-shead-fed,
.fedman-search-posts .wpf-spost-fed { width: 10%; }
.fedman-search-posts .wpf-shead-board,
.fedman-search-posts .wpf-spost-board { width: 8%; }
.fedman-search-posts .wpf-shead-activity,
.fedman-search-posts .wpf-spost-activity { width: 8%; white-space: nowrap; }
.fedman-search-posts .wpf-shead-date,
.fedman-search-posts .wpf-spost-date { width: 16%; white-space: nowrap; }

/* Sortable column headers */
.fedman-search-posts td.fedman-sortable { cursor: pointer; }
.fedman-search-posts td.fedman-sortable a { text-decoration: none; white-space: nowrap; }
.fedman-search-posts td.fedman-sorted a { font-weight: 700; }
.fedman-search-posts .fedman-sort-arrow { font-size: 10px; }

/* RP / OOC board badge */
.fedman-board-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .3px;
	line-height: 1.6;
}
.fedman-board-rp  { background: rgba(245,179,1,.16); color: #8a6400; }
.fedman-board-ooc { background: rgba(91,185,220,.18); color: #1c6b85; }
