/* ============================================
   Sicilia Openwater - Classifiche 2025
   Stile Circuito Ufficiale
   ============================================ */

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background-color: #1a1a1a;
	color: #ffffff;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	min-height: 100vh;
}

/* ============================================
   Header con Loghi
   ============================================ */
.classifica-header {
	background-color: #212121;
	border-bottom: 3px solid #d90a2c;
	padding: 2rem;
	margin-bottom: 2rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.classifica-header-content {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 2rem;
}

.header-logos {
	display: flex;
	align-items: center;
	gap: 2rem;
}

.header-logos img {
	height: 50px;
	filter: brightness(0.95);
	transition: transform 0.3s ease;
}

.header-logos img:hover {
	transform: scale(1.05);
}

.header-title {
	flex: 1;
	text-align: left;
	margin-left: 2rem;
}

h2 {
	color: #ffffff;
	font-size: 2.5rem;
	font-weight: 700;
	letter-spacing: -0.5px;
	margin: 0;
}

.header-subtitle {
	color: #d90a2c;
	font-size: 1rem;
	margin-top: 0.5rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	font-weight: 600;
}

/* ============================================
   Container Principale
   ============================================ */
.classifica-container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 1rem 2rem 1rem;
}

/* ============================================
   Sezioni Classifiche
   ============================================ */

.atletic-list {
	background-color: #2a2a2a;
	border-left: 5px solid #d90a2c;
	border-radius: 4px;
	padding: 0;
	margin-bottom: 2.5rem;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
	transition: box-shadow 0.3s ease;
	overflow: hidden;
}

.atletic-list:hover {
	box-shadow: 0 8px 16px rgba(196, 30, 58, 0.2);
}

.atletic-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2rem;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s ease;
}

.atletic-header:hover {
	background-color: rgba(196, 30, 58, 0.1);
}

.atletic-header h3 {
	margin: 0;
	flex: 1;
}

.expand-icon {
	font-size: 1.5rem;
	color: #d90a2c;
	font-weight: 700;
	min-width: 30px;
	text-align: center;
}

.atletic-content {
	transition: none;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2rem;
}

