/* GS Development Map – Frontend */
.gsdm-map-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5; color: #374151; position: relative;
}
.gsdm-initialized { min-height: auto !important; }

.gsdm-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 20px; color: #9ca3af; font-size: 14px; }
.gsdm-spinner { width: 20px; height: 20px; border: 2.5px solid #e5e7eb; border-top-color: #4CAF50; border-radius: 50%; animation: gsdm-spin 0.6s linear infinite; }
@keyframes gsdm-spin { to { transform: rotate(360deg); } }
.gsdm-error { padding: 40px 20px; text-align: center; color: #ef4444; font-size: 14px; }

.gsdm-header {
  position: relative; z-index: 60; padding: 12px 14px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
}
.gsdm-filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.gsdm-filter-toggle {
  display: none; align-items: center; gap: 5px; padding: 8px 14px;
  border: 1px solid #e5e7eb; border-radius: 20px; background: #fff;
  font-size: 13px; font-weight: 600; color: #6b7280; cursor: pointer; font-family: inherit;
}
.gsdm-filter-toggle.has-filters { border-color: rgba(22,163,74,0.4); background: rgba(22,163,74,0.06); color: #15803d; }

.gsdm-filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.gsdm-select-wrap select {
  padding: 8px 30px 8px 14px; border: 1px solid #e5e7eb; border-radius: 20px;
  background: #fff; font-size: 13px; color: #374151; cursor: pointer; font-family: inherit;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.gsdm-select-wrap select:focus { outline: none; border-color: #4CAF50; box-shadow: 0 0 0 2px rgba(22,163,74,0.15); }

.gsdm-clear-btn {
  padding: 8px 14px; border: 1px solid rgba(239,68,68,0.2); border-radius: 20px;
  background: rgba(239,68,68,0.04); font-size: 12px; font-weight: 600;
  color: #ef4444; cursor: pointer; font-family: inherit;
}

.gsdm-legend { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.gsdm-legend-dot { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #6b7280; }
.gsdm-legend-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.gsdm-count { font-size: 12px; color: #c0c6cc; white-space: nowrap; }

.gsdm-map-wrap {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid #e5e7eb; background: #dde3d5;
}

.gsdm-map-area {
  position: relative; cursor: grab; overflow: hidden;
}
.gsdm-map-area:active { cursor: grabbing; }

.gsdm-map-layer { position: relative; transform-origin: center center; will-change: transform; }
.gsdm-plan-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.gsdm-pins-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

.gsdm-zoom-ctrl {
  position: absolute; top: 12px; right: 12px; z-index: 50;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.95); border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden; backdrop-filter: blur(8px);
}
.gsdm-zoom-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; font-size: 18px; color: #6b7280;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.gsdm-zoom-btn:hover { background: #f3f4f6; color: #111; }
.gsdm-zoom-level { text-align: center; font-size: 10px; font-weight: 700; color: #9ca3af; padding: 2px 0 6px; border-top: 1px solid #f3f4f6; }
.gsdm-fullscreen-btn { border-top: 1px solid #e5e7eb; }
.gsdm-fullscreen-btn svg { pointer-events: none; }

.gsdm-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.55); backdrop-filter: blur(8px);
  color: #fff; font-size: 11px; font-weight: 500; padding: 6px 16px;
  border-radius: 20px; pointer-events: none; opacity: 0.85; white-space: nowrap;
}

/* Pins — counter-scale with zoom so pins stay consistent screen size */
.gsdm-pin {
  position: absolute; transform: translate(-50%, -50%) scale(var(--pin-scale, 1)) translateZ(0); z-index: 10;
  pointer-events: auto; cursor: pointer; transition: opacity 0.3s;
  will-change: transform; backface-visibility: hidden;
}
.gsdm-pin.is-dimmed { opacity: 0.15; pointer-events: none; }
.gsdm-pin.is-active { z-index: 30; }

.gsdm-pin-circle {
  display: flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px; box-sizing: border-box;
  border-radius: 999px;
  background: var(--pin-color); color: #fff; font-size: 10px; font-weight: 800;
  border: 2.5px solid rgba(255,255,255,0.8); box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s, box-shadow 0.2s; user-select: none;
  white-space: nowrap;
}
.gsdm-pin.is-active .gsdm-pin-circle {
  transform: scale(1.25); border-color: #fff;
  box-shadow: 0 0 14px color-mix(in srgb, var(--pin-color) 50%, transparent);
}

.gsdm-pin-tail {
  display: block; width: 0; height: 0; margin: -2px auto 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid var(--pin-color); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.gsdm-pin-pulse {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--pin-color); animation: gsdm-pulse 1.5s ease-out infinite; pointer-events: none;
}
@keyframes gsdm-pulse {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Desktop Popup */
.gsdm-popup { position: absolute; z-index: 60; pointer-events: auto; animation: gsdm-fadeIn 0.2s ease-out; }
.gsdm-popup.above { transform: translateX(-50%) translateY(calc(-100% - 24px)); }
.gsdm-popup.below { transform: translateX(-50%) translateY(24px); }
@keyframes gsdm-fadeIn { from { opacity: 0; } }

.gsdm-popup-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04);
  width: 290px; overflow: hidden;
}
.gsdm-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #f3f4f6;
}
.gsdm-status-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 20px; background: color-mix(in srgb, var(--c) 8%, transparent);
  color: var(--c); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.gsdm-status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

.gsdm-close-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: #f3f4f6;
  font-size: 16px; color: #9ca3af; cursor: pointer; display: flex;
  align-items: center; justify-content: center; line-height: 1;
}
.gsdm-close-btn:hover { background: #e5e7eb; color: #374151; }

.gsdm-popup-body { padding: 12px 14px 14px; }
.gsdm-popup-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.gsdm-popup-title { font-size: 17px; font-weight: 800; color: #111; margin: 0; line-height: 1.2; }
.gsdm-popup-type { font-size: 12px; color: #9ca3af; margin: 2px 0 0; }
.gsdm-popup-price { font-size: 19px; font-weight: 800; white-space: nowrap; }
.gsdm-popup-stats {
  display: flex; gap: 16px; margin: 10px 0; padding-top: 10px;
  border-top: 1px solid #f3f4f6; font-size: 13px; color: #6b7280;
}
.gsdm-popup-cta {
  display: flex; align-items: center; justify-content: center; width: 100%;
  padding: 10px 0; border: none; border-radius: 10px; font-size: 13px; font-weight: 700;
  color: #fff; text-decoration: none; cursor: pointer; font-family: inherit;
  transition: filter 0.15s; margin-top: 4px;
}
.gsdm-popup-cta:hover { filter: brightness(0.9); }

/* Mobile Bottom Sheet */
.gsdm-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 9998; transition: background 0.3s; }
.gsdm-backdrop.is-visible { background: rgba(0,0,0,0.35); }

.gsdm-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #fff; border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12); max-height: 65vh; overflow: auto;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.gsdm-sheet.is-visible { transform: translateY(0); }
.gsdm-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: #d1d5db; margin: 10px auto 4px; }
.gsdm-sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 20px 10px; }
.gsdm-sheet-body { padding: 0 20px 24px; }
.gsdm-sheet-body .gsdm-popup-title { font-size: 22px; }
.gsdm-sheet-body .gsdm-popup-price { font-size: 26px; margin: 12px 0 16px; }
.gsdm-sheet-body .gsdm-popup-stats { gap: 20px; margin-bottom: 14px; font-size: 14px; }
.gsdm-sheet-body .gsdm-popup-cta { padding: 14px 0; border-radius: 12px; font-size: 15px; margin-top: 6px; }

/* Responsive */
@media (max-width: 767px) {
  .gsdm-filter-toggle { display: flex; }
  .gsdm-filter-row { width: 100%; }
  .gsdm-legend { margin-left: 0; margin-top: 4px; width: 100%; }
  .gsdm-count { display: none; }
  .gsdm-pin-circle { min-width: 26px; height: 26px; padding: 0 6px; font-size: 9px; }
  .gsdm-zoom-ctrl { top: 8px; right: 8px; }
  .gsdm-zoom-btn { width: 34px; height: 34px; font-size: 16px; }
  .gsdm-hint { font-size: 10px; bottom: 6px; padding: 5px 12px; }
}

/* ─── Fullscreen Mode ─── */
.gsdm-fullscreen .gsdm-map-wrap {
  position: fixed; inset: 0; z-index: 99990;
  border-radius: 0; border: none;
  display: flex; flex-direction: column;
}
.gsdm-fullscreen .gsdm-header {
  flex-shrink: 0;
}
.gsdm-fullscreen .gsdm-map-area {
  flex: 1; min-height: 0;
}
.gsdm-fullscreen .gsdm-zoom-ctrl {
  z-index: 99991;
}
.gsdm-fullscreen .gsdm-hint {
  z-index: 99991;
}
