/* ================= HARİTA UI + POI (Mağaza / AVM) KATMANI ================= */

/* Widget biraz daha ferah ve büyük */
.map-widget {
  width: 400px;
  height: 320px;
}
.map-widget.collapsed:hover {
  width: 520px;
  height: 400px;
}
.map-widget.expanded {
  width: min(760px, 92vw);
  height: min(620px, 82vh);
}

.map-widget-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.map-header-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-toggle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
.poi-toggle.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 14px var(--primary-glow);
}

/* ---------- Arama kutusu ---------- */
.map-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.map-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: inherit;
}
.map-search-bar input::placeholder { color: var(--text-tertiary); }

.map-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 8px;
  right: 8px;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(10, 15, 26, 0.97);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  box-shadow: var(--shadow-xl);
  z-index: 1200;
}
.map-search-results.visible { display: block; }

.search-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.35;
}
.search-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.search-item.muted { cursor: default; color: var(--text-tertiary); }
.search-item i { margin-top: 2px; color: var(--primary); }

/* ---------- POI filtre çubuğu ---------- */
.poi-filter-bar {
  display: none;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}
.poi-filter-bar.visible { display: flex; }
.poi-filter-bar::-webkit-scrollbar { height: 4px; }
.poi-filter-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }

.poi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.poi-chip:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.poi-chip.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Harita alanı ---------- */
.map-render-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}
.map-render-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.poi-status,
.map-coord-readout {
  position: absolute;
  z-index: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(6, 10, 19, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.71rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.poi-status { top: 10px; left: 10px; }
.poi-status[data-state="loading"] { color: #38bdf8; }
.poi-status[data-state="zoom"] { color: #fbbf24; }
.poi-status[data-state="error"] { color: #f87171; }
.map-coord-readout { bottom: 10px; left: 10px; color: #a5b4fc; }

/* ---------- POI işaretçileri ---------- */
.poi-marker-wrap { background: none !important; border: none !important; }

.poi-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--poi-color, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}
.poi-marker.poi-big {
  width: 30px;
  height: 30px;
  font-size: 13px;
  margin: -3px;
}
.poi-marker-wrap:hover .poi-marker {
  transform: scale(1.25);
  z-index: 900;
}

.poi-label {
  position: absolute;
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
  pointer-events: none;
}

/* ---------- POI popup ---------- */
.poi-popup .leaflet-popup-content-wrapper {
  background: rgba(10, 15, 26, 0.97);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
}
.poi-popup .leaflet-popup-content { margin: 12px 14px; font-family: inherit; }
.poi-popup .leaflet-popup-tip { background: rgba(10, 15, 26, 0.97); }

.poi-popup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.poi-popup-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: var(--poi-color, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.poi-popup-head strong { display: block; font-size: 0.88rem; line-height: 1.2; }
.poi-popup-head small { color: var(--text-tertiary); font-size: 0.7rem; text-transform: capitalize; }

.poi-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin: 4px 0;
}
.poi-row i { width: 13px; color: var(--text-tertiary); }
.poi-row a { color: #818cf8; text-decoration: none; }

.poi-guess-btn {
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter var(--transition-fast);
}
.poi-guess-btn:hover { filter: brightness(1.15); }

/* ---------- Leaflet kontrolleri koyu tema ---------- */
.leaflet-control-zoom a {
  background: rgba(10, 15, 26, 0.9) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(8px);
}
.leaflet-control-zoom a:hover { background: var(--primary) !important; color: #fff !important; }
.leaflet-control-scale-line {
  background: rgba(10, 15, 26, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  color: #cbd5e1;
}

/* ---------- Mobil ---------- */
@media (max-width: 768px) {
  .map-widget { width: 280px; height: 260px; }
  .map-widget.expanded { width: 94vw; height: 70vh; }
  .map-layer-selector .layer-btn span { display: none; }
  .poi-chip span { display: none; }
  .poi-chip { padding: 6px 9px; }
  .poi-label { display: none; }
}
