* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(
      circle at top left,
      rgba(229, 9, 20, 0.16),
      transparent 32%
    ),
    radial-gradient(
      circle at top right,
      rgba(80, 80, 80, 0.18),
      transparent 28%
    ),
    #050505;
  color: #fff;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.map-page {
  height: 100vh;
  padding: 24px;
}

.map-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  background:
    linear-gradient(
      135deg,
      rgba(229, 9, 20, 0.12),
      rgba(255, 255, 255, 0.035) 42%
    ),
    rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.map-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #ff2b35;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #e50914;
  box-shadow: 0 0 18px rgba(229, 9, 20, 0.9);
}

.map-title {
  min-width: 0;
}

.map-title h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.map-title p {
  margin: 9px 0 0;
  color: #b8b8b8;
  font-size: 15px;
}

.map-summary {
  display: none;
}

.map-summary div {
  min-width: 92px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.map-summary strong {
  display: block;
  font-size: 21px;
  line-height: 1;
}

.map-summary span {
  display: block;
  margin-top: 6px;
  color: #aaa;
  font-size: 12px;
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.map-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  transition: 0.18s;
}

.map-actions a:hover {
  background: #e50914;
  border-color: #e50914;
  box-shadow: 0 10px 26px rgba(229, 9, 20, 0.35);
  transform: translateY(-1px);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  height: calc(100vh - 192px);
  min-height: 620px;
}

.map-canvas-wrap {
  min-width: 0;
  height: 100%;
}

#myflixMap {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.map-side {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.side-head {
  flex-shrink: 0;
  margin-bottom: 14px;
}

.side-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.side-head p {
  margin: 6px 0 0;
  color: #999;
  font-size: 13px;
}

.map-filter {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-filter button {
  border: 0;
  background: rgba(255, 255, 255, 0.09);
  color: #eaeaea;
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition: 0.18s;
}

.map-filter button.active {
  background: #e50914;
  color: #fff;
  box-shadow: 0 8px 20px rgba(229, 9, 20, 0.35);
}

.map-filter button:hover {
  background: rgba(229, 9, 20, 0.75);
  color: #fff;
}

.map-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

.map-list::-webkit-scrollbar {
  width: 8px;
}

.map-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.map-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.map-list::-webkit-scrollbar-thumb:hover {
  background: rgba(229, 9, 20, 0.75);
}

.map-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 13px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition: 0.2s;
}

.map-item:hover {
  background: rgba(229, 9, 20, 0.18);
  border-color: rgba(229, 9, 20, 0.45);
  transform: translateY(-2px);
}

.map-item.active {
  background: rgba(229, 9, 20, 0.26);
  border-color: rgba(229, 9, 20, 0.75);
}

.map-item img,
.map-no-img {
  width: 96px;
  height: 96px;
  border-radius: 15px;
  object-fit: cover;
  background: #222;
}

.map-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-size: 11px;
  font-weight: 900;
}

.map-item h3 {
  margin: 1px 0 6px;
  color: #fff;
  font-size: 16px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-type {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 3px 8px;
  margin-bottom: 4px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 900;
}

.map-item p {
  margin: 3px 0;
  color: #aaa;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty-map {
  padding: 42px 10px;
  color: #999;
  text-align: center;
  font-size: 14px;
}

/* MapLibre Popup */
.maplibregl-popup-content {
  padding: 0 !important;
  border-radius: 18px !important;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35) !important;
}

.maplibregl-popup-close-button {
  width: 26px;
  height: 26px;
  right: 8px !important;
  top: 8px !important;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55) !important;
  color: #fff !important;
  font-size: 18px !important;
}

.map-popup {
  width: 220px;
  color: #111;
  background: #fff;
}

.map-popup img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.map-popup-body {
  padding: 12px;
}

.map-popup strong {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
  line-height: 1.25;
}

.map-popup div {
  margin-bottom: 4px;
  color: #555;
  font-size: 12px;
}

.map-popup a {
  display: inline-flex;
  margin-top: 8px;
  color: #e50914;
  font-weight: 900;
  text-decoration: none;
}

/* category color hint */
.type-hotel {
  background: rgba(124, 58, 237, 0.28);
}
.type-travel {
  background: rgba(37, 99, 235, 0.28);
}
.type-food {
  background: rgba(249, 115, 22, 0.28);
}
.type-cafe {
  background: rgba(161, 98, 7, 0.28);
}
.type-play {
  background: rgba(22, 163, 74, 0.28);
}
.type-music {
  background: rgba(219, 39, 119, 0.28);
}

@media (max-width: 1180px) {
  .map-top {
    grid-template-columns: 1fr auto;
  }

  .map-summary {
    display: none;
  }

  .map-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  #myflixMap {
    height: 560px;
  }

  .map-side {
    height: 520px;
  }
}

@media (max-width: 720px) {
  .map-page {
    padding: 14px;
  }

  .map-top {
    display: block;
    padding: 16px;
    border-radius: 22px;
  }

  .map-title h1 {
    font-size: 28px;
  }

  .map-actions {
    margin-top: 14px;
  }

  .map-actions a {
    flex: 1;
  }

  #myflixMap {
    height: 430px;
    border-radius: 22px;
  }

  .map-side {
    height: 500px;
    border-radius: 22px;
  }

  .map-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .map-item img,
  .map-no-img {
    width: 82px;
    height: 70px;
  }
}
