/* ==========================================================================
   ФАЙЛ 3: sportoteka-protocol.css
   Стили для таблицы протокола матча (статистика игроков).
   ========================================================================== */

.sporto-protocol-container {
	margin: 20px 0;
	font-family: 'Oswald', sans-serif;
	overflow-x: auto;
}

.protocol-table-wrapper {
	position: relative;
	overflow-x: auto;
	margin-bottom: 30px;
	-webkit-overflow-scrolling: touch;
	border-radius: 0 0 8px 8px !important;
	border-bottom: 1.5px solid var(--secondary-semi-light) !important;
}

/* Липкий заголовок команды над таблицей протокола */
.protocol-table-wrapper h3.team-name {
	position: -webkit-sticky;
	position: sticky;
	left: 0;
	top: 0;
	z-index: 30;
	color: #fff;
	padding: 16px;
	font-family: 'Oswald', sans-serif;
	font-size: 24px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0;
	background-color: #34495e !important;
	border-radius: 8px 8px 0 0 !important;
	width: 100%;
	box-sizing: border-box;
}

.sporto-protocol-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	margin: 0;
	margin-top: 0.5px;
	font-size: 16px;
	text-transform: uppercase;
	min-width: 800px;
	font-family: 'Oswald', sans-serif;
}

.sporto-protocol-table tr {
	height: 56px;
}

/* --- ФИКСАЦИЯ КОЛОНОК (STICKY) В ПРОТОКОЛЕ --- */
.sporto-protocol-table thead th {
	background-color: #34495e !important;
	font-family: 'Oswald', sans-serif;
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 40;
	border-bottom: 1px solid #3e5871;
	margin: 0;
}

.sporto-protocol-table thead tr:first-child th:nth-child(1) {
    position: sticky;
	left: 0 !important;
	z-index: 50 !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
	border-right: 1px solid #3e5871;
}

.sporto-protocol-table thead tr:first-child th:nth-child(2) {
	position: sticky;
    left: 44px !important;
	z-index: 50 !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
	border-right: 1px solid #3e5871;
}

.sporto-protocol-table thead tr:first-child th:nth-child(3) {
	position: sticky;
    left: 104px !important;
	z-index: 50 !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
	border-right: 1px solid #3e5871;
}

.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total) td:nth-child(1) {
	position: -webkit-sticky;
	position: sticky;
	left: 0 !important;
	z-index: 20 !important;
	background-color: #fff;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total) td:nth-child(2) {
	position: -webkit-sticky;
	position: sticky;
	left: 44px !important;
	z-index: 20 !important;
	background-color: #fff;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total) td:nth-child(3) {
	position: -webkit-sticky;
	position: sticky;
	left: 104px !important;
	z-index: 20 !important;
	background-color: #fff;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total):nth-child(even) td:nth-child(1),
.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total):nth-child(even) td:nth-child(2),
.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total):nth-child(even) td:nth-child(3) {
	background-color: #f8f9fa;
}

.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total):hover td:nth-child(1),
.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total):hover td:nth-child(2),
.sporto-protocol-table tbody tr:not(.coach-row):not(.grand-total):hover td:nth-child(3) {
	background-color: #e8f4f8 !important;
}

