/* ===== PRINT ===== */
@media print {
	.noprint {
		display: none !important;
	}
	#calendario {
		padding-top: 10px !important;
	}
	.onlyprint_logo {
		display: block !important;
	}
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
	box-sizing: border-box;
}

body, div {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.5;
}

body {
	margin: 0;
	padding: 0;
	background-color: #f5f6fa;
	color: #2d3436;
}

a {
	color: #c0392b;
	transition: color 0.2s;
}

a:hover {
	color: #e74c3c;
}

hr {
	border: none;
	border-top: 1px solid #dfe6e9;
	margin: 30px auto;
	max-width: 900px;
}

h1 {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #2d3436;
	margin: 30px 0 15px;
}

/* ===== BACKGROUND IMAGE ===== */
#bgDiv {
	background-image: url(../../tmp_img/bg.JPG);
	background-size: cover;
	background-position: center;
	opacity: 0.04;
	position: fixed;
	z-index: 0;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.onlyprint_logo {
	display: none;
	position: absolute;
	bottom: 0;
	right: 30px;
	width: 120px;
	height: auto;
}

/* ===== NAVIGATION MENU ===== */
body > div:nth-child(2) > div:first-child ul {
	list-style: none;
	padding: 12px 16px;
	margin: 0;
	background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
	border-radius: 0 0 12px 0;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

body > div:nth-child(2) > div:first-child ul li {
	margin-bottom: 4px;
}

.link {
	text-decoration: none;
	color: #2d3436;
	transition: all 0.2s ease;
}

.link:hover {
	background-color: #c0392b;
	color: #fff;
}

/* Link chiari solo nel menu navigazione */
body > div:nth-child(2) > div:first-child .link {
	color: #dfe6e9 !important;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 4px;
	display: inline-block;
}

body > div:nth-child(2) > div:first-child .link:hover {
	color: #fff !important;
	transform: translateX(4px);
}

/* ===== LOGO ===== */
body > div:nth-child(2) > a > img {
	max-width: 220px;
	margin-top: 20px;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body > div:nth-child(2) > a > img:hover {
	transform: scale(1.03);
	box-shadow: 0 6px 25px rgba(0, 0, 0, 0.18);
}

/* ===== UPDATE INFO ===== */
body > div:nth-child(2) > div:nth-child(4) {
	margin: 10px auto;
	padding: 8px 20px;
	background: #fff;
	border-radius: 8px;
	display: inline-block;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	font-size: 12px;
	color: #636e72;
}

/* ===== PARTITE OGGI / SETTIMANA ===== */
#partiteOggi, #partiteSettimana {
	max-width: 1100px;
	margin: 15px auto;
	padding: 0 15px;
}

/* ===== CLASSIFICA ===== */
#classifica {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 15px;
	text-align: center;
}

#classifica .giornata {
	display: block;
	margin: 20px auto 0;
	text-align: center;
}

#classifica h2 {
	font-size: 20px;
	font-weight: 700;
	color: #c0392b;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 15px;
}

#tblClassifica {
	margin: 0 auto;
}

#tblClassifica td {
	font-size: 13px;
	font-weight: 500;
	color: #2d3436;
}

/* ===== CALENDARIO ===== */
#calendario {
	padding-top: 0;
	text-align: center;
	max-width: 1200px;
	margin: 0 auto;
}

.giornata {
	margin: 20px 8px 0;
	display: inline-block;
	text-align: left;
	vertical-align: top;
}

