/* File: css/style.css */

:root {
	/* Variabili di fallback - verranno sovrascritte da header.php */
	--primary-color: #005f73;
	--secondary-color: #0a9396;
	--accent-color: #e9d8a6;
	--text-color: #2b2b2b;
	--text-light: #f8f9fa;
	--bg-color: #f4f6f8;
	--white: #ffffff;
	--danger: #d90429;
	--success: #2b9348;
	--border-radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
	font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.container { width: 90%; max-width: 1200px; margin: 0 auto; }

.navbar {
	background-color: var(--primary-color);
	color: var(--text-light);
	padding: 1rem 0;
	box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;}
.logo { color: var(--text-light); text-decoration: none; font-size: 1.5rem; font-weight: bold; }
.nav-links { list-style: none; display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.nav-links a { color: var(--text-light); text-decoration: none; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--accent-color); }

.page-content { flex: 1; padding: 2rem 0; }

.btn {
	display: inline-block; padding: 0.75rem 1.5rem; background-color: var(--secondary-color);
	color: var(--white); border: none; border-radius: var(--border-radius); cursor: pointer;
	font-size: 1rem; font-weight: bold; text-decoration: none; text-align: center; transition: 0.3s;
}
.btn:hover { background-color: var(--primary-color); color: var(--white); }
.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #a3001e; }
.btn:disabled { background-color: #ccc; cursor: not-allowed; }

/* --- FORM E STRUTTURA --- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.form-control { width: 100%; padding: 0.75rem; border: 1px solid #ccc; border-radius: var(--border-radius); font-size: 1rem; }
.form-control:focus { outline: none; border-color: var(--secondary-color); box-shadow: 0 0 5px rgba(10, 147, 150, 0.5); }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.form-row .form-group { margin-bottom: 0; }
.form-col { flex: 1; min-width: 200px; }
.form-col-2 { flex: 2; min-width: 200px; }

.prenota-layout { display: flex; gap: 2rem; align-items: flex-start; flex-wrap: wrap; }
.prenota-col-sx { flex: 1.5; min-width: 300px; width: 100%; }
.prenota-col-dx { flex: 1; min-width: 300px; width: 100%; }

/* --- GRIGLIA POSTAZIONI (Visuale) --- */
.spots-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
	gap: 15px;
	margin-top: 1rem;
	justify-items: center;
}

.spot-tile {
	width: 55px;
	height: 55px;
	border-radius: 50%;
	text-align: center;
	font-weight: bold;
	font-size: 1.1rem;
	cursor: pointer;
	transition: all 0.2s;
	border: 3px solid transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	position: relative; /* Necessario per ancorare la spunta di notifica */
	/* overflow: hidden; RIMOSSO affinché la notifica possa sporgere */
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	background-color: var(--white);
}

.spot-icon {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%; /* Aggiunto qui per mantenere l'immagine perfettamente tonda */
}

/* Colori Dinamici Griglia */
.spot-available {
	background-color: var(--cal-colore-libero-bg);
	color: var(--cal-colore-libero-bordo);
	border-color: var(--cal-colore-libero-bordo);
}
.spot-available:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}
.spot-occupied {
	background-color: var(--cal-colore-occupato-bg);
	color: var(--cal-colore-occupato-bordo);
	border-color: var(--cal-colore-occupato-bordo);
	opacity: 0.6;
	cursor: not-allowed;
}
.spot-selected {
	background-color: var(--cal-colore-libero-bg);
	transform: scale(1.1);
	box-shadow: 0 4px 10px rgba(0,0,0,0.2);
	border-color: var(--cal-colore-selezionato-bordo);
}

/* --- BADGE SPUNTA VERDE STILE iOS --- */
.spot-tile.spot-selected::after {
	content: '✓'; 
	position: absolute;
	top: -4px;
	right: -4px;
	width: 22px;
	height: 22px;
	background-color: var(--badge-colore-bg); /* Reso dinamico */
	color: var(--badge-colore-testo); /* Reso dinamico */
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: bold;
	border: 2px solid var(--badge-colore-bordo); /* Reso dinamico */
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
	z-index: 10;
}

