/* ==========================================================================
   SPORTOTEKA ROSTER TABLE STYLES
   Split from main CSS to ensure clean cascade and fix geometry.
   ========================================================================== */

/* Wrapper */
.sporto-roster-wrapper {
	position: relative;
	overflow-x: auto;
	margin-bottom: 30px;
	-webkit-overflow-scrolling: touch;
}

/* Team Name Header (Sticky Top-Left if needed, but mostly static block) */
.sporto-roster-wrapper h3.roster-team-name {
	position: -webkit-sticky;
	position: sticky;
	left: 0;
	z-index: 30;
	font-family: 'Roboto Condensed', sans-serif;
	padding: 16px;
	color: #fff;
	text-transform: uppercase;
	font-size: 18px;
	/* Fallback */
	font-weight: 700;
	letter-spacing: 1px;
	background-color: #34495e !important;
}

/* Base Table */
.sporto-roster-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 1px 0;
	/* Font sizes handled by Typography section below */
	text-transform: uppercase;
	min-width: 800px;
	font-family: 'Roboto Condensed', sans-serif;
}

/* Typography (Strict User Request) */
.sporto-roster-table th {
	font-size: 13px !important;
	font-family: 'Roboto Condensed', sans-serif;
	font-weight: 700;
	letter-spacing: 0.5px;
	padding: 16px 8px;
	border: 1px solid #e0e0e0;
	white-space: nowrap;
	text-align: center;
	vertical-align: middle;
	background-color: #34495e !important;
	color: #ffffff;
}

.sporto-roster-table td {
	font-size: 16px !important;
	/* Desktop Body */
	padding: 2px 6px;
	border: 1px solid #e0e0e0;
	color: #2c3e50;
	white-space: nowrap;
	text-align: center;
	background: #fff;
	vertical-align: middle;
}

/* Stripes */
.sporto-roster-table tbody tr:nth-child(even) td {
	background-color: #f8f9fa;
}

.sporto-roster-table tbody tr:hover td {
	background-color: #e8f4f8 !important;
}

.roster-coach-row td {
	background-color: #e8f4f8 !important;
}

/* Column Widths & Alignments */
/* Col 1, 2, 3 handled in GEOMETRY FIX below */

.sporto-roster-table th:nth-child(4),
.sporto-roster-table td:nth-child(4) {
	width: 100px;
	min-width: 100px;
	max-width: 100px;
}

.sporto-roster-table th:nth-child(5),
.sporto-roster-table td:nth-child(5) {
	width: 70px;
	min-width: 70px;
	max-width: 70px;
}

.sporto-roster-table th:nth-child(6),
.sporto-roster-table td:nth-child(6) {
	width: 70px;
	min-width: 70px;
	max-width: 70px;
}

/* Date */
.sporto-roster-table th:nth-child(7),
.sporto-roster-table td:nth-child(7) {
	width: 100px;
	min-width: 100px;
	max-width: 100px;
	text-align: center !important;
}

/* Citizenship */
.sporto-roster-table th:nth-child(8),
.sporto-roster-table td:nth-child(8) {
	width: 120px;
	min-width: 120px;
	max-width: 120px;
}

/* Photos */
.sporto-roster-table .player-photo,
.sporto-roster-table .coach-photo {
	width: 52px !important;
	height: 52px !important;
	object-fit: cover !important;
	border-radius: 3px !important;
	display: inline-block;
	vertical-align: middle;
}

.sporto-roster-table .no-photo {
	display: inline-block;
	width: 52px !important;
	height: 52px !important;
	background: #e0e0e0;
	border-radius: 3px !important;
	vertical-align: middle;
}

/* Logo in Header */
.team-logo-header {
	background: #fff;
	width: 52px;
	height: 52px;
	border-radius: 3px;
	object-fit: cover;
	width: auto;
	vertical-align: middle;
	display: inline-block;
}

/* Links */
.roster-col-name a {
	color: #2c3e50;
	text-decoration: none;
	transition: color 0.2s ease;
}

