:root {
  --forest: #1e7a4c;
  --forest-dark: #145c38;
  --forest-light: #e6f4ec;
  --accent: #ef7d33;
  --accent-dark: #d4661f;
  --bg: #f7f5f0;
  --card-bg: #ffffff;
  --text: #24312a;
  --text-muted: #6b7a71;
  --border: #e1ded4;
  --gray: #9aa39c;
  --shadow: 0 2px 10px rgba(30, 40, 33, 0.08);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 { margin: 0; }

/* Header */
.app-header {
  background: var(--forest);
  color: #fff;
}
.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h1 { font-size: 1.25rem; }

.ghost-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ghost-btn:hover { background: rgba(255,255,255,0.22); }

.count-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.75rem;
}

/* Control bar */
.control-bar {
  background: var(--forest-light);
  border-bottom: 1px solid var(--border);
}
.control-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.date-display { display: flex; align-items: baseline; gap: 8px; }
.date-label { font-size: 1.1rem; font-weight: 700; color: var(--forest-dark); }
.date-sub { font-size: 0.85rem; color: var(--text-muted); }

.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.primary-btn:hover { background: var(--accent-dark); }
.primary-btn.active { background: var(--forest-dark); }

.date-strip {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px 14px;
  gap: 8px;
  overflow-x: auto;
}
.date-strip:not([hidden]) {
  display: flex;
}
.date-chip {
  flex: 0 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  cursor: pointer;
  min-width: 58px;
  font-size: 0.8rem;
  color: var(--text);
}
.date-chip .dow { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2px; }
.date-chip .dnum { display: block; font-weight: 700; font-size: 0.95rem; }
.date-chip.selected {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}
.date-chip.selected .dow { color: rgba(255,255,255,0.8); }

.data-notice {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 20px;
  font-size: 0.76rem;
  color: var(--text-muted);
  background: #fbf8ee;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* Main layout: map and reservation list side by side */
.main-stack {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.map-panel, .list-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.map-panel {
  flex: 0 0 auto;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.list-panel {
  flex: 1 1 380px;
  min-width: 0;
}

@media (max-width: 860px) {
  .main-stack { flex-direction: column; align-items: center; }
  .map-panel, .list-panel { width: 100%; max-width: 600px; }
}

.map-summary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--forest-dark);
  margin-bottom: 8px;
  align-self: flex-start;
}

.map-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #eaf3fa;
}
#koreaMap {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}
#koreaMap.grabbing { cursor: grabbing; }

.zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.75);
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
}

.province { fill: #3d8f77; stroke: #f4f7f5; stroke-width: 1.4; stroke-linejoin: round; }

.marker { cursor: pointer; transition: transform 0.12s ease; transform-box: fill-box; transform-origin: bottom center; }
.marker:hover { transform: scale(1.12); }
.marker .bubble-tail, .marker .bubble-body { fill: var(--forest); }
.marker .bubble-text { fill: #fff; font-size: 8.5px; font-weight: 700; }
.marker.full .bubble-tail, .marker.full .bubble-body { fill: var(--gray); }
.marker.full .bubble-text { fill: #f1f1f1; }
.marker.selected .bubble-tail, .marker.selected .bubble-body { fill: var(--accent); }
.marker.selected { transform: scale(1.15); }

.legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  align-self: flex-start;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.available { background: var(--forest); }
.dot.full { background: var(--gray); }

/* Marker hover tooltip */
.marker-tooltip {
  position: fixed;
  z-index: 70;
  background: #1f2a24;
  color: #fff;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.5;
  pointer-events: none;
  width: 220px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translate(-50%, -100%);
  margin-top: -12px;
}
.tt-photo {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tt-photo-emoji { font-size: 2.2rem; }
.tt-photo.theme-forest { background: linear-gradient(135deg, #2f6b46, #7fbf8f); }
.tt-photo.theme-ocean { background: linear-gradient(135deg, #1c6fa6, #7fd1e0); }
.tt-photo.theme-mountain { background: linear-gradient(135deg, #4b5d52, #9fae9e); }
.tt-photo.theme-river { background: linear-gradient(135deg, #2a7f8a, #8fd6c9); }
.tt-body { padding: 10px 12px; }
.marker-tooltip .tt-title { font-weight: 700; font-size: 0.86rem; }
.marker-tooltip .tt-region { color: #c9d6cd; font-size: 0.72rem; margin-top: 2px; }
.marker-tooltip .tt-desc { color: #dbe4de; font-size: 0.72rem; margin-top: 6px; }
.marker-tooltip .tt-price { color: #f0c98a; font-size: 0.74rem; font-weight: 600; margin-top: 6px; }
.marker-tooltip .tt-status { margin-top: 6px; font-weight: 600; }
.marker-tooltip .tt-status.available { color: #8fe0b0; }
.marker-tooltip .tt-status.full { color: #b9c2bd; }

/* List panel */
.list-panel { max-width: 700px; }

.list-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
#searchInput {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}
.checkbox-filter {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.campsite-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 640px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.campsite-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.campsite-card:hover { border-color: var(--forest); box-shadow: var(--shadow); }
.campsite-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(239,125,51,0.25); }
.campsite-card.full { opacity: 0.6; }

.card-emoji {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  background: var(--forest-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-body { flex: 1; min-width: 0; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-weight: 700; font-size: 0.98rem; }
.card-region { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.card-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-tag {
  background: var(--forest-light);
  color: var(--forest-dark);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
}
.card-meta-row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.card-price { font-weight: 700; font-size: 0.9rem; }
.card-price small { font-weight: 400; color: var(--text-muted); font-size: 0.72rem; }

.availability-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.availability-badge.available { background: var(--forest-light); color: var(--forest-dark); }
.availability-badge.full { background: #eee; color: var(--text-muted); }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 10px;
  font-size: 0.9rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 24, 0.5);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-overlay:not([hidden]) {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-photo {
  height: 140px;
  margin: -24px -24px 14px;
  width: calc(100% + 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px 16px 0 0;
}
.modal-photo .tt-photo-emoji { font-size: 3.2rem; }
.modal-photo.theme-forest { background: linear-gradient(135deg, #2f6b46, #7fbf8f); }
.modal-photo.theme-ocean { background: linear-gradient(135deg, #1c6fa6, #7fd1e0); }
.modal-photo.theme-mountain { background: linear-gradient(135deg, #4b5d52, #9fae9e); }
.modal-photo.theme-river { background: linear-gradient(135deg, #2a7f8a, #8fd6c9); }
.modal h2 { font-size: 1.2rem; margin: 8px 0 2px; }
.modal .modal-region { color: var(--text-muted); font-size: 0.85rem; }
.modal-tags { display: flex; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.modal-desc { font-size: 0.85rem; color: var(--text); line-height: 1.5; margin: 0 0 6px; }
.modal-info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.modal-info-row span:first-child { color: var(--text-muted); }
.people-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}
.stepper-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.confirm-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 10px;
}
.confirm-btn:disabled { background: var(--gray); cursor: not-allowed; }
.confirm-btn.done { background: var(--accent); }

.reservation-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reservation-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
}
.reservation-item .r-name { font-weight: 700; }
.reservation-item .r-meta { color: var(--text-muted); margin-top: 2px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  z-index: 60;
}