/* Спец-строки в протоколе (colspan) */
.sporto-protocol-table .coach-row td:nth-child(1) {
	position: -webkit-sticky;
	position: sticky;
	left: 0 !important;
	z-index: 20 !important;
	background-color: #fff !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-protocol-table .grand-total td:nth-child(1) {
	position: -webkit-sticky;
	position: sticky;
	left: 0 !important;
	z-index: 20 !important;
	background-color: var(--secondary-ultra-light) !important;  
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-protocol-table .coach-row td:nth-child(2) {
	position: -webkit-sticky;
	position: sticky;
	left: 104px !important;
	z-index: 20 !important;
	background-color: #fff !important;  
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-protocol-table .grand-total td:nth-child(2) {
	position: -webkit-sticky;
	position: sticky;
	left: 104px !important;
	z-index: 20 !important;
    background-color: var(--secondary-ultra-light) !important;   
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}



/* Сортировка */
.sporto-protocol-table th.stse-sortable {
	cursor: pointer;
	transition: background-color 0.3s;
	position: relative;
	padding-right: 16px !important;
	text-align: center !important;
}

.sporto-protocol-table th.stse-sortable:hover {
	background-color: #34495e !important;
}

.sporto-protocol-table th.stse-sortable::after {
	content: "";
	position: absolute;
	right: 6px;
	top: calc(50% - 2.5px);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	opacity: 0.5;
	transition: opacity 0.3s;
}

.sporto-protocol-table th.stse-sortable.asc::after {
	border-bottom: 5px solid #fff;
	opacity: 1;
}

.sporto-protocol-table th.stse-sortable.desc::after {
	border-top: 5px solid #fff;
	opacity: 1;
}

/* Общие ячейки */
.sporto-protocol-table th {
	color: #ffffff;
	font-weight: 700;
	letter-spacing: 0.5px;
	padding: 12px 6px;
	border: 1px solid #e0e0e0;
	white-space: nowrap;
	text-align: center;
	vertical-align: middle;
}

.sporto-protocol-table td {
	border: 1px solid #e0e0e0;
	color: #2c3e50;
	white-space: nowrap;
	text-align: center;
	background: #fff;
	vertical-align: middle;
	padding: 2px 6px;
}

/* Ширина колонок протокола */
.sporto-protocol-table th:nth-child(1),
.sporto-protocol-table td:nth-child(1) {
	width: 44px;
	min-width: 44px;
	max-width: 44px;
	font-weight: 700;
}

.sporto-protocol-table th:nth-child(2),
.sporto-protocol-table td:nth-child(2) {
	width: 60px;
	min-width: 60px;
	max-width: 60px;
	padding: 2px;
}

.sporto-protocol-table th:nth-child(3),
.sporto-protocol-table td:nth-child(3) {
	width: 220px;
	min-width: 220px;
	max-width: 220px;
}

.sporto-protocol-table th:nth-child(4),
.sporto-protocol-table td:nth-child(4) {
	width: 66px;
	min-width: 66px;
	max-width: 66px;
	font-weight: 700;
}

.sporto-protocol-table th:nth-child(5),
.sporto-protocol-table td:nth-child(5) {
	width: 252px;
	min-width: 252px;
	max-width: 252px;
}

.sporto-protocol-table th:nth-child(6),
.sporto-protocol-table td:nth-child(6) {
	width: 177px;
	min-width: 177px;
	max-width: 177px;
}

.sporto-protocol-table th:nth-child(n+7),
.sporto-protocol-table td:nth-child(n+7) {
	width: 60px;
	min-width: 60px;
	max-width: 60px;
}

td.player-name {
	text-align: left !important;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

td.player-name a {
	font-weight: 400;
}

.sporto-protocol-table .grand-total td:nth-child(3) {
	font-size: 16px !important;
}

.coach-row td {
	background-color: #fff !important;
}

.sporto-protocol-table tr:nth-child(even) td {
	background-color: var(--secondary-ultra-light) !important;
}

.sporto-protocol-table tbody tr:hover td {
    background-color: #e8f4f8 !important;  
}


.sporto-protocol-table tbody tr:last-child td {
    background-color: var(--secondary-ultra-light) !important;
    font-weight: 700;   
}

.sporto-protocol-table tbody td:last-child {
	font-weight: 700;
}

.sporto-protocol-table thead .team-logo {
	width: 60px !important;
	height: 60px !important;
	object-fit: cover;
	display: block;
	margin: 0 auto;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	border-radius: 3px;
}

/* Адаптивность Протокола */
@media (max-width: 1200px) {
	.protocol-table-wrapper {
		overflow-x: auto;
		margin-bottom: 30px;
	}
}

@media (max-width: 767px) {

	.sporto-protocol-table th:nth-child(3),
	.sporto-protocol-table td:nth-child(3) {
		width: 120px;
		min-width: 120px;
		max-width: 120px;
	}
.sporto-protocol-table td:nth-child(3) .player-name-wrapper,
	.coach-row td:nth-child(2) .player-name-wrapper {
		display: flex;
		flex-direction: column;
		font-size: 13px;
		line-height: 1.2;
		white-space: normal;
	}

	.sporto-protocol-table td:nth-child(3) .p-lastname,
	.coach-row td:nth-child(2) .p-lastname {
		font-weight: 600;
	}
}