.titoloGiornata {
	background: linear-gradient(135deg, #c0392b, #e74c3c);
	color: #fff;
	padding: 6px 14px;
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 0.3px;
	border-radius: 6px 6px 0 0;
}

/* ===== TABLES ===== */
.tblgiorno {
	border: none;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	border-collapse: separate;
	border-spacing: 0;
}

.tblgiorno th {
	background: linear-gradient(135deg, #a93226, #c0392b);
	color: #fff;
	padding: 8px 10px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.tblgiorno td {
	padding: 6px 10px;
	border-bottom: 1px solid #f0f0f0;
}

.tblgiorno tr:nth-child(even) {
	background-color: #f8f9fa;
}

.tblgiorno tr:nth-child(odd) {
	background-color: #fff;
}

.tblgiorno tr:hover {
	background-color: #fff3cd !important;
	transition: background-color 0.2s;
}

/* Partite giocate */
.tblgiorno tr.giocata:nth-child(even) {
	background-color: #27ae60 !important;
}

.tblgiorno tr.giocata:nth-child(odd) {
	background-color: #229954 !important;
}

.tblgiorno tr.giocata:hover {
	background-color: #2ecc71 !important;
}

.giocata, .giocata a, .rinviata, .rinviata a {
	color: #fff !important;
}

/* Partite rinviate */
.tblgiorno tr.rinviata:nth-child(even) {
	background-color: #7f8c8d !important;
}

.tblgiorno tr.rinviata:nth-child(odd) {
	background-color: #6c7a7d !important;
}

/* Evidenze */
.evidenza, .evidenza a {
	background-color: #c0392b;
	color: #fff;
	font-weight: bold;
}

.evidenza2 {
	background-color: #f39c12 !important;
	color: #000 !important;
	font-weight: bold;
}

.evidenza1 {
	background-color: #c0392b !important;
	color: #fff !important;
	font-weight: bold;
}

.green {
	background-color: #27ae60;
	color: #fff;
	padding: 2px 20px;
	border-radius: 4px;
}

.gray * {
	color: #b2bec3;
}

/* ===== PLAYOFF SECTION ===== */
.sezione_playoff {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 15px;
}

.sezione_playoff h1 {
	position: relative;
	display: inline-block;
}

.sezione_playoff h1::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 3px;
	background: #c0392b;
	border-radius: 2px;
}

/* ===== BRACKET ===== */
.bracket {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 13px;
}

.bracket td {
	min-width: 100px;
	height: 32px;
	padding: 4px 8px;
}

.bottom {
	border-bottom: 2px solid #2d3436;
}

.left {
	border-left: 2px solid #2d3436;
}

.right {
	border-right: 2px solid #2d3436;
}

.data {
	color: #c0392b;
	text-align: center;
	font-size: 11px;
}

.empty {
	color: transparent;
}

td.numero {
	font-size: 9px;
	padding-left: 5px;
	font-family: Verdana, Arial, sans-serif;
	color: #636e72;
}

.bold {
	font-weight: bold;
}

.txtright {
	text-align: right;
	margin-right: 20px;
	float: right;
	font-weight: 500;
}

.txtleft {
	text-align: left;
	margin-left: 20px;
}

.hide {
	display: none;
}

.semihide {
	opacity: 0.2;
}

/* ===== FOOTER ===== */
body > div:last-of-type {
	margin-top: 40px;
}

body > div:last-of-type .link,
body > div:last-of-type div {
	color: #636e72;
}

body > div:last-of-type img {
	border-radius: 8px;
	transition: transform 0.3s;
}

body > div:last-of-type img:hover {
	transform: scale(1.05);
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 1024px) {
	.tblgiorno {
		width: 100% !important;
	}

	.giornata {
		width: calc(100% - 20px);
		margin: 15px 10px 0;
	}

	.bracket td {
		min-width: 80px;
		font-size: 11px;
	}

	.sezione_playoff {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.sezione_playoff .tblgiorno {
		min-width: 700px;
	}

	.sezione_playoff table.bracket {
		min-width: 600px;
	}
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
	/* Menu navigazione: da posizione assoluta a flusso normale */
	body > div:nth-child(2) > div:first-child {
		position: relative !important;
		left: auto !important;
		top: auto !important;
		text-align: center !important;
		width: 100%;
	}

	body > div:nth-child(2) > div:first-child ul {
		border-radius: 0;
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 4px;
		padding: 10px;
	}

	body > div:nth-child(2) > div:first-child .link {
		font-size: 11px !important;
		padding: 3px 8px !important;
	}

	/* Logo piu piccolo */
	body > div:nth-child(2) > a > img {
		max-width: 160px;
		margin-top: 15px;
	}

	/* Titoli */
	h1 {
		font-size: 16px;
		padding: 0 10px;
	}

	h2 {
		font-size: 16px;
	}

	#classifica h2 {
		font-size: 16px;
	}

	/* Tabelle: scroll orizzontale */
	.giornata {
		width: calc(100% - 16px);
		margin: 12px 8px 0;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.tblgiorno {
		font-size: 11px;
		min-width: 600px;
		width: 100% !important;
	}

	.tblgiorno th {
		padding: 6px 6px;
		font-size: 10px;
	}

	.tblgiorno td {
		padding: 5px 6px;
		font-size: 11px;
	}

	/* Classifica */
	#classifica {
		padding: 0 8px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#classifica .giornata {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	#tblClassifica {
		min-width: 700px;
	}

	/* Calendario */
	#calendario {
		padding: 0 8px;
	}

	/* Playoff */
	.sezione_playoff {
		padding: 15px 8px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.sezione_playoff .tblgiorno {
		min-width: 650px;
	}

	.sezione_playoff table.bracket {
		min-width: 550px;
	}

	.bracket td {
		min-width: 60px;
		height: 28px;
		font-size: 10px;
		padding: 3px 5px;
	}

	/* Partite oggi/settimana */
	#partiteOggi, #partiteSettimana {
		padding: 0 8px;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Footer */
	body > div:last-of-type img {
		width: 100px !important;
	}
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 480px) {
	body > div:nth-child(2) > a > img {
		max-width: 130px;
	}

	h1 {
		font-size: 14px;
	}

	.tblgiorno {
		font-size: 10px;
		min-width: 500px;
	}

	.tblgiorno th {
		font-size: 9px;
		padding: 4px 4px;
	}

	.tblgiorno td {
		padding: 4px 4px;
		font-size: 10px;
	}

	.bracket td {
		min-width: 50px;
		font-size: 9px;
	}

	.titoloGiornata {
		font-size: 11px;
		padding: 5px 10px;
	}
}
