/* =============================================================
   PRESS — Measurement Tools
   ============================================================= */

/* --- Measure toolbar container (below zoom) --- */
.measure-toolbar {
  position: absolute;
  bottom: 20px;
  left: 15px;
  z-index: 500;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.measure-toolbar > * {
  pointer-events: auto;
}

/* --- Toggle button --- */
.measure-toggle-btn {
  width: 32px;
  height: 32px;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.measure-toggle-btn:hover {
  background: #f4f4f4;
}

.measure-toggle-btn.active {
  background: #3a86c9;
  border-color: #3a86c9;
  color: #fff;
}

.measure-toggle-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Tool panel (expands to the right) --- */
.measure-tool-panel {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  border-width: 0;
  transition: max-width 0.2s ease, opacity 0.15s ease, padding 0.2s ease, border-width 0.15s ease;
}

.measure-tool-panel.open {
  max-width: 280px;
  opacity: 1;
  padding: 4px 5px;
  border-width: 1px;
}

/* --- Tool buttons --- */
.measure-tool-btn {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 3px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}

.measure-tool-btn:hover {
  background: #f0f0f0;
}

.measure-tool-btn.active {
  background: #e8f0fa;
  color: #3a86c9;
}

.measure-tool-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Separator --- */
.measure-separator {
  width: 1px;
  height: 20px;
  background: #ddd;
  align-self: center;
  margin: 0 3px;
}

/* --- Coord format button --- */
.coord-format-btn {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 3px;
  color: #888;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.coord-format-btn:hover {
  background: #f0f0f0;
  color: #555;
}

/* --- Clear button (trash) --- */
.measure-tool-btn.measure-clear-btn:hover {
  background: #fde8e8;
  color: #d44;
}

/* --- Tooltips on buttons --- */
.measure-tool-btn::after,
.coord-format-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.measure-tool-btn:hover::after,
.coord-format-btn:hover::after {
  opacity: 1;
}

/* --- Measure tooltips on map --- */
.measure-tooltip {
  background: rgba(30, 30, 30, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.3px;
}

.measure-tooltip-static {
  background: rgba(30, 30, 30, 0.9);
  font-weight: 500;
}

/* --- Coordinate display bar --- */
#coordDisplay {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.82);
  color: #fff;
  font-size: 12px;
  font-family: 'Consolas', 'SF Mono', monospace;
  padding: 5px 14px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 500;
}

#coordDisplay.visible {
  opacity: 1;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .measure-toolbar {
    bottom: 15px;
    left: 10px;
    right: auto;
  }

  .measure-tool-btn::after,
  .coord-format-btn::after {
    display: none;
  }
}