/**
 * Dynamic Google Maps Styles
 *
 * @package Dynamic_Google_Maps
 */

/* Map Container */
.dgm-map-container {
	width: 100%;
	min-height: 400px;
	position: relative;
	overflow: hidden;
}

.dgm-map {
	width: 100%;
	height: 100%;
	min-height: 400px;
	background: #e0e0e0;
	position: relative;
	z-index: 1;
}

/* Ensure Google Maps content is visible */
.dgm-map > div {
	position: absolute !important;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
}

/* Error Messages */
.dgm-error,
.dgm-no-markers {
	padding: 20px;
	background-color: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
	text-align: center;
	font-size: 14px;
	margin: 10px 0;
}

.dgm-error {
	background-color: #f8d7da;
	border-color: #f5c6cb;
	color: #721c24;
}

/* Info Window Styles */
.dgm-info-window {
	max-width: 300px;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* New custom template styles */
.map_post__image {
	width: 100%;
	margin: 0 0 12px 0;
	line-height: 0;
}

.map_post__image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px 4px 0 0;
}

.map_post__content {
	padding: 0;
}

.map_post__title {
	margin: 0 0 10px 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.map_post__title a {
	color: #1a73e8;
	text-decoration: none;
	transition: color 0.2s ease;
}

.map_post__title a:hover {
	color: #1557b0;
	text-decoration: underline;
}

.map_post__price {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #1a73e8;
	line-height: 1.4;
}

/* Legacy styles for backward compatibility */
.dgm-info-image {
	width: 100%;
	margin: 0 0 12px 0;
	line-height: 0;
}

.dgm-info-image img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px 4px 0 0;
}

.dgm-info-content {
	padding: 0;
}

.dgm-info-title {
	margin: 0 0 10px 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.dgm-info-title a {
	color: #1a73e8;
	text-decoration: none;
	transition: color 0.2s ease;
}

.dgm-info-title a:hover {
	color: #1557b0;
	text-decoration: underline;
}

.dgm-info-excerpt {
	margin: 0 0 12px 0;
	font-size: 13px;
	line-height: 1.5;
	color: #5f6368;
}

.dgm-info-button {
	display: inline-block;
	padding: 8px 16px;
	background-color: #1a73e8;
	color: #ffffff;
	text-decoration: none;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
	transition: background-color 0.2s ease;
}

.dgm-info-button:hover {
	background-color: #1557b0;
	color: #ffffff;
	text-decoration: none;
}

/* Google Maps InfoWindow overrides */
.gm-style .gm-style-iw-c {
	padding: 12px !important;
	max-width: 320px !important;
}

.gm-style .gm-style-iw-d {
	overflow: auto !important;
	max-height: 400px !important;
}

/* Close button styling */
.gm-style .gm-ui-hover-effect {
	top: 8px !important;
	right: 8px !important;
}

/* Marker Cluster Styles */
.cluster {
	background-color: #1a73e8;
	color: #ffffff;
	border-radius: 50%;
	font-weight: 600;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	.dgm-info-window {
		max-width: 250px;
	}

	.dgm-info-title,
	.map_post__title {
		font-size: 14px;
	}

	.dgm-info-excerpt {
		font-size: 12px;
	}

	.map_post__price {
		font-size: 16px;
	}

	.dgm-info-button {
		font-size: 12px;
		padding: 6px 12px;
	}

	.gm-style .gm-style-iw-c {
		max-width: 270px !important;
	}
}

/* Loading state */
.dgm-map-container.loading::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #1a73e8;
	border-radius: 50%;
	animation: dgm-spin 1s linear infinite;
	z-index: 10;
}

@keyframes dgm-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Elementor editor placeholder */
.elementor-editor-active .dgm-map.elementor-placeholder {
	border: 2px dashed #d5d5d5;
}

/* Accessibility improvements */
.dgm-map:focus {
	outline: 2px solid #1a73e8;
	outline-offset: 2px;
}

/* Print styles */
@media print {
	.dgm-map-container {
		page-break-inside: avoid;
	}
}
