/**
 * fleet-map.css - Stili per la mappa flotta GPS/OBD2
 * Sistema parallelo, non modifica gli stili della mappa catastale
 */

/* ==========================================
   CONTENITORE MAPPA
   ========================================== */
.fleetmap {
	width: 100%;
	min-height: 500px;
	height: calc(100vh - 220px);
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid #dee2e6;
}

/* ==========================================
   MARKER VEICOLO
   ========================================== */
.fleet-vehicle-marker {
	background: none !important;
	border: none !important;
}

.fleet-marker-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 16px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
	border: 2px solid rgba(255,255,255,0.9);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fleet-marker-icon:hover {
	transform: scale(1.15);
	box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.fleet-marker-label {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: #2c3e50;
	text-shadow: 1px 1px 2px rgba(255,255,255,0.9), -1px -1px 2px rgba(255,255,255,0.9);
	margin-top: 2px;
	white-space: nowrap;
}

/* Marker con allarme - effetto pulse */
.fleet-marker-pulse .fleet-marker-icon {
	animation: fleetPulse 2s infinite;
}

@keyframes fleetPulse {
	0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.7); }
	70% { box-shadow: 0 0 0 15px rgba(231,76,60,0); }
	100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

/* ==========================================
   POPUP VEICOLO
   ========================================== */
.fleet-vehicle-popup .leaflet-popup-content-wrapper {
	border-radius: 8px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.fleet-vehicle-popup .leaflet-popup-content {
	margin: 0;
	min-width: 240px;
}

.fleet-popup-header {
	background: linear-gradient(135deg, #2c3e50, #34495e);
	color: #fff;
	padding: 10px 14px;
}

.fleet-popup-header h3 {
	margin: 0 0 4px 0;
	font-size: 15px;
	font-weight: 600;
}

.fleet-popup-body {
	padding: 10px 14px;
}

.fleet-popup-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 0;
	font-size: 13px;
	color: #2c3e50;
}

.fleet-popup-row i {
	width: 18px;
	text-align: center;
	color: #7f8c8d;
	font-size: 13px;
}

.fleet-popup-row hr {
	border: none;
	border-top: 1px solid #ecf0f1;
	margin: 6px 0;
}

.fleet-popup-alert {
	color: #e74c3c !important;
	font-weight: 600;
}

.fleet-popup-alert i {
	color: #e74c3c !important;
}

/* ==========================================
   LEGENDA
   ========================================== */
.fleet-legend {
	background: rgba(255,255,255,0.95);
	padding: 10px 14px;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	font-size: 13px;
	line-height: 1.6;
}

.fleet-legend h4 {
	margin: 0 0 6px 0;
	font-size: 14px;
	font-weight: 600;
	color: #2c3e50;
	border-bottom: 1px solid #ecf0f1;
	padding-bottom: 4px;
}

.fleet-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 2px 0;
}

.fleet-legend-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

/* ==========================================
   TRACCIA PERCORSO
   ========================================== */
.fleet-track-marker {
	background: none !important;
	border: none !important;
}

.fleet-track-start {
	color: #27ae60;
	font-size: 20px;
	text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.fleet-track-end {
	color: #e74c3c;
	font-size: 20px;
	text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ==========================================
   TOOLBAR FILTRI
   ========================================== */
.fleet-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 8px 0;
}

.fleet-toolbar .p4a_toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* ==========================================
   PANNELLO INFO VEICOLO (laterale)
   ========================================== */
.fleet-info-panel {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1000;
	background: rgba(255,255,255,0.95);
	border-radius: 8px;
	padding: 14px;
	min-width: 260px;
	max-width: 320px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.15);
	display: none;
}

.fleet-info-panel.active {
	display: block;
}

.fleet-info-panel h3 {
	margin: 0 0 8px 0;
	font-size: 16px;
	color: #2c3e50;
}

.fleet-info-close {
	position: absolute;
	top: 8px;
	right: 10px;
	cursor: pointer;
	color: #95a5a6;
	font-size: 18px;
}

.fleet-info-close:hover {
	color: #e74c3c;
}

.fleet-info-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	border-bottom: 1px solid #f5f5f5;
	font-size: 13px;
}

.fleet-info-label {
	color: #7f8c8d;
	font-weight: 500;
}

.fleet-info-value {
	color: #2c3e50;
	font-weight: 600;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 991px) {
	.fleetmap {
		height: calc(100vh - 260px);
		min-height: 350px;
	}

	.fleet-info-panel {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		max-width: 100%;
		border-radius: 12px 12px 0 0;
		max-height: 40vh;
		overflow-y: auto;
	}
}

@media (max-width: 575px) {
	.fleetmap {
		height: calc(100vh - 280px);
		min-height: 280px;
	}

	.fleet-marker-label {
		font-size: 10px;
	}

	.fleet-marker-icon {
		width: 28px;
		height: 28px;
		font-size: 13px;
	}
}
