/**
 * Elementor OpenStreetMap Widget Frontend Styles
 */

/**
 * Map Container
 */
.elementor-osm-map-container {
	width: 100%;
	height: 400px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background-color: #f5f5f5;
	position: relative;
	overflow: hidden;
}

/**
 * Widget Title
 */
.elementor-osm-widget-title {
	margin: 0 0 15px 0;
	padding: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
	color: #333;
}

/**
 * Leaflet Map Popup Styles
 */
.elementor-osm-map-container .leaflet-popup-content-wrapper {
	background-color: #fff;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.elementor-osm-map-container .leaflet-popup-content {
	margin: 0;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
}

.elementor-osm-map-container .leaflet-popup-tip-container {
	width: 30px;
	height: 15px;
	position: absolute;
	left: 50%;
	margin-left: -15px;
	overflow: hidden;
	bottom: -1px;
}

.elementor-osm-map-container .leaflet-popup-tip {
	width: 15px;
	height: 15px;
	padding: 1px;
	margin: -10px auto 0;
	transform: rotate(45deg);
	background-color: #fff;
	box-shadow: -1px -1px 1px rgba(0, 0, 0, 0.1);
}

/**
 * Leaflet Control Styles
 */
.elementor-osm-map-container .leaflet-control {
	background-color: #fff;
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.elementor-osm-map-container .leaflet-control-zoom {
	border: none;
}

.elementor-osm-map-container .leaflet-control-zoom a {
	width: 36px;
	height: 36px;
	line-height: 36px;
	font-size: 16px;
	background-color: #fff;
	color: #333;
	border: none;
	border-bottom: 1px solid #ddd;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.elementor-osm-map-container .leaflet-control-zoom a:last-child {
	border-bottom: none;
	border-radius: 0 0 4px 4px;
}

.elementor-osm-map-container .leaflet-control-zoom a:first-child {
	border-radius: 4px 4px 0 0;
}

.elementor-osm-map-container .leaflet-control-zoom a:hover {
	background-color: #f5f5f5;
}

/* Fallback icon for layer switcher in case Leaflet sprite is unavailable. */
.elementor-osm-map-container .leaflet-control-layers-toggle {
	width: 36px;
	height: 36px;
	background-size: 18px 18px;
	background-position: center;
	background-repeat: no-repeat;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23333" stroke-width="2"><path d="M12 3 3 8l9 5 9-5-9-5Z"/><path d="m3 12 9 5 9-5"/><path d="m3 16 9 5 9-5"/></svg>');
}

/* Fallback icon styling for locate control. */
.elementor-osm-map-container .leaflet-control-locate a {
	width: 36px;
	height: 36px;
	line-height: 36px;
	text-align: center;
	color: #333;
}

.elementor-osm-map-container .leaflet-control-locate .leaflet-control-locate-location-arrow {
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: transparent;
	margin-top: 10px;
	margin-left: 10px;
	position: relative;
}

.elementor-osm-map-container .leaflet-control-locate .leaflet-control-locate-location-arrow::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4px;
	height: 4px;
	background: currentColor;
	border-radius: 50%;
	transform: translate(-50%, -50%);
}

/**
 * Leaflet Attribution
 */
.elementor-osm-map-container .leaflet-control-attribution {
	background-color: rgba(255, 255, 255, 0.8);
	font-size: 11px;
	line-height: 1.4;
	padding: 2px 5px;
	border-radius: 0;
}

.elementor-osm-map-container .leaflet-control-attribution a {
	color: #0078a8;
	text-decoration: none;
}

.elementor-osm-map-container .leaflet-control-attribution a:hover {
	color: #0059a0;
	text-decoration: underline;
}

/**
 * Leaflet Geocoder Control
 */
.elementor-osm-map-container .leaflet-control-geocoder {
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.elementor-osm-map-container .leaflet-control-geocoder-icon {
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg>');
	background-size: 16px 16px;
	background-repeat: no-repeat;
	background-position: center;
	width: 36px;
	height: 36px;
	display: block;
	cursor: pointer;
}

.elementor-osm-map-container .leaflet-control-geocoder-form input {
	border-radius: 4px 4px 0 0;
	border: 1px solid #ddd;
	padding: 8px 12px;
	font-size: 14px;
	width: 100%;
	box-sizing: border-box;
}

.elementor-osm-map-container .leaflet-control-geocoder-form input:focus {
	outline: none;
	border-color: #0078a8;
	box-shadow: 0 0 4px rgba(0, 120, 168, 0.3);
}

/**
 * Responsive Design
 */
@media (max-width: 768px) {
	.elementor-osm-widget-title {
		font-size: 16px;
		margin-bottom: 10px;
	}

	.elementor-osm-map-container {
		min-height: 300px;
	}

	.elementor-osm-map-container .leaflet-control-zoom a {
		width: 32px;
		height: 32px;
		line-height: 32px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.elementor-osm-widget-title {
		font-size: 14px;
		margin-bottom: 8px;
	}

	.elementor-osm-map-container {
		min-height: 250px;
	}

	.elementor-osm-map-container .leaflet-control-zoom a {
		width: 28px;
		height: 28px;
		line-height: 28px;
		font-size: 12px;
	}
}

/**
 * Dark Mode Support (Optional)
 */
@media (prefers-color-scheme: dark) {
	.elementor-osm-map-container {
		border-color: #333;
		background-color: #1a1a1a;
	}

	.elementor-osm-widget-title {
		color: #f5f5f5;
	}

	.elementor-osm-map-container .leaflet-popup-content-wrapper,
	.elementor-osm-map-container .leaflet-popup-tip {
		background-color: #2a2a2a;
	}

	.elementor-osm-map-container .leaflet-popup-content {
		color: #f5f5f5;
	}

	.elementor-osm-map-container .leaflet-control {
		background-color: #2a2a2a;
	}

	.elementor-osm-map-container .leaflet-control-zoom a {
		background-color: #2a2a2a;
		color: #f5f5f5;
		border-bottom-color: #444;
	}

	.elementor-osm-map-container .leaflet-control-layers-toggle {
		filter: brightness(0) invert(1);
	}

	.elementor-osm-map-container .leaflet-control-zoom a:hover {
		background-color: #3a3a3a;
	}

	.elementor-osm-map-container .leaflet-control-attribution {
		background-color: rgba(0, 0, 0, 0.5);
	}

	.elementor-osm-map-container .leaflet-control-attribution a {
		color: #4da6ff;
	}

	.elementor-osm-map-container .leaflet-control-attribution a:hover {
		color: #80c0ff;
	}
}
