@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #eff8fa;
  --pill-bg: #e2eef3;
  --pill-text: #3e5c68;
  --accent: #ea580c;
  --accent-text: #fff;
  --beach: #2563eb;
  --valley: #15803d;
  --depth-shallow: #7dd3fc;
  --depth-medium: #0ea5e9;
  --depth-deep: #0c4a6e;
  --border: #d5e6ec;
  --text: #0f172a;
  --text-gray: #64748b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Work Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

a,
button,
input,
select,
textarea {
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-family: "Outfit", "Apple SD Gothic Neo", sans-serif;
  font-weight: 700;
  font-size: 19px;
}

header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-gray);
}

nav.site-nav {
  display: flex;
  gap: 6px;
}

nav.site-nav a {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-text);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

nav.site-nav a:hover {
  background: var(--border);
}

nav.site-nav a.current {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.dot.beach {
  background: var(--beach);
}

.dot.valley {
  background: var(--valley);
}

#controls {
  flex-shrink: 0;
  padding: 14px 16px;
  margin: 10px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.controls-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Outfit", "Apple SD Gothic Neo", sans-serif;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--accent);
}

#searchInput {
  width: 100%;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  outline: none;
}

#searchInput:focus {
  border-color: var(--accent);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  color: var(--text-gray);
  min-width: 30px;
}

.pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  border: none;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.pill:hover {
  background: var(--border);
}

.pill.active:hover {
  filter: brightness(1.08);
}

.pill.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

#count {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-gray);
}

#layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.map-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.list-pane {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg);
}

.pane-title {
  flex-shrink: 0;
  font-family: "Outfit", "Apple SD Gothic Neo", sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

#map {
  flex: 1 1 auto;
  min-height: 0;
}

#list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.item {
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 150ms ease, border-color 150ms ease;
}

.item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.item .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.item .name {
  font-family: "Outfit", "Apple SD Gothic Neo", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
}

.item .region {
  font-size: 11px;
  color: var(--text-gray);
}

.fav-btn,
.review-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-gray);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 6px;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.fav-btn:hover,
.review-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fav-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.item .pin {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 3px;
}

.item .badges {
  margin-top: 6px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  color: #fff;
  padding: 2px 9px;
  border-radius: 999px;
  margin-right: 4px;
}

.badge.beach {
  background: var(--beach);
}

.badge.valley {
  background: var(--valley);
}

.badge.shallow {
  background: var(--depth-shallow);
}

.badge.medium {
  background: var(--depth-medium);
}

.badge.deep {
  background: var(--depth-deep);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.info-box {
  background: var(--bg);
  border-left: 3px solid var(--beach);
  border-radius: 8px;
  padding: 8px 10px;
}

.info-box.type-valley {
  border-left-color: var(--valley);
}

.info-box .info-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-gray);
  margin-bottom: 4px;
}

.info-box .info-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--beach);
  flex-shrink: 0;
}

.info-box.type-valley .info-label::before {
  background: var(--valley);
}

.info-box .info-value {
  font-size: 16px;
  font-weight: 700;
  font-family: "Outfit", "Apple SD Gothic Neo", sans-serif;
}

.item .note {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 10px;
  background: rgba(21, 128, 61, 0.08);
  border-left: 3px solid var(--valley);
  border-radius: 8px;
  padding: 8px 10px;
}

.item .stats {
  font-size: 11px;
  color: var(--text-gray);
  margin-top: 8px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
}

.modal-close-btn {
  border: none;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.review-item {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 12px;
}

.review-item .review-meta {
  color: var(--text-gray);
  font-size: 11px;
  margin-bottom: 2px;
}

#reviewForm {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#reviewForm select,
#reviewForm input,
#reviewForm textarea {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

#reviewForm button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  cursor: pointer;
}

#reviewStatus {
  font-size: 11px;
  color: var(--text-gray);
}

footer {
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-gray);
  padding: 8px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

#apiKeyWarning {
  padding: 40px 20px;
  text-align: center;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.6;
}

.page-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.page-list .item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: default;
}

.empty-state {
  text-align: center;
  color: var(--text-gray);
  font-size: 13px;
  padding: 60px 20px;
}

.ad-slot {
  flex-shrink: 0;
  text-align: center;
  overflow: hidden;
  line-height: 0;
}

.view-tabs {
  display: none;
}

@media (max-width: 768px) {
  .view-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 0 20px 12px;
    background: var(--bg);
  }

  .view-tabs button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--pill-bg);
    color: var(--pill-text);
    font-size: 13px;
    cursor: pointer;
  }

  .view-tabs button.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
  }

  #layout {
    flex-direction: column;
  }

  .list-pane,
  .map-pane {
    width: 100%;
    height: 100%;
  }

  .list-pane {
    border-left: none;
  }

  #layout.show-list .map-pane {
    display: none;
  }

  #layout.show-map .list-pane {
    display: none;
  }
}