h3 {
	/*color: #d90a2c;*/
	color: #ffffff;
	font-size: 1.4rem;
	margin: 0 0 1.5rem 0;
	font-weight: 600;
	border-bottom: 2px solid #d90a2c;
	padding-bottom: 0.75rem;
	padding-left: 0.75rem;
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ============================================
   Tabelle
   ============================================ */
.results-table {
	width: 100%;
	border-collapse: collapse;
	background-color: #1a1a1a;
	border-radius: 0;
	overflow: hidden;
	min-width: 800px;
}

.results-table thead {
	background-color: #d90a2c;
	color: #ffffff;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 0.85rem;
	letter-spacing: 1px;
}

.results-table th {
	padding: 1.2rem 1rem;
	text-align: left;
	border: none;
	white-space: nowrap;
	font-weight: 700;
	color: #ffffff;
}

/* Intestazioni ordinabili */
.sortable-header {
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s ease;
	position: relative;
}

.sortable-header:hover {
	background-color: #c41a3b;
}

.sortable-header span {
	margin-left: 0.4rem;
	display: inline-block;
	font-size: 0.9rem;
	font-weight: 700;
}

.sortable-header span {
	color: #999999;
}

.sorted-asc span,
.sorted-desc span {
	color: #ffffff;
	font-weight: 900;
}

.results-table td {
	padding: 1rem;
	border-bottom: 1px solid #333333;
	text-align: left;
	color: #ffffff;
	font-size: 0.95rem;
}

.results-table tbody tr {
	transition: background-color 0.2s ease;
	border-left: 3px solid transparent;
}

.results-table tbody tr:hover {
	background-color: #2a2a2a;
	border-left-color: #d90a2c;
}

.results-table tbody tr:nth-child(even) {
	background-color: #252525;
}

.results-table tbody tr:nth-child(even):hover {
	background-color: #2a2a2a;
}

.results-table tbody tr:last-child td {
	border-bottom: none;
}

/* ============================================
   Column Styles
   ============================================ */
.results-table td:first-child {
	font-weight: 700;
	color: #d90a2c;
	text-align: center;
	width: 45px;
	background-color: #252525;
	flex-shrink: 0;
}

.results-table th:first-child {
	text-align: center;
	width: 45px;
}

.results-table td:nth-child(2),
.results-table td:nth-child(3) {
	font-weight: 600;
	color: #ffffff;
	min-width: 120px;
	max-width: 120px;
}

.results-table td:nth-child(4) {
	color: #b0b0b0;
	font-size: 0.9rem;
	min-width: 100px;
	max-width: 100px;
}

.results-table td:nth-child(5) {
	font-weight: 600;
	color: #d90a2c;
	min-width: 60px;
}

.results-table td:nth-child(n+6):nth-child(-n+100) {
	text-align: center;
	font-weight: 500;
	color: #e0e0e0;
	min-width: 70px;
	padding: 1rem 0.5rem;
}

.punti-finale {
	font-weight: 700;
	color: #ffffff;
	background-color: #d90a2c;
	padding: 0.35rem 0.5rem;
	border-radius: 0;
	display: inline-block;
	font-size: 0.9rem;
	border-radius:15px;
}

.results-table td:last-child {
	font-weight: 700;
	color: #ffffff;
	font-size: 1rem;
	text-align: center;
	background-color: #252525;
	min-width: 60px;
	flex-shrink: 0;
}

.results-table th:last-child {
	background-color: #d90a2c;
	min-width: 60px;
}

/* ============================================
   Separatori
   ============================================ */
hr {
	border: none;
	height: 1px;
	background-color: #333333;
	margin: 3rem 0;
}

/* ============================================
   Error Messages
   ============================================ */
.error-message {
	background-color: #3a1a1a;
	border-left: 4px solid #d90a2c;
	color: #ff9999;
	padding: 1.5rem;
	border-radius: 0;
	margin: 2rem auto;
	max-width: 1400px;
	font-weight: 500;
}

/* ============================================
   Loading State
   ============================================ */
.loading-spinner {
	text-align: center;
	padding: 3rem 1rem;
	color: #b0b0b0;
	font-size: 1.1rem;
	letter-spacing: 1px;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
	.classifica-header-content {
		flex-direction: column;
		text-align: center;
	}

	h2 {
		font-size: 2rem;
	}

	.results-table {
		font-size: 0.85rem;
	}

	.results-table th,
	.results-table td {
		padding: 0.8rem 0.5rem;
	}

	.results-table td:nth-child(2),
	.results-table td:nth-child(3) {
		min-width: 100px;
	}

	.results-table td:nth-child(4) {
		min-width: 80px;
	}

	.results-table td:nth-child(n+6):nth-child(-n+100) {
		min-width: 60px;
		padding: 0.8rem 0.4rem;
	}
}

@media (max-width: 768px) {
	.classifica-header {
		padding: 1.5rem;
		margin-bottom: 1.5rem;
	}

	h2 {
		font-size: 1.5rem;
	}

	h3 {
		font-size: 1.1rem;
		margin-bottom: 1rem;
	}

	.atletic-list {
		padding: 1.25rem;
		margin-bottom: 1.5rem;
	}

	.results-table {
		font-size: 0.75rem;
		min-width: 600px;
	}

	.results-table th,
	.results-table td {
		padding: 0.6rem 0.3rem;
	}

	.results-table th {
		font-size: 0.65rem;
	}

	.results-table td:first-child {
		width: 40px;
		padding: 0.6rem 0.2rem;
	}

	.results-table td:nth-child(2),
	.results-table td:nth-child(3) {
		min-width: 90px;
		max-width: 90px;
	}

	.results-table td:nth-child(4) {
		min-width: 70px;
		max-width: 70px;
		overflow: hidden;
	}

	.results-table td:nth-child(5) {
		min-width: 50px;
	}

	.results-table td:nth-child(n+6):nth-child(-n+100) {
		min-width: 55px;
		padding: 0.6rem 0.25rem;
	}

	.punti-finale {
		padding: 0.2rem 0.3rem;
		font-size: 0.75rem;
	}

	.results-table td:last-child {
		font-size: 0.9rem;
		min-width: 50px;
	}

	.header-logos {
		flex-direction: column;
		gap: 0.75rem;
	}

	.header-logos img {
		height: 35px;
	}
}

@media (max-width: 480px) {
	.classifica-header {
		padding: 1rem;
	}

	h2 {
		font-size: 1.3rem;
	}

	.classifica-container {
		padding: 0 0.5rem 2rem 0.5rem;
	}

	.atletic-list {
		padding: 0.75rem;
		margin-bottom: 1rem;
	}

	.results-table {
		font-size: 0.65rem;
		min-width: 500px;
	}

	.results-table th,
	.results-table td {
		padding: 0.4rem 0.2rem;
	}

	.results-table th {
		font-size: 0.6rem;
	}

	.results-table td:first-child {
		width: 35px;
		padding: 0.4rem 0.1rem;
	}

	.results-table td:nth-child(2),
	.results-table td:nth-child(3) {
		min-width: 75px;
		max-width: 75px;
	}

	.results-table td:nth-child(4) {
		min-width: 60px;
		max-width: 60px;
		font-size: 0.7rem;
	}

	.results-table td:nth-child(5) {
		min-width: 45px;
	}

	.results-table td:nth-child(n+6):nth-child(-n+100) {
		min-width: 50px;
		padding: 0.4rem 0.2rem;
	}

	.punti-finale {
		padding: 0.15rem 0.2rem;
		font-size: 0.65rem;
	}

	.results-table td:last-child {
		font-size: 0.8rem;
		min-width: 45px;
	}

	h3 {
		font-size: 0.95rem;
		padding-bottom: 0.5rem;
	}

	.header-subtitle {
		font-size: 0.8rem;
	}
}

/* ============================================
   Animazioni
   ============================================ */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.atletic-list {
	animation: fadeIn 0.5s ease-out;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
	body {
		background: white;
		color: black;
	}

	.classifica-header,
	.atletic-list {
		background: white;
		border: 1px solid #ccc;
		box-shadow: none;
		page-break-inside: avoid;
		color: black;
	}

	h2,
	h3 {
		color: #000;
	}

	.results-table thead {
		background: #333;
		color: white;
	}

	.results-table tbody tr:nth-child(even) {
		background: #f5f5f5;
	}
}
