@import "/mk3/assets/palette.css";
/* ========================================
   地圖視圖樣式（Leaflet）
   Millzik 妙識 — Navy/Orange
   ======================================== */



* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Rubik', 'PingFang HK', 'Noto Sans HK', sans-serif;
  color: var(--text);
  background: #fff;
}

/* ---------- 導覽列 ---------- */
.mk-nav {
  background: var(--navy);
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.mk-nav .nav-logo { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 3px; text-decoration: none; }
.mk-nav .nav-logo span { color: var(--orange); }
.mk-nav .nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.mk-nav .nav-links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.mk-nav .nav-links a:hover, .mk-nav .nav-links a.active { color: var(--orange); }
.mk-nav .nav-cta {
  background: var(--orange); color: #000; border: none;
  padding: 10px 22px; border-radius: 6px; font-weight: 700;
  cursor: pointer; font-size: 14px; text-decoration: none;
}

/* ---------- 地圖佈局 ---------- */
.map-layout {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* ---------- 側邊欄 ---------- */
.map-sidebar {
  width: 400px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
  position: relative;
  z-index: 10;
}
.map-sidebar.collapsed { margin-left: -400px; }

.sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}
.view-toggle { display: flex; gap: 8px; }
.toggle-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.toggle-btn:hover { background: #e5e7eb; }
.toggle-btn.active { color: #fff; background: var(--navy); }

.sidebar-toggle-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--gray);
  background: #f3f4f6; border: none; border-radius: 6px;
  cursor: pointer; transition: all 0.2s;
}
.sidebar-toggle-btn:hover { background: #e5e7eb; }

/* ---------- 篩選區 ---------- */
.sidebar-filters { padding: 16px; border-bottom: 1px solid #e5e7eb; }
.search-box { position: relative; margin-bottom: 12px; }
.search-input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s;
  font-family: inherit;
}
.search-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(36, 85, 166, 0.1);
}
.search-icon {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); font-size: 18px; pointer-events: none;
}
.filter-select {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  margin-bottom: 12px;
  font-family: inherit;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.chip:hover { background: #e5e7eb; }
.chip.active { color: var(--navy); background: var(--light-blue); border-color: var(--navy); }

/* ---------- 結果列表 ---------- */
.sidebar-results { flex: 1; overflow-y: auto; padding: 16px; }
.results-count { font-size: 14px; color: var(--gray); margin-bottom: 16px; }
.results-count strong { color: var(--text); font-weight: 600; }

.result-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}
.result-card:hover { border-color: var(--navy); box-shadow: 0 4px 12px rgba(36, 85, 166, 0.1); }
.result-card.selected { border-color: var(--navy); background: var(--light-blue); }

.card-image {
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; background: #f3f4f6;
}

.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text); margin: 0; }
.card-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px; font-weight: 500;
  color: var(--navy); background: var(--light-blue);
  border-radius: 4px; width: fit-content;
}
.card-badge.course { color: var(--success-strong); background: var(--success-soft); }
.card-badge.event { color: #a06800; background: #fff3d6; }
.card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--gray); }
.card-price { font-size: 14px; font-weight: 600; color: var(--text); margin-top: auto; }
.card-noloc { font-size: 11px; color: var(--error-strong); }

/* ---------- 地圖容器 ---------- */
.map-container { flex: 1; position: relative; height: 100%; }
.map-container .leaflet-container { height: 100%; width: 100%; }

/* ---------- 自訂標記 ---------- */
.mk-pin-wrap { background: none; border: none; }
.mk-pin {
  width: 34px; height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  display: flex; align-items: center; justify-content: center;
}
.mk-pin span { transform: rotate(45deg); font-size: 15px; line-height: 1; }

/* ---------- 彈窗（Leaflet popup） ---------- */
.map-info-window { max-width: 260px; }
.info-image { width: 100%; height: 130px; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.info-placeholder {
  width: 100%; height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px; background: #f3f4f6; border-radius: 8px; margin-bottom: 10px;
}
.info-title { font-size: 17px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.info-badge {
  display: inline-block; padding: 3px 10px;
  font-size: 12px; font-weight: 500;
  color: var(--navy); background: var(--light-blue);
  border-radius: 4px; margin-bottom: 10px;
}
.info-detail { font-size: 13px; color: var(--gray); margin-bottom: 5px; }
.info-btn {
  width: 100%; padding: 9px; margin-top: 10px;
  font-size: 14px; font-weight: 600;
  color: #fff; background: var(--navy);
  border: none; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.info-btn:hover { background: var(--navy-dark); }
.leaflet-popup-content { margin: 12px 14px; }

/* ---------- 空狀態 ---------- */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-text { font-size: 14px; color: var(--gray); line-height: 1.6; }
.empty-text a { color: var(--navy); font-weight: 600; }

/* ---------- 響應式 ---------- */
@media (max-width: 768px) {
  .mk-nav { padding: 0 16px; }
  .mk-nav .nav-links { display: none; }
  .map-sidebar {
    position: absolute; left: 0; top: 0; height: 100%;
    width: 86%; max-width: 360px;
    z-index: 20; box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  }
  .map-sidebar.collapsed { margin-left: -100%; }
}

/* ── 地圖聚類標記（PART 7.1） ── */
.mk-cluster-wrapper { background: transparent; }
.mk-cluster {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 0.875rem;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.mk-cluster-small  { background: var(--navy); }
.mk-cluster-medium { background: #f59e0b; }
.mk-cluster-large  { background: var(--error); width: 46px; height: 46px; font-size: 1rem; }
