/* 変数定義 */
:root {
  --main-color: #4CAF50;
  --border-color: #ccc;
  --header-bg: #f2f2f2;
}

/* 全体構成 */
body,
html {
  margin: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  color: #333;
}

/* 地図領域 */
#map {
  width: 100%;
  height: 100%;
}

/* テーブル */
table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

table th {
  background-color: var(--header-bg);
  font-weight: bold;
}

table td {
  background-color: #fff;
}

/* ポップアップ */
.popup-content {
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* レイヤーコントロール */
#layerControl {
  position: absolute;
  top: 10px;
  left: 10px !important;
  right: auto !important;
  width: 350px;
  padding: 10px;
  background-color: #fff;
  font-size: 12px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: block !important;
}

#layerControl select,
#layerControl input[type="text"],
#layerControl button,
#opacitySlider {
  width: 100%;
  margin-bottom: 8px;
  padding: 6px;
  font-size: 12px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  box-sizing: border-box;
}

#opacitySlider {
  margin-top: 5px;
}

#layerControl fieldset label {
  display: inline-block;
  margin-right: 1px;
  white-space: nowrap;
}

/* コントロールボタン */
#layerControlButton,
#helpButton {
  display: none !important;
}

#layerControlButton {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 40px;
  height: 40px;
  background-color: var(--main-color);
  color: white;
  font-size: 16px;
  font-weight: bold;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
}

#helpButton {
  position: absolute;
  top: 60px;
  left: 10px;
  width: 40px;
  height: 40px;
  background-color: var(--main-color);
  color: white;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  line-height: 40px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 中心マーカー */
.center-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 35px;
  background-image: url('https://docs.mapbox.com/mapbox-gl-js/assets/custom_marker.png');
  background-size: contain;
  background-repeat: no-repeat;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.modal-content {
  position: relative;
  top: 50%;
  left: 50%;
  width: 90%;
  height: 90%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.close-button {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 30px;
  color: #333;
  cursor: pointer;
}

#helpFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* 地図帰属情報 */
.attribution {
  position: absolute;
  bottom: 5px;
  right: 10px;
  padding: 3px 10px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
}