.roster-col-name a:hover {
	color: #3498db;
	text-decoration: underline;
}

.game-video-link {
	margin: 20px 0;
	text-align: center;
	font-weight: 700;
}

/* Mobile Name Stacking (<= 478px) */
@media (max-width: 478px) {
	.sporto-roster-table .player-name-wrapper {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
		line-height: 1.2;
	}

	.sporto-roster-table .player-lastname {
		font-weight: 700;
		font-size: 14px;
		display: block;
	}

	.sporto-roster-table .player-firstname {
		font-size: 12px;
		display: block;
	}

	.sporto-roster-table .player-link {
		display: flex;
		flex-direction: column;
		text-decoration: none;
		color: inherit;
	}

	/* Mobile Font Size Override */
	.sporto-roster-table td:nth-child(3) {
		font-size: 13px !important;
	}
}

/* ==========================================================================
   ROSTER GEOMETRY FIX (STRICT MATCH TO PROTOCOL)
   Overrides everything to ensure identical scroll behavior.
   ========================================================================== */

/* Col 1: Number (44px, Left 0) */
.sporto-roster-table th:nth-child(1),
.sporto-roster-table td:nth-child(1) {
	position: -webkit-sticky;
	position: sticky !important;
	width: 44px !important;
	min-width: 44px !important;
	max-width: 44px !important;
	left: 0 !important;
	z-index: 50 !important;
	background-color: #fff;
	/* Opaque Body for scroll */
}

/* Ensure header opacity explicitly */
.sporto-roster-table th:nth-child(1) {
	background-color: #34495e !important;
	color: #fff;
}

.sporto-roster-table tbody td:nth-child(1) {
	z-index: 20 !important;
}

/* Col 2: Photo (60px, Left 44px) */
.sporto-roster-table th:nth-child(2),
.sporto-roster-table td:nth-child(2) {
	position: -webkit-sticky;
	position: sticky !important;
	width: 60px !important;
	min-width: 60px !important;
	max-width: 60px !important;
	left: 44px !important;
	z-index: 50 !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.sporto-roster-table th:nth-child(2) {
	background-color: #34495e !important;
	color: #fff;
}

.sporto-roster-table td:nth-child(2) {
	padding: 2px !important;
	background-color: #fff;
}

.sporto-roster-table tbody td:nth-child(2) {
	z-index: 20 !important;
}

/* Col 3: Name (220px, Left 104px) */
.sporto-roster-table th:nth-child(3),
.sporto-roster-table td:nth-child(3) {
	position: -webkit-sticky;
	position: sticky !important;
	width: 220px !important;
	min-width: 220px !important;
	max-width: 220px !important;
	left: 104px !important;
	z-index: 50 !important;
	box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.2);
	/* Enhanced Shadow */
	background-color: #fff;
	/* Opaque Body for scroll */

	text-align: left;
	padding-left: 8px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sporto-roster-table th:nth-child(3) {
	background-color: #34495e !important;
	color: #fff;
}

.sporto-roster-table tbody td:nth-child(3) {
	z-index: 20 !important;
}

/* Coach Row Overrides */
.sporto-roster-table .roster-coach-row td:nth-child(1) {
	position: sticky !important;
	left: 0 !important;
	z-index: 20 !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
	background-color: #e8f4f8 !important;
}

.sporto-roster-table .roster-coach-row td:nth-child(2) {
	position: sticky !important;
	left: 44px !important;
	z-index: 20 !important;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
	background-color: #e8f4f8 !important;
}

.sporto-roster-table .roster-coach-row td:nth-child(3) {
	position: sticky !important;
	left: 104px !important;
	z-index: 20 !important;
	box-shadow: 4px 0 6px -2px rgba(0, 0, 0, 0.2);
	background-color: #e8f4f8 !important;
}

/* Mobile Protocol Match (767px) */
@media (max-width: 767px) {

	.sporto-roster-table th:nth-child(3),
	.sporto-roster-table td:nth-child(3) {
		width: 110px !important;
		min-width: 110px !important;
		max-width: 110px !important;
	}
}