/**
 * SportsPress Integration Styles
 *
 * @package maranathasc
 */

/* ========================================================================
   General SportsPress wrapper
   ======================================================================== */

.sp-template {
	margin-bottom: 1.5em;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.sp-template:last-child {
	margin-bottom: 0;
}

/* ========================================================================
   Tables (League Tables, Player Stats, Event Performance)
   ======================================================================== */

.sp-table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.sp-table-wrapper table,
.sp-template table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 0.8em;
	table-layout: auto;
}

.sp-table-wrapper table th,
.sp-table-wrapper table td,
.sp-template table th,
.sp-template table td {
	padding: 0.6em 0.75em;
	text-align: center;
	border: 1px solid #e0e0e0;
	vertical-align: middle;
	white-space: nowrap;
}

/* Name/team columns can wrap */
.sp-table-wrapper table td.data-name,
.sp-table-wrapper table td.data-team,
.sp-template table td.data-name,
.sp-template table td.data-team {
	white-space: normal;
	text-align: left;
	min-width: 80px;
}

.sp-table-wrapper table th,
.sp-template table th {
	background-color: #1a1a1a;
	color: #fff;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 0.72em;
	letter-spacing: 0.02em;
	line-height: 1.3;
	white-space: normal;
}

.sp-table-wrapper table tbody tr:nth-child(even),
.sp-template table tbody tr:nth-child(even) {
	background-color: #f9f9f9;
}

.sp-table-wrapper table tbody tr:hover,
.sp-template table tbody tr:hover {
	background-color: #f0f0f0;
}

/* Highlight current team row */
.sp-table-wrapper table tr.sp-row-current,
.sp-template table tr.sp-row-current {
	background-color: #fffbe6;
	font-weight: 600;
}

/* Left-align name/team columns */
.sp-table-wrapper table td.data-name,
.sp-table-wrapper table td.data-team,
.sp-template table td.data-name,
.sp-template table td.data-team {
	text-align: left;
}

/* ========================================================================
   Team Logo
   ======================================================================== */

.sp-team-logo img,
.sp-logo img {
	max-width: 60px;
	height: auto;
	vertical-align: middle;
}

.sp-event-logo img {
	max-width: 80px;
	height: auto;
}

/* ========================================================================
   Event List (Fixtures & Results)
   ======================================================================== */

.sp-event-list .sp-event {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75em 1em;
	border-bottom: 1px solid #e0e0e0;
	gap: 0.5em;
}

.sp-event-list .sp-event:last-child {
	border-bottom: none;
}

.sp-event-list .sp-event:hover {
	background-color: #f9f9f9;
}

.sp-event-list .sp-event-results {
	font-size: 1.25em;
	font-weight: 700;
	text-align: center;
	min-width: 3em;
}

.sp-event-list .sp-event-date {
	font-size: 0.8em;
	color: #666;
	white-space: nowrap;
}

/* ========================================================================
   Player / Staff Photo & Details
   ======================================================================== */

.sp-player-photo img,
.sp-staff-photo img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.sp-player-details,
.sp-staff-details {
	width: 100%;
}

.sp-player-details table,
.sp-staff-details table {
	text-align: left;
}

.sp-player-details table td:first-child,
.sp-staff-details table td:first-child {
	font-weight: 600;
	width: 40%;
	text-align: left;
}

/* ========================================================================
   Player List
   ======================================================================== */

.sp-player-list img {
	max-width: 48px;
	height: auto;
	border-radius: 50%;
	vertical-align: middle;
}

/* ========================================================================
   Event / Match Header (logos + score)
   ======================================================================== */

.sp-event-overview {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1em;
	margin-bottom: 1.5em;
	text-align: center;
}

.sp-event-overview .sp-event-results {
	font-size: 2.5em;
	font-weight: 700;
	min-width: 2em;
}

/* ========================================================================
   Countdown Widget
   ======================================================================== */

.sp-countdown {
	text-align: center;
	font-size: 1.5em;
	font-weight: 700;
}

/* ========================================================================
   Venue Map
   ======================================================================== */

.sp-venue-map {
	margin-top: 1em;
}

.sp-venue-map iframe {
	width: 100%;
	border: 0;
}

/* ========================================================================
   Responsive — card layout on mobile
   ======================================================================== */

@media screen and (max-width: 640px) {

	/* Hide the header row — labels come from data-label instead */
	.sp-table-wrapper table thead,
	.sp-template table thead {
		display: none;
	}

	/* Each row becomes a card */
	.sp-table-wrapper table tbody tr,
	.sp-template table tbody tr {
		display: block;
		border: 1px solid #e0e0e0;
		border-radius: 6px;
		margin-bottom: 0.75em;
		overflow: hidden;
	}

	.sp-table-wrapper table tbody tr:nth-child(even),
	.sp-template table tbody tr:nth-child(even) {
		background-color: #fff;
	}

	/* Each cell becomes a label: value row */
	.sp-table-wrapper table tbody td,
	.sp-template table tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.5em 0.85em;
		font-size: 0.8em;
		text-align: right;
		border: none;
		border-bottom: 1px solid #f0f0f0;
		white-space: normal;
	}

	.sp-table-wrapper table tbody td:last-child,
	.sp-template table tbody td:last-child {
		border-bottom: none;
	}

	/* Column label shown on the left */
	.sp-table-wrapper table tbody td[data-label]::before,
	.sp-template table tbody td[data-label]::before {
		content: attr( data-label );
		font-size: 0.72em;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: #888;
		text-align: left;
		flex-shrink: 0;
		margin-right: 0.5em;
	}

	.sp-event-overview .sp-event-results {
		font-size: 1.75em;
	}
}
}
