/* Football Player Season Totals — public styles.
   Scoped under .fpst- classes; themable via CSS custom properties. */

.fpst-widget {
	--fpst-accent: #1e81ba;
	--fpst-accent-2: #3b9bd6;
	--fpst-bg: #ffffff;
	--fpst-row-alt: #f5f8fa;
	--fpst-border: #e2e8ee;
	--fpst-text: #1c2228;
	--fpst-muted: #647585;
	--fpst-radius: 12px;

	color: var(--fpst-text);
	font-size: 15px;
	line-height: 1.45;
	margin: 1.25em 0;
	max-width: 100%;
}

.fpst-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	margin-bottom: 12px;
}

.fpst-team-name {
	margin: 0;
	font-size: 1.35em;
	font-weight: 700;
	color: var(--fpst-accent);
}

.fpst-meta { margin: 2px 0 0; color: var(--fpst-muted); }

.fpst-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; }

.fpst-control span {
	display: block;
	font-size: 0.78em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--fpst-muted);
	margin-bottom: 3px;
}

.fpst-control select,
.fpst-rec-form select,
.fpst-rec-form input[type="text"],
.fpst-rec-form input[type="date"],
.fpst-rec-form input[type="number"] {
	appearance: none;
	-webkit-appearance: none;
	background: var(--fpst-bg, #fff);
	border: 1px solid var(--fpst-border, #d5dbd8);
	border-radius: 8px;
	padding: 8px 12px;
	font: inherit;
	color: inherit;
	min-height: 40px;
	max-width: 100%;
}

.fpst-control select { padding-right: 28px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2366736e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* ------------------------------------------------------------- Table */

.fpst-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--fpst-border);
	border-radius: var(--fpst-radius);
	background: var(--fpst-bg);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fpst-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	min-width: 520px;
}

.fpst-table th,
.fpst-table td {
	padding: 10px 14px;
	text-align: left;
	border: 0;
	border-bottom: 1px solid var(--fpst-border);
	white-space: nowrap;
}

.fpst-table thead th {
	position: sticky;
	top: 0;
	background: var(--fpst-accent);
	color: #fff;
	font-size: 0.8em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	z-index: 2;
}

.fpst-table .fpst-num { text-align: center; }

.fpst-table tbody tr:nth-child(even) { background: var(--fpst-row-alt); }
.fpst-table tbody tr:hover { background: #eef5fb; }

.fpst-table .fpst-sticky {
	position: sticky;
	left: 0;
	background: inherit;
	z-index: 1;
}

.fpst-table thead .fpst-sticky { background: var(--fpst-accent); z-index: 3; }
.fpst-table tbody tr:nth-child(odd) .fpst-sticky { background: var(--fpst-bg); }
.fpst-table tbody tr:nth-child(even) .fpst-sticky { background: var(--fpst-row-alt); }

.fpst-table tfoot td {
	background: #e8f1f9;
	font-weight: 700;
	border-bottom: 0;
}
.fpst-table tfoot .fpst-sticky { background: #e8f1f9; }

.fpst-player { font-weight: 600; }
.fpst-sub { color: var(--fpst-muted); font-size: 0.85em; font-weight: 400; }
.fpst-empty { text-align: center; color: var(--fpst-muted); padding: 22px !important; }

.fpst-sortable { cursor: pointer; user-select: none; }
.fpst-sortable:hover { filter: brightness(1.12); }
.fpst-sortable.fpst-sorted-asc::after { content: " \25B4"; }
.fpst-sortable.fpst-sorted-desc::after { content: " \25BE"; }

.fpst-subhead {
	margin: 20px 0 8px;
	font-size: 1.02em;
	font-weight: 700;
	color: var(--fpst-accent);
}

.fpst-msg { padding: 12px 14px; background: #f5f8fa; border: 1px solid #e2e8ee; border-radius: 10px; }

/* ---------------------------------------------------------- Recorder */

.fpst-recorder {
	--fpst-accent: #1e81ba;
	--fpst-border: #e2e8ee;
	--fpst-muted: #647585;
	margin: 1.25em 0;
	font-size: 15px;
	max-width: 100%;
}

.fpst-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px 16px;
	margin-bottom: 16px;
}

.fpst-grid > label > span:first-child {
	display: block;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--fpst-muted);
	margin-bottom: 4px;
}

.fpst-grid input, .fpst-grid select { width: 100%; box-sizing: border-box; }

.fpst-seg { display: inline-flex; border: 1px solid var(--fpst-border); border-radius: 8px; overflow: hidden; }
.fpst-seg-opt { padding: 8px 14px; cursor: pointer; }
.fpst-seg-opt:has(input:checked) { background: var(--fpst-accent); color: #fff; }
.fpst-seg-opt input { margin-right: 4px; }

.fpst-players-grid { margin: 8px 0 16px; }
.fpst-hint { color: var(--fpst-muted); font-style: italic; }

.fpst-pg-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.fpst-pg-wrap { overflow-x: auto; border: 1px solid var(--fpst-border); border-radius: 12px; }
.fpst-pg-table th, .fpst-pg-table td { padding: 8px 10px; border-bottom: 1px solid var(--fpst-border); text-align: center; white-space: nowrap; }
.fpst-pg-table th { background: var(--fpst-accent); color: #fff; font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 0; }
.fpst-pg-table td:first-child, .fpst-pg-table th:first-child { text-align: left; position: sticky; left: 0; background: #fff; font-weight: 600; }
.fpst-pg-table th:first-child { background: var(--fpst-accent); }
.fpst-pg-table tbody tr:nth-child(even) td { background: #f5f8fa; }
.fpst-pg-table input[type="number"] { width: 62px; padding: 6px; border: 1px solid var(--fpst-border); border-radius: 6px; text-align: center; }
.fpst-pg-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--fpst-accent); }

.fpst-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.fpst-btn {
	display: inline-block;
	background: #fff;
	border: 1px solid var(--fpst-border, #d5dbd8);
	color: inherit;
	border-radius: 8px;
	padding: 9px 18px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.fpst-btn-primary { background: var(--fpst-accent, #1e81ba); border-color: var(--fpst-accent, #1e81ba); color: #fff; }
.fpst-btn-primary:hover { filter: brightness(1.15); color: #fff; }
.fpst-btn-small { padding: 5px 12px; font-size: 0.85em; }

.fpst-feedback { font-weight: 600; }
.fpst-feedback.fpst-ok { color: #15803d; }
.fpst-feedback.fpst-err { color: #b91c1c; }
.fpst-feedback.fpst-wait { color: var(--fpst-accent, #1e81ba); }
.fpst-feedback.fpst-wait::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 6px;
	border: 2px solid var(--fpst-accent, #1e81ba);
	border-top-color: transparent;
	border-radius: 50%;
	animation: fpst-spin 0.7s linear infinite;
	vertical-align: -1px;
}
@keyframes fpst-spin { to { transform: rotate(360deg); } }

.fpst-player-link { color: var(--fpst-accent, #1e81ba); text-decoration: none; font-weight: 600; }
.fpst-player-link:hover { text-decoration: underline; }

.fpst-recent-list table { width: 100%; border-collapse: collapse; }
.fpst-recent-list th, .fpst-recent-list td { padding: 8px 10px; border-bottom: 1px solid var(--fpst-border); text-align: left; }
.fpst-recent-list .fpst-btn { margin-right: 4px; }

.fpst-export-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------- Pagination */

.fpst-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	padding: 8px 4px;
	font-size: 0.88em;
	color: var(--fpst-muted, #647585);
}

.fpst-pager select {
	border: 1px solid var(--fpst-border, #e2e8ee);
	border-radius: 6px;
	padding: 4px 8px;
	font: inherit;
	background: #fff;
	color: inherit;
}

.fpst-pager .fpst-pager-nav { display: inline-flex; gap: 6px; align-items: center; }

.fpst-pager button {
	border: 1px solid var(--fpst-border, #e2e8ee);
	background: #fff;
	border-radius: 6px;
	padding: 4px 12px;
	font: inherit;
	cursor: pointer;
	color: inherit;
}

.fpst-pager button:disabled { opacity: 0.4; cursor: default; }
.fpst-pager button:not(:disabled):hover { border-color: var(--fpst-accent, #1e81ba); color: var(--fpst-accent, #1e81ba); }

/* --------------------------------------------------------- Loading */
.fpst-loading { opacity: 0.45; pointer-events: none; transition: opacity 0.15s; }

/* ------------------------------------------------------ Small screens */
@media (max-width: 600px) {
	.fpst-widget { font-size: 14px; }
	.fpst-head { flex-direction: column; align-items: flex-start; }
	.fpst-controls { width: 100%; }
	.fpst-control { flex: 1 1 45%; }
	.fpst-control select { width: 100%; }
	.fpst-table th, .fpst-table td { padding: 8px 10px; }
}
