/* 연습 장소 지도 — 메인 보초 앱과 동일한 디자인 토큰 (라이트/다크) */
* { box-sizing: border-box; }

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f3f6fb;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-pop: 0 8px 20px rgba(37, 99, 235, .12);
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-soft: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, .1);
  --primary: #2dd4bf;
  --primary-soft: rgba(45, 212, 191, .15);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 12px 28px rgba(0, 0, 0, .25);
  --shadow-pop: 0 10px 24px rgba(45, 212, 191, .18);
}

html, body {
  margin: 0;
  height: 100%;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
body { display: flex; flex-direction: column; }

/* 헤더 */
header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.home-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 999px; color: var(--text); text-decoration: none;
  transition: background-color .16s;
}
.home-btn:active { background: var(--surface-soft); }
.home-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.header-text { flex: 1; min-width: 0; }
header h1 { margin: 0; font-size: 16px; font-weight: 700; }
.legend { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* 지도 영역 */
.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; }

/* 반경 칩 */
.chips {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  display: flex; gap: 4px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
}
.chips.is-disabled { opacity: .55; }
.chip {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: background-color .16s, color .16s;
}
.chip.is-active { background: var(--primary); color: #fff; }
.chip:disabled { cursor: default; }

/* 현재 위치 FAB */
.fab {
  position: absolute; right: 14px; bottom: 78px; z-index: 5;
  width: 46px; height: 46px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pop); cursor: pointer;
  transition: transform .16s;
}
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.95); }

/* 목록보기 버튼 */
.list-btn {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 5;
  border: 0; border-radius: 999px;
  background: var(--text); color: var(--surface);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 11px 22px; box-shadow: var(--shadow-pop); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .16s;
}
.list-btn:active { transform: translateX(-50%) scale(.97); }

/* 바텀시트가 열리면 하단 컨트롤 숨김 */
body.sheet-open .list-btn,
body.sheet-open .fab { display: none; }

/* 바텀시트 (지도 위에 떠 있는 카드) */
.sheet {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 8;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  padding: 18px;
  max-height: 56vh; overflow: hidden;
  animation: sheetUp .22s ease;
}
.sheet[hidden] { display: none; }
@keyframes sheetUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sheet-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent; color: var(--muted);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px;
}

/* 단일 장소 카드 */
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 28px; }
.card-title { font-size: 16px; font-weight: 700; }
.badge { color: #fff; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.card-dist { margin-left: auto; color: var(--primary); font-weight: 700; font-size: 14px; }
.card-addr { color: var(--muted); font-size: 13px; margin-top: 8px; }
.card-desc { font-size: 13px; margin-top: 8px; white-space: pre-wrap; line-height: 1.55; }
.route-btn {
  display: block; width: 100%; box-sizing: border-box;
  text-align: center; text-decoration: none;
  margin-top: 16px; padding: 13px;
  background: var(--primary); color: #fff;
  border: 0; border-radius: 999px; font-family: inherit; font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-pop); cursor: pointer;
  transition: transform .16s;
}
.route-btn:active { transform: scale(.98); }

/* 목록 */
.list-head { font-size: 14px; font-weight: 700; padding-right: 28px; }
.list-count { color: var(--primary); margin-left: 4px; }
.list-empty { color: var(--muted); font-size: 13px; padding: 24px 0; text-align: center; }
.list-scroll { margin-top: 10px; max-height: 44vh; overflow-y: auto; }
.list-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
  color: var(--text); font: inherit;
}
.list-item:last-child { border-bottom: 0; }
.list-item:active { background: var(--surface-soft); }
.li-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.li-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.li-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.li-dist { font-size: 13px; color: var(--primary); font-weight: 700; flex-shrink: 0; }

/* 상태줄 */
#status {
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  font-size: 12px; color: var(--muted);
  background: var(--surface); border-top: 1px solid var(--line);
}

/* 장소 제보 */
.submit-trigger {
  flex-shrink: 0;
  border: 0; border-radius: 999px;
  background: var(--primary); color: #fff;
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 13px; cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform .16s;
}
.submit-trigger:active { transform: scale(.96); }

.submit-sheet { max-height: 80vh; overflow-y: auto; }
.submit-title { font-size: 16px; font-weight: 700; padding-right: 28px; }
.submit-hint { font-size: 12px; color: var(--muted); margin: 6px 0 12px; }
.submit-desc { font-size: 13px; color: var(--muted); margin: 8px 0 16px; line-height: 1.55; }

.submit-search { display: flex; gap: 6px; margin-bottom: 8px; }
.submit-search input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 14px; background: var(--bg); color: var(--text);
}
.submit-search button {
  flex-shrink: 0; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--text); color: var(--surface); font: inherit; font-weight: 600; cursor: pointer;
}

.submit-results { display: flex; flex-direction: column; gap: 6px; }
.submit-results:empty { display: none; }
.submit-result-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 9px 11px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-soft); color: var(--text); font: inherit; cursor: pointer;
}
.submit-result-item span { font-size: 12px; color: var(--muted); }
.submit-empty { font-size: 13px; color: var(--muted); padding: 8px 2px; }

.submit-field {
  width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 14px; background: var(--bg); color: var(--text);
}
textarea.submit-field { resize: vertical; }

.submit-msg { font-size: 12px; color: var(--primary); min-height: 16px; margin: 8px 0 0; }