/* --- DASHBOARD TILES (Mattonelle) --- */
.dashboard-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.tile { background-color: var(--white); padding: 1.5rem 1rem; border-radius: var(--border-radius); box-shadow: 0 4px 6px rgba(0,0,0,0.05); text-align: center; text-decoration: none; color: var(--primary-color); font-weight: bold; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; border: 2px solid transparent; }
.tile:hover { transform: translateY(-5px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); border-color: var(--secondary-color); }
.tile.active { background-color: var(--primary-color); color: var(--white); border-color: var(--primary-color); }
.tile-icon { font-size: 2rem; }

/* --- CALENDARIO VISIVO --- */
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; background: var(--white); padding: 1rem; border-radius: var(--border-radius); box-shadow: 0 2px 4px rgba(0,0,0,0.05); flex-wrap: wrap; gap: 1rem;}
.calendar-header h3 { color: var(--primary-color); margin: 0; text-align: center; flex: 1; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; background: var(--white); padding: 1rem; border-radius: var(--border-radius); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.calendar-day-name { text-align: center; font-weight: bold; padding: 0.5rem; background: #e9ecef; color: var(--primary-color); border-radius: 4px; }
.calendar-day { min-height: 80px; padding: 0.5rem; border: 1px solid #dee2e6; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: 0.2s; position: relative; }
.calendar-day .day-num { font-size: 1.2rem; font-weight: bold; margin-bottom: 0.2rem; }
.calendar-day .day-status { font-size: 0.75rem; font-weight: bold; padding: 2px 6px; border-radius: 10px; color: #fff; line-height: 1.2; }

/* Colori Dinamici Calendario */
.day-available { background-color: var(--cal-colore-libero-bg); border-color: var(--cal-colore-libero-bordo); cursor: pointer; }
.day-available:hover { filter: brightness(0.95); transform: scale(1.02); z-index: 2; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.day-available .day-status { background-color: var(--cal-colore-libero-bordo); color: #fff; }

.day-full { background-color: var(--cal-colore-occupato-bg); border-color: var(--cal-colore-occupato-bordo); opacity: 0.8; }
.day-full .day-status { background-color: var(--cal-colore-occupato-bordo); color: #fff; }

.day-closed { background-color: var(--cal-colore-chiuso-bg); border-color: var(--cal-colore-chiuso-bordo); opacity: 0.7; cursor: not-allowed; }
.day-closed .day-status { background-color: var(--cal-colore-chiuso-bordo); color: #fff; }

.day-past { background-color: var(--cal-colore-chiuso-bg); opacity: 0.5; cursor: not-allowed; }
.day-empty { background-color: transparent; border: none; }

.day-selected { border: 3px solid var(--cal-colore-selezionato-bordo) !important; background-color: var(--cal-colore-selezionato-bg) !important; }

.site-footer { background-color: var(--primary-color); color: var(--text-light); text-align: center; padding: 1.5rem 0; margin-top: auto; }

/* --- RESPONSIVITÀ PER SMARTPHONE --- */
@media (max-width: 768px) {
	.nav-content { flex-direction: column; text-align: center; }
	.prenota-layout { flex-direction: column; gap: 1.5rem; }
	.prenota-col-sx, .prenota-col-dx { min-width: 100%; width: 100%; flex: auto; }
	
	.calendar-grid { gap: 2px; padding: 0.5rem; }
	.calendar-day-name { padding: 0.25rem; font-size: 0.8rem; }
	.calendar-day { min-height: 55px; padding: 0.25rem; }
	.calendar-day .day-num { font-size: 1rem; margin-bottom: 0; }
	.calendar-day .day-status { font-size: 0.6rem; padding: 1px 3px; border-radius: 4px; }
	
	.form-row { flex-direction: column; gap: 0; }
	.form-row .form-group { margin-bottom: 1.5rem; }
	
	.spots-grid { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
}

/* Aggiunta per il file css/style.css */
.spot-tile img {
	width: auto;
	height: auto;
	max-height: 35px;
	display: block;
	margin: 0 auto;
}

/* --- ICONE CIRCOLARI POSTAZIONI --- */
.spot-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	margin: 0 auto 5px auto;
	display: block;
	box-shadow: 0 2px 4px rgba(0,0,0,0.15);
	background-color: #fff; /* Sfondo bianco per icone trasparenti */
}
.spot-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 10px 5px;
}
