/* ============================================================================
   components/map/map.css — Harita ekranı
   Sağlayıcıdan bağımsız: kutucuklar düz <img>, pinler düz DOM. Hiçbir harita
   kütüphanesinin sınıf adına bağımlı değil.
   ============================================================================ */

.map-screen {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
}

.map-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 16px; color: var(--muted);
}

/* ───────────────────────────── araç çubuğu ───────────────────────────── */
.map-toolbar {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 3;
}
.map-layers, .map-filters, .map-radius {
  display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.map-layers::-webkit-scrollbar,
.map-filters::-webkit-scrollbar,
.map-radius::-webkit-scrollbar { display: none; }

/* Ölçüm: filtre çipleri 32px yüksekliğindeydi — dokunma eşiğinin (44px)
   çok altında ve harita ekranındaki BİRİNCİL kontrol. Yazı boyutu aynı
   kaldı; yalnızca dikey dolgu arttı. */
.map-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 14px; min-height: 44px;
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.map-chip:hover { border-color: var(--brand); }
.map-chip.is-active {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.map-chip--sm { padding: 8px 12px; min-height: 40px; font-size: 12px; }

.map-select {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* ───────────────────────────── harita sahnesi ───────────────────────── */
/* Yükseklik viewport'a göre sabitlenir. `flex:1` denendi ve ÇALIŞMADI:
   #content kaydırılabilir bir kapsayıcı olduğu için yüzde yükseklik çözülmüyor,
   sahne tüm alanı yiyip sonuç listesini ekranın altına itiyordu. */
.map-stage {
  position: relative;
  flex: 0 0 auto;
  height: 52vh;
  min-height: 240px;
  overflow: hidden;
  background: #e8eaed;
}
.map-canvas {
  position: absolute; inset: 0;
  touch-action: none;              /* sürükleme bizim; tarayıcı kaydırmasın */
  cursor: grab;
  overflow: hidden;
}
.map-canvas.is-dragging { cursor: grabbing; }

.map-tiles, .map-overlay, .map-pins {
  position: absolute; inset: 0;
  pointer-events: none;
}
.map-pins { pointer-events: auto; }

.map-tile {
  position: absolute;
  display: block;
  user-select: none; -webkit-user-drag: none;
  image-rendering: -webkit-optimize-contrast;
}

.map-attr {
  position: absolute; right: 4px; bottom: 4px;
  font-size: 10px; color: #333;
  background: rgba(255,255,255,.72);
  padding: 2px 6px; border-radius: 4px;
  pointer-events: none;
  max-width: 70%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* yarıçap halkası */
.map-ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px dashed var(--brand);
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  pointer-events: none;
}

/* yoğunluk hücresi */
.map-heat {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 87, 34, .9) 0%,
    rgba(255, 152, 0, .55) 45%,
    rgba(255, 193, 7, 0) 72%);
  pointer-events: none;
}

/* kendi konumun */
.map-me {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(26,115,232,.28);
  pointer-events: none;
}

/* ───────────────────────────── pinler ───────────────────────────── */
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  border: 0; background: none; padding: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.map-pin__dot {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 2px;
  transform: rotate(45deg);
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.32);
  color: #fff; font-size: 11px; font-weight: 800;
}
.map-pin__dot > * { transform: rotate(-45deg); }
.map-pin.is-selected .map-pin__dot {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  z-index: 2;
}
.map-pin:focus-visible .map-pin__dot { outline: 3px solid var(--brand); }

/* pin tipleri — tek renk kaynağı */
.map-pin--live      .map-pin__dot { background: #e53935; animation: mapPulse 1.8s infinite; }
.map-pin--full      .map-pin__dot { background: #757575; }
.map-pin--sponsored .map-pin__dot { background: #f9a825; color: #3a2c00; }
.map-pin--past      .map-pin__dot { background: #9e9e9e; opacity: .75; }
.map-pin--community .map-pin__dot { background: #00897b; border-radius: 50%; transform: none; }
.map-pin--community .map-pin__dot > * { transform: none; }
.map-pin--large     .map-pin__dot { background: #00695c; border-radius: 50%; transform: none;
  width: 32px; height: 32px; }
.map-pin--large     .map-pin__dot > * { transform: none; }

@keyframes mapPulse {
  0%, 100% { box-shadow: 0 2px 6px rgba(0,0,0,.32), 0 0 0 0 rgba(229,57,53,.5); }
  50%      { box-shadow: 0 2px 6px rgba(0,0,0,.32), 0 0 0 9px rgba(229,57,53,0); }
}

.map-pin__badge {
  position: absolute; top: -6px; right: -10px;
  background: #fff; color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px;
  min-width: 16px;
}

/* ───────────────────────────── kontroller ───────────────────────────── */
.map-controls {
  position: absolute; right: 10px; top: 10px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 2;
}
.map-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 19px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  display: grid; place-items: center;
}
.map-btn:hover { border-color: var(--brand); color: var(--brand); }
.map-btn--locate { font-size: 17px; }

.map-busy {
  position: absolute; left: 50%; top: 12px;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  z-index: 2;
}

.map-prompt {
  position: absolute; inset: auto 16px 16px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 6px 22px rgba(0,0,0,.18);
  z-index: 3;
}
.map-prompt p { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }

/* ───────────────────────────── alt liste ───────────────────────────── */
.map-sheet {
  flex: 1 1 auto;
  background: var(--card);
  border-top: 1px solid var(--line);
  position: relative;
}
.map-sheet--msg {
  padding: 16px; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.map-sheet__head {
  padding: 10px 14px 6px;
  font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}

.map-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}
.map-row:last-child { border-bottom: 0; }
.map-row:hover { background: var(--bg); }
.map-row__dot {
  flex: 0 0 auto;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
}
.map-row__dot.map-pin--live { background: #e53935; }
.map-row__dot.map-pin--full { background: #757575; }
.map-row__dot.map-pin--sponsored { background: #f9a825; }
.map-row__dot.map-pin--community,
.map-row__dot.map-pin--large { background: #00897b; }
.map-row__body { flex: 1 1 auto; min-width: 0; }
.map-row__title {
  display: block; font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-row__meta {
  display: block; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-row__dist {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--brand);
}

/* seçili pin kartı */
.map-sheet--detail { padding: 14px 16px 16px; }
.map-sheet__close {
  position: absolute; right: 10px; top: 8px;
  width: 30px; height: 30px;
  border: 0; background: none;
  font-size: 22px; line-height: 1; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.map-detail__title { font-size: 17px; font-weight: 800; padding-right: 34px; }
.map-detail__meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.map-detail__addr { font-size: 13px; margin-top: 6px; }
.map-detail__why {
  display: inline-block; margin-top: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 3px 9px; border-radius: 999px;
}
.map-detail__actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
}
.map-detail__actions .btn { flex: 0 0 auto; text-decoration: none; }

/* geniş ekran: liste sağda sabit sütun */
@media (min-width: 900px) {
  .map-screen { flex-direction: row; flex-wrap: wrap; }
  .map-toolbar { flex: 1 0 100%; }
  .map-stage { flex: 1 1 60%; height: 70vh; }
  .map-sheet {
    flex: 0 0 340px;
    height: 70vh; overflow-y: auto;
    border-top: 0; border-left: 1px solid var(--line);
  }
}
