/* === 全体リセット・基本スタイル === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    "Meiryo", sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* === ヘッダー === */
header {
  background: #1a73e8;
  color: #fff;
  padding: 16px 24px;
  text-align: center;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

header .subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
}

/* === コントロールパネル === */
#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  align-items: flex-end;
  position: relative;
  z-index: 1000;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

/* ドロップダウン */
#station-select,
#station-select-b {
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 200px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

#station-select-b {
  border-color: #ef9a9a;
}

/* スライダー */
#time-slider {
  width: 260px;
  cursor: pointer;
  accent-color: #1a73e8;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #888;
}

#time-value {
  font-weight: 700;
  color: #1a73e8;
}

/* === 地図 === */
#map {
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 400px;
}

/* === 注意書きフッター === */
#disclaimer {
  background: #fff8e1;
  border-top: 1px solid #ffe082;
  padding: 12px 24px;
  text-align: center;
}

#disclaimer p {
  font-size: 0.8rem;
  color: #795548;
  line-height: 1.7;
}

/* === カラー凡例 === */
.legend {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  line-height: 1.6;
  min-width: 100px;
}

.legend-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.legend-color {
  display: inline-block;
  width: 20px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.legend-label {
  color: #555;
  font-size: 0.78rem;
}

/* === 駅情報パネル === */
.info-panel {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  min-width: 160px;
  max-width: 220px;
}

.info-placeholder {
  font-size: 0.82rem;
  color: #999;
  margin: 0;
}

.info-header {
  font-weight: 700;
  font-size: 0.85rem;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.info-body {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.7;
}

.info-station-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1a237e;
}

.info-city {
  color: #777;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.info-time {
  margin-top: 4px;
  color: #333;
}

.info-time strong {
  color: #1a73e8;
}

.info-coords {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #aaa;
  font-family: monospace;
}

/* === 比較モード凡例 === */
.legend-compare-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.legend-label-a {
  color: #1a237e;
}

.legend-label-b {
  color: #b71c1c;
}

.legend-label-time {
  color: #999;
}

.legend-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

/* === 比較モード情報パネル === */
.info-compare-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.info-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.info-dot-a {
  background: #1a237e;
}

.info-dot-b {
  background: #b71c1c;
}

/* === 面積統計 === */
.info-divider {
  border-top: 1px solid #e0e0e0;
  margin: 6px 0;
}

.info-area-stats {
  font-size: 0.78rem;
  color: #555;
}

.info-area-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.info-dot-overlap {
  background: #9c27b0;
}

.info-overlap-pct {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #333;
}

.info-overlap-pct strong {
  color: #6a1b9a;
  font-size: 1rem;
}

/* カスタムマーカー */
.custom-marker {
  background: none;
  border: none;
}

/* === ポップアップカスタマイズ === */
.popup-content {
  font-size: 13px;
  line-height: 1.6;
  min-width: 140px;
}

.popup-station {
  font-size: 15px;
  font-weight: 700;
  color: #1a237e;
}

.popup-city {
  font-size: 12px;
  color: #777;
}

.popup-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 6px 0;
}

.popup-time {
  font-size: 13px;
}

.popup-time strong {
  color: #1a73e8;
}

.popup-note {
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

/* === レスポンシブ === */
@media (max-width: 600px) {
  #controls {
    flex-direction: column;
    gap: 16px;
  }

  #time-slider {
    width: 100%;
  }

  #station-select,
  #station-select-b {
    width: 100%;
  }

  #map {
    height: calc(100vh - 300px);
  }

  /* モバイルでは情報パネルを小さく */
  .info-panel {
    min-width: 130px;
    max-width: 180px;
    font-size: 0.75rem;
  }

  .legend {
    padding: 8px 10px;
  }
}
