/*
  style.css version 3.0.0
  Mobile/Tablet = pointer: coarse
  PC = pointer: fine
*/

/* ===== 全体 ===== */
body {
  margin: 0;
  font-family: sans-serif;
  overflow: hidden;
}

/* ===== ヘッダー ===== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 32px;
  padding: 4px 8px;

  background: #2c3e50;
  color: #ecf0f1;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;

  font-size: 14px;
  z-index: 3000;
}

/* メニューは全デバイスで表示 */
.mobile-only {
  display: inline-block;
  font-size: 20px;
  margin-right: 10px;
}

/* ===== レイアウト ===== */
#container {
  display: flex;
  height: calc(100dvh - 32px - 32px);
  margin-top: 32px;
  margin-bottom: 32px;
}

/* ===== サイドバー（全デバイス折り畳み式） ===== */
#sidebar {
  width: 45%;
  height: 85%;
  background: rgba(244, 244, 244, 0.85);
  border-right: 1px solid #ccc;
  overflow-y: auto;

  position: absolute;
  top: 32px;                   /* ★ ヘッダーの下から開始 */
  left: 0;

  transform: translateX(-100%);
  transition: transform 0.3s ease;

  z-index: 2500;
}

#sidebar.open {
  transform: translateX(0);
}

/* ===== タブ ===== */
.tab-buttons {
  display: flex;
  background: #ddd;
  border-bottom: 1px solid #aaa;
  position: sticky;            /* ★ タブを常に上に固定 */
  top: 0;
  z-index: 10;
}

.tab-buttons div {
  flex: 1;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
  border-right: 1px solid #aaa;
}

.tab-buttons div.active {
  background: #fff;
}

.tab-content {
  display: none;
  padding: 10px;
}

.tab-content.active {
  display: block;
}

/* ===== 地図 ===== */
#map {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
}

/* ===== 座標表示 ===== */
#coordBox {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  z-index: 1000;
}

/* MiniMap の位置調整 */
.leaflet-control-minimap {
  bottom: 5px !important;
  right: 5px !important;
}

/* ===== 現在地ボタン ===== */
/* PC（マウス操作デバイス）では非表示 */
@media (pointer: fine) {
  .locate-btn {
    display: none;
  }
}

/* スマホ・タブレット（指操作デバイス）で表示 */
@media (pointer: coarse) {
  .locate-btn {
    display: block;
    position: absolute;
    bottom: 120px;
    right: 10px;
    width: 35px;
    height: 35px;
    background: white;
    border-radius: 50%;
    border: 2px solid #666;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 500;
  }

  .locate-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }

  .locate-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }
}

/* ===== フッター ===== */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  height: 32px;
  padding: 6px 0;

  text-align: center;
  font-size: 13px;

  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);

  border-top: 1px solid #ccc;

  z-index: 1500;
}

/* ===== Dropzone（PCのみ） ===== */
#dropzone {
  position: absolute;
  top: 25%;
  left: 25%;
  width: 50%;
  height: 50%;
  background: rgba(0,0,0,0);
  border: 2px dashed rgba(0,0,0,0);
  pointer-events: none;
  z-index: 1500;
  transition: background 0.2s, border 0.2s;
}

#map.dragover #dropzone {
  background: rgba(0,0,0,0.25);
  border: 2px dashed #666;
  pointer-events: auto;
}

/* スマホ・タブレットでは Dropzone を非表示 */
@media (pointer: coarse) {
  #dropzone {
    display: none;
  }
}

/* ===== QR ボタン ===== */
.qr-btn {
  margin-left: 10px;
  padding: 4px 8px;
  font-size: 14px;
}

.qr-popup {
  position: absolute;
  top: 50px;
  right: 10px;
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  display: none;
  z-index: 9999;
}

/* ===== 現在地マーカー（デバイスの向き矢印） ===== */
.heading-icon .arrow {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid #007bff; /* 矢印の色 */
  transform-origin: 50% 75%;
}
