/* ==========================================================================
   GDCONF Event Map — frontend styles
   ========================================================================== */

/* ── Block wrapper ────────────────────────────────────────────────────────── */

.gdconf-event-map-block {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	color: #1e293b;
}

/* ── Filter bar ───────────────────────────────────────────────────────────── */

.gdconf-map-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px 14px;
	padding: 12px 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-bottom: none;
	border-radius: 8px 8px 0 0;
}

.gdconf-map-filter-group {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.gdconf-map-filter-label {
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #64748b;
	line-height: 1;
}

.gdconf-map-select {
	height: 34px;
	padding: 0 26px 0 10px;
	font-size: 13px;
	font-family: inherit;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 8px center;
	-webkit-appearance: none;
	appearance: none;
	color: #1e293b;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.gdconf-map-select:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
	outline: none;
}

.gdconf-map-near-me {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 34px;
	padding: 0 12px;
	font-size: 13px;
	font-family: inherit;
	font-weight: 500;
	color: #2563eb;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	cursor: pointer;
	transition: background .12s;
	white-space: nowrap;
	margin-top: auto; /* align to bottom with filter groups */
}
.gdconf-map-near-me:hover { background: #dbeafe; }
.gdconf-map-near-me .dashicons { font-size: 15px; width: 15px; height: 15px; }

.gdconf-map-count {
	margin-top: auto;
	font-size: 12.5px;
	color: #94a3b8;
	margin-left: auto;
	white-space: nowrap;
	align-self: flex-end;
}

/* ── Map canvas ───────────────────────────────────────────────────────────── */

.gdconf-map-canvas {
	width: 100%;
	background: #e8eef4;
	border: 1px solid #e2e8f0;
	border-radius: 0 0 8px 8px;
}

/* Override Leaflet's default marker paths to our local copy */
.leaflet-default-icon-path {
	background-image: none;
}

/* ── Custom SVG markers ───────────────────────────────────────────────────── */

.gdconf-map-marker,
.gdconf-map-cluster {
	background: none !important;
	border: none !important;
}
.gdconf-map-marker svg,
.gdconf-map-cluster svg {
	display: block;
	filter: drop-shadow(0 1px 3px rgba(0,0,0,.25));
}

/* ── Leaflet popup overrides ──────────────────────────────────────────────── */

.leaflet-popup-content-wrapper {
	padding: 0 !important;
	border-radius: 10px !important;
	box-shadow: 0 4px 20px rgba(0,0,0,.16) !important;
	overflow: hidden;
}
.leaflet-popup-content {
	margin: 0 !important;
	width: auto !important;
}
.leaflet-popup-tip-container { margin-top: -1px; }

/* ── Popup card ───────────────────────────────────────────────────────────── */

.gdconf-map-popup {
	min-width: 240px;
	max-width: 320px;
	font-family: inherit;
	font-size: 13px;
	color: #1e293b;
}

.gdconf-map-popup__header {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px 8px;
}

.gdconf-map-popup__logo {
	width: 36px;
	height: 36px;
	object-fit: contain;
	border-radius: 4px;
	flex-shrink: 0;
	background: #f1f5f9;
}

.gdconf-map-popup__meta { flex: 1; min-width: 0; }

.gdconf-map-popup__title {
	display: block;
	font-size: 13.5px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}

.gdconf-map-popup__date {
	font-size: 12px;
	color: #64748b;
	margin-top: 2px;
}

.gdconf-map-popup__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px 14px 6px;
}

.gdconf-map-popup__row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 3px 14px;
	font-size: 12px;
	color: #475569;
}

.gdconf-map-popup__footer {
	padding: 8px 14px 12px;
	border-top: 1px solid #f1f5f9;
	margin-top: 4px;
}

