/* =========================
   TOOLBAR
   ========================= */

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: end;

	gap: 12px;
	margin-bottom: 20px;
}

.control {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.control label {
	color: var(--muted);
	font-size: 13px;
}

.control input[type="search"] {
	width: 240px;
}

.stats-info {
	align-self: center;
	margin-left: auto;

	color: var(--muted);

	font-size: 14px;
}


/* =========================
   STAT MODE
   ========================= */

.stat-mode {
	display: flex;
	align-items: center;

	gap: 14px;

	height: 40px;
}

.stat-mode label {
	display: inline-flex;
	align-items: center;

	gap: 6px;

	color: var(--muted);

	font-size: 14px;

	cursor: pointer;
}

.stat-mode input[type="radio"] {
	width: auto;
	height: auto;

	margin: 0;
	padding: 0;

	accent-color: var(--accent);
}


/* =========================
   STATS TABLE
   ========================= */

.table-container {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);

	overflow: hidden;
}

.table-scroll {
	overflow-x: auto;
}

.stats-table {
	width: 100%;

	border-collapse: collapse;

	font-size: 14px;
}

.stats-table th,
.stats-table td {
	padding: 10px 11px;

	border-bottom: 1px solid var(--border);

	white-space: nowrap;

	text-align: right;
}

.stats-table th {
	color: var(--muted);

	font-weight: 600;
	user-select: none;

	cursor: pointer;
}

.stats-table th:hover {
	color: var(--text);
}

.stats-table th:first-child,
.stats-table td:first-child,
.stats-table th:nth-child(2),
.stats-table td:nth-child(2) {
	text-align: left;
}

.stats-table tbody tr:hover {
	background: var(--panel-hover);
}

.stats-table tbody tr:last-child td {
	border-bottom: none;
}


/* =========================
   PLAYERS / TEAMS
   ========================= */

.player {
	color: var(--accent);
	font-weight: 600;
	cursor: pointer;
}

.team {
	color: var(--accent);
	font-weight: 600;
}

.sort-indicator {
	margin-left: 4px;
	color: var(--accent);
}


/* =========================
   PAGINATION
   ========================= */

.pagination {
	display: flex;
	align-items: center;
	justify-content: center;

	gap: 12px;

	padding: 16px;
}

#page-info {
	min-width: 90px;

	color: var(--muted);

	text-align: center;
}


/* =========================
FILTERS
========================= */

.filters {
	margin-top: 18px;
	margin-bottom: 22px;
	padding: 18px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 9px;
}

.filter-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 14px;
}

.filter-row:last-child {
	margin-bottom: 0;
}

.filter {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 8px;
}

.filter label {
	width: 42px;
	color: var(--text);
	font-size: 13px;
	text-align: left;
}

.filter input {
	width: 100%;
	min-width: 0;
	height: 36px;
}

.filter span {
	color: var(--muted);
}

.filter-player {
	grid-column: span 1;
}

.filter-player input {
	grid-column: 2 / 5;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 700px) {

	.toolbar {
		align-items: stretch;
	}

	.control {
		width: 100%;
	}

	.control input[type="search"],
	.control select {
		width: 100%;
	}

	.stat-mode {
		width: 100%;
	}

	.stats-info {
		width: 100%;
		margin-left: 0;
	}


	/* TABLE */

	.stats-table th,
	.stats-table td {
		padding: 7px 5px;
		font-size: 12px;
	}

	.stats-table th {
		font-size: 11px;
	}

	.stats-table th:first-child,
	.stats-table td:first-child {
		position: sticky;
		left: 0;

		width: 105px;
		min-width: 105px;
		max-width: 105px;

		padding-left: 8px;
		padding-right: 8px;

		background: var(--panel);

		z-index: 10;

		box-shadow:
			4px 0 5px -4px rgba(0, 0, 0, .8);
	}

	.stats-table th:first-child {
		background: #15181e;
		z-index: 20;
	}


	/* PAGINATION */

	.pagination {
		gap: 8px;
	}

	.pagination button {
		flex: 1;

		padding: 0 8px;

		font-size: 13px;
	}


        /* FILTERS */

	.filter {
		grid-template-columns:
			48px
			minmax(0, 1fr)
			12px
			minmax(0, 1fr);
	}

	.filter input {
		width: 100%;
	}
}

@media (max-width: 900px) {
        .filter-row {
                grid-template-columns: repeat(2, minmax(0, 1fr));
        }
}

@media (max-width: 600px) {
        .filter-row {
                grid-template-columns: 1fr;
        }
}
