@charset "UTF-8";

/* =====================
*
マップコントロール（各ボタン関連）
*
=====================*/
.map-controls {
  position: absolute;
  bottom: 70px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-control-btn {
  width: 38px;
  height: 38px;
  background-color: var(--bg-color);
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  color: var(--primary-color);
  cursor: pointer;
  position: relative;
}

.map-control-btn i {
  width: 24px;
  height: 24px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* アイコンがクリックを奪わない */
  pointer-events: none;
}

/* 全ボタン共通のホバー時 */
.map-control-btn:hover {
  background-color: var(--hover-bg);
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 4px 12px rgba(46, 123, 214, 0.25);
}

/* 全ボタン共通の押下時 */
.map-control-btn:active {
  transform: translateY(0) scale(0.95);
}

/* 全ボタン共通のアクティブ状態（ph1では3Dボタンのみ） */
.map-control-btn.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 155, 209, 0.3);
}

.map-control-btn.active i {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

/* ---------------------
現在地ボタン固有
---------------------*/
/* GPS測位中状態 */
.map-control-btn.current-location[data-state="locating"] {
  background-color: #E3F2FD;
}

.map-control-btn.current-location[data-state="locating"] i {
  opacity: 0.7;
}

/* GPS測位完了状態 */
.map-control-btn.current-location[data-state="located"] {
  background-color: white;
  border: 2px solid #1976D2;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.4);
}

/* ---------------------
ズームボタン固有
---------------------*/
.zoom-controls {
  display: flex;
  flex-direction: column;
}

#zoom-in-btn,
#zoom-out-btn {
  border-radius: 0;
  margin: 0;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#zoom-in-btn {
  border-radius: 16px 16px 0 0;
}

#zoom-out-btn {
  border-radius: 0 0 16px 16px;
  border-top: 1px solid var(--border-color);
}

/* ---------------------
左下ボタンコンテナ
---------------------*/
.map-bottom-left-container {
  position: absolute;
  left: 15px;
  bottom: 50px;
}

.bottom-left-control-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 左下コンテナのイチオシ機能ボタン共通（ph1は全画面のみ） */
.featured-control-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid #ddd;
  border-radius: 20px;
  min-height: 44px;
  min-width: 85px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow-color);
  margin: 0;
}

.featured-control-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #1976D2;
}

.featured-control-btn.active {
  background: #1976D2;
  color: var(--bg-color);
  border: 2px solid #1976D2;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
}

/* アイコン設定 */
.featured-control-btn .svg-icon-white {
  width: 16px;
  height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: invert(27%) sepia(51%) saturate(2878%) hue-rotate(210deg) brightness(95%) contrast(95%);
}

.featured-control-btn.active .svg-icon-white {
  filter: invert(1);
}

/* === サイズ別の指定 === */

 /* モバイル広告が表示される前提のスタイルは、(max-width: 768px), を条件にしない */
@media
(hover: none) and (pointer: coarse) {

  /* 右側コントロール */
  .map-controls {
    /* ビューポート基準で固定 */
    position: fixed;
    /* transformをリセットして副作用をなくす */
    transform: none;
    gap: 12px;
    right: 12px;
    /* 広告バナーとスケールバーの高さ分、上に移動 70+50+40 */
    bottom: 160px;
  }

  /* 印刷ボタン、スナップショットボタンを非表示 */
  #print-btn,
  #snapshot-btn {
    display: none;
  }

  /* モバイル以下のサイズでは左下の機能ボタン非表示 */
  .map-bottom-left-container {
    display: none;
  }
}

/* 600px以下のモバイル用 */
@media (max-width: 600px) {

  .map-control-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .map-control-btn i {
    width: 28px;
    height: 28px;
  }

  .zoom-controls {
    gap: 0px;
  }

  /* ズームボタンの見た目のサイズを定義 */
  #zoom-in-btn,
  #zoom-out-btn {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  /* ズームボタンの境界線調整 */
  #zoom-in-btn {
    border-radius: 28px 28px 0 0;
  }

  #zoom-out-btn {
    border-radius: 0 0 28px 28px;
    border-top: 1px solid var(--border-color);
  }
}

/* モバイル・タブレット横向きでの高さ対応。400pxまでに対して設定 */
/* iPhone SE 第2/3世代（高さ:320〜375px） */
/* iPhone SE 第1世代（高さ:320px） */
@media (max-height: 400px) {
  .map-control-btn {
    width: 36px;
    height: 36px;
  }

  #zoom-in-btn,
  #zoom-out-btn {
    width: 36px;
    height: 36px;
  }

  /* 横向きなど高さの少ない時にはレイヤーのボタン除去 */
  #layer-toggle-btn {
    display: none;
  }
}