.gdconf-map-popup__btn {
	display: inline-flex;
	align-items: center;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: #2563eb;
	border-radius: 5px;
	text-decoration: none;
	transition: background .12s;
}
.gdconf-map-popup__btn:hover { background: #1d4ed8; color: #fff; text-decoration: none; }

/* Multi-event popup */
.gdconf-map-popup--multi .gdconf-map-popup__multi-header {
	padding: 10px 14px 6px;
	font-weight: 700;
	font-size: 13px;
	color: #0f172a;
	border-bottom: 1px solid #f1f5f9;
}
.gdconf-map-popup__multi-count {
	font-size: 11px;
	font-weight: 600;
	color: #2563eb;
	background: #eff6ff;
	border-radius: 4px;
	padding: 1px 6px;
	margin-left: 4px;
}
.gdconf-map-popup__multi-list { max-height: 260px; overflow-y: auto; }
.gdconf-map-popup__multi-item {
	padding: 7px 14px;
	border-bottom: 1px solid #f8fafc;
	font-size: 12.5px;
}
.gdconf-map-popup__multi-item:last-child { border-bottom: none; }
.gdconf-map-popup__mini-link {
	font-size: 11px;
	color: #2563eb;
	text-decoration: none;
	margin-left: 5px;
}

/* ── Virtual events list ─────────────────────────────────────────────────── */

.gdconf-map-virtual {
	margin-top: 24px;
}

.gdconf-map-virtual__title {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 15px;
	font-weight: 700;
	color: #334155;
	margin: 0 0 14px;
}
.gdconf-map-virtual__title .dashicons { color: #2563eb; }

.gdconf-map-virtual__list {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 10px;
}

.gdconf-map-virtual__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 13px;
}

.gdconf-map-virtual__logo {
	width: 36px;
	height: 36px;
	object-fit: contain;
	border-radius: 4px;
	background: #fff;
	flex-shrink: 0;
}

.gdconf-map-virtual__info {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}
.gdconf-map-virtual__info strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Dark mode ────────────────────────────────────────────────────────────── */

[data-color-mode="dark"] .gdconf-map-filters {
	background: #1e293b;
	border-color: #334155;
}
[data-color-mode="dark"] .gdconf-map-filter-label { color: #94a3b8; }
[data-color-mode="dark"] .gdconf-map-select { background-color: #0f172a; border-color: #475569; color: #e2e8f0; }
[data-color-mode="dark"] .gdconf-map-count  { color: #475569; }
[data-color-mode="dark"] .gdconf-map-canvas { border-color: #334155; }
[data-color-mode="dark"] .gdconf-map-popup  { background: #1e293b; color: #e2e8f0; }
[data-color-mode="dark"] .gdconf-map-popup__title { color: #f1f5f9; }
[data-color-mode="dark"] .gdconf-map-popup__date  { color: #94a3b8; }
[data-color-mode="dark"] .leaflet-popup-content-wrapper { background: #1e293b !important; border: 1px solid #334155 !important; }
[data-color-mode="dark"] .leaflet-popup-tip { background: #1e293b !important; }
[data-color-mode="dark"] .gdconf-map-virtual__item { background: #1e293b; border-color: #334155; }
[data-color-mode="dark"] .gdconf-map-virtual__title { color: #e2e8f0; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
	.gdconf-map-filters { gap: 8px; padding: 10px 12px; }
	.gdconf-map-count   { display: none; }
	.gdconf-map-virtual__list { grid-template-columns: 1fr; }
}

/* ── Editor placeholder ───────────────────────────────────────────────────── */

.gdconf-map-editor-preview {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 24px 28px;
	background: #f8fafc;
	border: 2px dashed #cbd5e1;
	border-radius: 10px;
	color: #475569;
}
.gdconf-map-editor-preview .dashicons { font-size: 36px; width: 36px; height: 36px; color: #2563eb; }
.gdconf-map-editor-label { font-size: 15px; font-weight: 600; }
.gdconf-map-editor-hint  { font-size: 12px; color: #94a3b8; margin-top: 4px; }
