/**
 * Top Stats Extension CSS - Optimized
 * Organized by component for better maintainability
 */

/* ============================================
   RECENT ACTIVE TICKER
   ============================================ */
#vertical-ticker {
	position: relative;
	height: 126px;
	overflow: hidden;
}

#vertical-ticker li {
	display: block;
	height: auto;
}

/* Prevent scroll anchoring during animation */
#vertical-ticker,
#vertical-ticker li,
#vertical-ticker .row-item {
	overflow-anchor: none;
}

.tsticker {
	position: absolute;
	top: 2px;
	right: 20px;
}

i.tsportalfa {
	color: #fff;
	padding-left: 2px;
	font-size: 20px;
	line-height: 18px;
	font-weight: 100;
}

div.ellipsis {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

dl.starimg {
	position: relative;
	background-repeat: no-repeat;
}

dl.starimg::before {
	position: absolute;
	font-family: 'FontAwesome';
	font-size: 30px;
	content: "\f0e6";
	color: #0076b1;
	left: 12px;
}

/* ============================================
   TOP STATS BLOCKS
   ============================================ */
.container {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -2px;
}

.stat-block {
	flex: 1 1 50%;
	box-sizing: border-box;
	min-width: 300px;
	padding: 0 2px;
}

/* Full width for odd last child */
.container .stat-block:nth-last-child(1):nth-child(odd) {
	flex: 1 1 100%;
}

.stat-block .topiclist dl dd {
	border: none !important;
}

.stat-block .forabg .topiclist .header dd .stats_info {
	padding-right: 0 !important;
	font-size: 1em;
}

.stat-block .forabg .topiclist .header dt {
	padding-left: 0 !important;
}

.stat-block .topiclist.forums li.row dt {
	min-height: 18px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

a.stats_topic_title {
	font-size: 1.1em;
	padding-left: 6px;
	font-weight: bold;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 75%;
	width: fit-content;
}

span.stats_name {
	padding-left: 6px;
	font-size: 1.1em;
	font-weight: bold;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 80%;
}

span.stats_name a {
	display: inline-block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 80%;
}

span.stats_author {
	padding-left: 10px;
}

span.stats_info,
span.stats_infos-off,
span.stats_date-off {
	font-size: 1.1em;
	position: absolute;
	padding-right: 6px;
	right: 0;
}

.stat-block .topiclist.forums li.row dd > span {
	font-size: 1.2em !important;
	line-height: 1;
}

/* ============================================
   TOP POSTERS PAGE
   ============================================ */
h2.tp-head {
	text-align: center;
	font-size: 2.5em;
	text-transform: none;
	padding-bottom: 20px;
	letter-spacing: 1px;
}

h2.tp-head i {
	color: #ffd900;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
	transform: scale(1.3);
	margin: 0 4px;
}

.top-posters-section {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 12px;
	padding: 10px;
	margin: 14px auto;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* Podium Row */
.top-posters.podium-row {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	gap: 0;
	margin: 30px 0;
}

/* Rest Row (4th place and beyond) */
.top-posters.rest-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 15px 25px;
	margin: 20px 0 10px;
	border-top: 1px solid #eee;
	padding-top: 20px;
}

/* Poster Card Base */
.top-poster {
	text-align: center;
	color: #333;
	position: relative;
}

/* Avatar Styles */
.top-poster .avatar img {
	border-radius: 50%;
	border: 4px solid #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	width: 100px;
	height: 100px;
	object-fit: cover;
}

.top-poster.rest .avatar img {
	width: 40px;
	height: 40px;
	border: 3px solid #ddd;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Rest Poster Cards (4+) */
.top-poster.rest {
	background: #fafafa;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 6px 12px;
	min-width: 80px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.top-poster.rest:hover {
	transform: translateY(-3px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Username Styles */
.top-poster .username,
.top-poster .username-coloured {
	display: block;
	margin-top: 8px;
	font-size: 1.3em;
	line-height: 1.4;
}

.top-poster.rest .username,
.top-poster.rest .username-coloured {
	font-size: 1.1em;
	line-height: 1.2;
}

/* Stats Display */
.top-poster .stats {
	font-size: 1em;
	color: #666;
}

.top-poster.rest .rank {
	margin-top: 6px;
	font-size: 0.9em;
	font-weight: bold;
	color: #999;
}

/* Podium Base */
.podium {
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: bold;
	margin-top: 10px;
	padding: 0;
	color: #fff;
	min-width: 200px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
	position: relative;
	overflow: hidden;
}

/* Gold Podium (1st) */
.podium.gold {
	height: 140px;
	border-radius: 8px 8px 0 0;
	border: 1px solid #ccc;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
	z-index: 2;
}

/* Silver Podium (2nd) */
.podium.silver {
	height: 110px;
	border-radius: 8px 0 0 8px;
	border: 1px solid #ccc;
	border-right: none;
	box-shadow: -3px 0 6px rgba(0, 0, 0, 0.3);
	z-index: 1;
}

/* Bronze Podium (3rd) */
.podium.bronze {
	height: 80px;
	border-radius: 0 8px 8px 0;
	border: 1px solid #ccc;
	border-left: none;
	box-shadow: 3px 0 6px rgba(0, 0, 0, 0.3);
	z-index: 1;
}

/* Podium Numbers */
.podium-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-weight: 900;
	color: #d9d9d9;
}

.podium.gold .podium-number {
	font-size: 60px;
}

.podium.silver .podium-number {
	font-size: 50px;
}

.podium.bronze .podium-number {
	font-size: 40px;
}

/* ============================================
   MONTH PICKER
   ============================================ */
.month-picker-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 10px;
	height: 30px;
}

.month-nav {
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1.1em;
	line-height: 1.3;
	text-decoration: none;
	color: #333;
	background: #f8f8f8;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.month-nav:hover {
	background: #f0f0f0;
}

.month-nav.disabled {
	opacity: 0.4;
	pointer-events: none;
	border-style: dashed;
}

.month-select {
	padding: 6px 36px 6px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 1.1em;
	color: #333;
	background: #f8f8f8;
	line-height: 1.3;
	cursor: pointer;
}

.month-select:hover {
	background: #f0f0f0;
	text-decoration: none;
}

.month-select:focus {
	outline: none;
	border-color: #bbb;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.month-select::-ms-expand {
	display: none;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
p.no-topposter {
	text-align: center;
	font-size: 14px;
	line-height: 48px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 700px) {
	/* Stats Blocks */
	.stat-block {
		flex: 1 1 100%;
	}

	.stat-block ul.topiclist li.header dt {
		text-align: left;
		width: 50%;
	}

	.stat-block ul.topiclist li.header dd,
	.stat-block ul.topiclist dd {
		display: block !important;
		line-height: 1.2em;
		width: 50%;
	}

	/* Top Posters */
	h2.tp-head {
		font-size: 2em;
	}

	.top-posters.podium-row {
		gap: 0;
	}

	.top-poster .avatar img {
		width: 70px;
		height: 70px;
	}

	.top-poster.rest .avatar img {
		width: 50px;
		height: 50px;
	}

	.top-poster.rest {
		min-width: 70px;
	}

	.top-posters.rest-row {
		gap: 10px;
	}

	.podium {
		min-width: 120px;
	}
}

@media (max-width: 600px) {
	.podium {
		min-width: 100px;
	}

	.top-poster .username,
	.top-poster .username-coloured {
		font-size: 1.1em;
		line-height: 1.2;
	}

	h2.tp-head {
		font-size: 1.5em !important;
	}
}

/* ============================================
   DARK MODE
   ============================================ */
html.phpbb-dark-mode .top-posters-section {
	background: #0f141a;
	border-color: #2a3240;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
	color: #e5e7eb;
}

html.phpbb-dark-mode h2.tp-head {
	color: #f3f4f6;
}

html.phpbb-dark-mode h2.tp-head i {
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

html.phpbb-dark-mode .top-posters.rest-row {
	border-top-color: #2a3240;
}

html.phpbb-dark-mode .top-poster {
	color: #e5e7eb;
}

html.phpbb-dark-mode .top-poster .stats {
	color: #cbd5e1;
}

html.phpbb-dark-mode .top-poster.rest .rank {
	color: #94a3b8;
}

html.phpbb-dark-mode .top-poster.rest {
	background: #111827;
	border-color: #334155;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

html.phpbb-dark-mode .top-poster.rest:hover {
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

html.phpbb-dark-mode .top-poster .avatar img {
	border-color: #0f141a;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

html.phpbb-dark-mode .top-poster.rest .avatar img {
	border-color: #334155;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

html.phpbb-dark-mode .podium {
	color: #111827;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.15);
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

html.phpbb-dark-mode .podium.gold {
	background: linear-gradient(to bottom, #facc15, #eab308 70%, #ca8a04);
	border-color: #a16207;
}

html.phpbb-dark-mode .podium.silver {
	background: linear-gradient(to bottom, #cbd5e1, #a8b1bb 70%, #94a3b8);
	border-color: #64748b;
}

html.phpbb-dark-mode .podium.bronze {
	background: linear-gradient(to bottom, #f59e0b, #d97706 70%, #92400e);
	border-color: #92400e;
}

html.phpbb-dark-mode .podium-number {
	color: #0b0f14;
}

html.phpbb-dark-mode .month-nav {
	color: #e5e7eb;
	background: #111827;
	border-color: #334155;
}

html.phpbb-dark-mode .month-nav:hover {
	background: #1f2937;
	text-decoration: none;
}

html.phpbb-dark-mode .month-nav.disabled {
	opacity: 0.45;
	border-color: #334155;
	border-style: dashed;
}

html.phpbb-dark-mode .month-select {
	color: #e5e7eb;
	background: #111827;
	border-color: #334155;
}

html.phpbb-dark-mode .month-select:hover {
	background: #1f2937;
	text-decoration: none;
}

html.phpbb-dark-mode .month-select:focus {
	outline: none;
	border-color: #60a5fa;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

html.phpbb-dark-mode .month-select:disabled,
html.phpbb-dark-mode .month-select:disabled:hover {
	background: #0b1016;
	border-color: #334155;
	opacity: 0.45;
	box-shadow: none;
	cursor: default;
}

html.phpbb-dark-mode p.no-topposter {
	color: #cbd5e1;
}