/* 地図ページ共通スタイル */

/* 基本レイアウト */
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* 地図関連要素のbox-sizing */
#map, .folium-map, .leaflet-container, .leaflet-container * {
  box-sizing: border-box;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
}

.folium-map {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
}

.leaflet-container { font-size: 1rem; }

/* サイドバーのフォントサイズを保護 */
#sidebar, #sidebar * {
  font-size: 1rem !important;
}
#sidebar .text-2xl {
  font-size: 1.5rem !important;
}
#sidebar .text-xs {
  font-size: 0.75rem !important;
}

/* コントロールパネル（スライダーコンテナ） */
.year-slider-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 20px 50px 20px;
  min-height: 60px;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.15);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: center;
  overflow-x: hidden;
}

.year-slider-container h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

/* スライダーグループ */
.slider-group {
  margin: 20px 0;
  max-width: 100%;
  box-sizing: border-box;
}

.slider-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
  font-size: 14px;
}

/* レンジスライダー値表示 */
.range-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

.value-box {
  min-width: 110px;
  max-width: calc(50% - 10px);
  padding: 6px 10px;
  border: 1px solid #2da6b3;
  border-radius: 6px;
  background: #fff;
  color: #1f2d3d;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-sizing: border-box;
}

/* レンジスライダー */
.range-slider {
  position: relative;
  height: 28px;
  margin: 6px 0 10px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

.range-track {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #ddd;
  z-index: 1;
}

.range-selected {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #26a6b3, #1f8f9c);
  z-index: 2;
}

.year-range-slider {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 28px;
  margin: 0;
  background: none;
  outline: none;
  -webkit-appearance: none;
  pointer-events: none;
  z-index: 3;
}

.year-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #ffffff;
  border: 2px solid #26a6b3;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  pointer-events: all;
}

.year-range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #ffffff;
  border: 2px solid #26a6b3;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  pointer-events: all;
}

.year-range-slider::-webkit-slider-runnable-track {
  background: transparent;
}

.year-range-slider::-moz-range-track {
  background: transparent;
}

/* 年ラベル */
.year-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

/* 現在の期間表示 */
.year-display {
  margin: 20px 0;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
}

/* パネルトグルボタン */
.toggle-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.2s ease;
  z-index: 1001;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-btn:hover {
  background: #e9ecef;
}

/* パネルコンテンツ（折りたたみ） */
.panel-content {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  max-height: 1000px;
  opacity: 1;
}

.panel-content.collapsed {
  max-height: 0;
  opacity: 0;
}

/* エラーメッセージ */
.error-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #f8d7da;
  color: #721c24;
  padding: 20px 30px;
  border-radius: 8px;
  border: 2px solid #f5c6cb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  max-width: 90%;
  box-sizing: border-box;
}

/* コントロールセクション */
.control-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  max-width: 100%;
  box-sizing: border-box;
}

.control-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
