/* Base styles */
body {
	margin: 0;
	padding: 0;
	font-family: Arial, sans-serif;
	background-color: #f5f5f5;
	min-height: 100vh;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	position: relative;
}

/* Controls Toolbar */
.controls-toolbar {
	display: flex;
	flex-direction: column;
	gap: 15px;
	margin-bottom: 20px;
}

/* Color picker */
.color-picker {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
}

.color-option,
.control-button {
	padding: 10px 15px;
	border: 2px solid #666;
	border-radius: 5px;
	font-weight: bold;
	cursor: pointer;
	transition: all 0.3s ease;
	min-width: 100px;
	text-align: center;
	background-color: #f0f0f0;
}

.color-option:hover,
.control-button:hover {
	transform: scale(1.05);
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
	border-color: #000;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.color-option[data-color] {
	color: #000;
}

/* Map container */
.map-container {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background-color: #ffffff;
	border: 2px solid #333;
	overflow: hidden;
	margin-bottom: 20px;
}

/* SVG Municipalities */
.municipality {
	cursor: pointer;
	transition: fill 0.3s ease;
}

/* Municipality text labels (automatic and unique) */
.municipality-label {
	font-size: 10px;
	font-family: Arial, Helvetica, sans-serif;
	fill: #333333;
	text-anchor: middle;
	dominant-baseline: middle;
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	paint-order: stroke;
	stroke: #ffffff;
	stroke-width: 2.5px; /* Ligeramente más grueso para destacar */
	stroke-linecap: butt;
	stroke-linejoin: miter;
	font-weight: bold; /* Hacer el texto un poco más grueso */
}

/* Print button */
.print-button {
	position: absolute;
	right: 20px;
	top: 20px;
	padding: 12px 24px;
	background-color: #4caf50;
	color: white;
	border: none;
	border-radius: 5px;
	font-size: 16px;
	cursor: pointer;
	z-index: 10;
	transition: all 0.3s ease;
}

.print-button:hover {
	background-color: #45a049;
}

/* Print styles */
@media print {
	body {
		margin: 0;
		padding: 0;
	}

	.container {
		padding: 0;
	}

	body * {
		visibility: hidden;
	}

	.map-container,
	.map-container * {
		visibility: visible;
	}
	.map-container svg text.municipality-label {
		visibility: visible !important;
		fill: #000000 !important;
		stroke: none !important;
	}

	.map-container {
		position: absolute;
		left: 0;
		top: 0;
		width: 297mm;
		height: 200mm;
		margin: 0 auto;
		overflow: visible;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	svg {
		width: 100%;
		height: 100%;
		display: block;
		shape-rendering: crispEdges;
		image-rendering: pixelated;
		max-width: 100%;
		max-height: 100%;
	}

	.controls-toolbar,
	.print-button {
		display: none;
	}

	.municipality-label {
		font-size: 12px !important;
		font-weight: 200;
	}

	.progress-indicator.final {
		display: none;
	}
}

/* Loading indicator */
.loading-indicator {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: linear-gradient(to right, #4caf50, #81c784);
	animation: loading 2s infinite;
	z-index: 1000;
	display: none;
}

@keyframes loading {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

body.loading .loading-indicator {
	display: block;
}

/* Status messages */
.progress-indicator {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	background-color: rgba(255, 255, 255, 0.95);
	border: 1px solid #ccc;
	border-radius: 5px;
	text-align: center;
	font-size: 13px;
	padding-top: 1px;
	padding-bottom: 1px;
	margin: 0;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	z-index: 100;
}

.progress-indicator.final {
	background-color: #e8f5e9;
	border: 1px solid #c8e6c9;
	font-weight: bold;
	padding-top: 1px;
	padding-bottom: 1px;
}

/* Tooltip */
.map-tooltip {
	position: absolute;
	background-color: rgba(0, 0, 0, 0.7);
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	pointer-events: none;
	z-index: 10000;
	font-size: 12px;
	white-space: nowrap;
}
