/* ==========================================================================
   Map Section Styles (v2.2)
   1. 寬度控制：嚴格遵守 --container-fluid-width 變數
   2. 版面比例：
      - Desktop: 地圖 6 : 列表 4
      - Map: 獨立區塊，無白邊，圓角 12px
      - List: 獨立白底區塊，圓角 12px
      - Gap: 固定 20px
   ========================================================================== */

/* 區塊背景 (維持淺藍底色或透明) */
.map-section {
  background-color: transparent; /* 改為透明以顯示 body 紋理，或設為 #F0F8FF */
}



.icon-location {
  display: inline-block;
  width: 24px; /* 請依實際圖標大小調整 */
  height: 24px;

  /* 這裡設定顏色，它會變成你的變數顏色 */
  background-color: var(--color-white);

  /* 這裡引入你的 SVG 檔案作為遮罩 */
  /* 👇 重點修改這裡：用兩個 "../" 跳出 pages 和 css 資料夾 */
  -webkit-mask-image: url("../../img/placeholders/icon/all=location-here.svg");
  mask-image: url("../../img/placeholders/icon/all=location-here.svg");

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;

  vertical-align: middle; /* 調整對齊文字 */
  margin-right: 5px; /* 圖標與文字的間距 */
}

/* ------------------------------------------------
   1. 容器寬度覆寫
   ------------------------------------------------ */
.map-section .container {
  width: var(--container-fluid-width);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* 標題裝飾線 */
.header-divider {
  height: 1px;
  background-color: #ccc;
  width: 60%;
  margin: 0 auto;
  position: relative;
}
.header-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background-color: #ccc;
  border-radius: 50%;
}

/* ------------------------------------------------
   2. Grid Layout: 地圖與列表排版
   ------------------------------------------------ */
.map-container-grid {
  display: grid;
  /* 電腦版比例 6:4 */
  grid-template-columns: 6fr 4fr;

  /* ★★★ 兩者間距固定 20px ★★★ */
  gap: 20px;

  height: 600px; /* 固定高度 */

  /* ★★★ 移除外層白色背景與內距，讓地圖全版面 ★★★ */
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

/* --- 左側：地圖容器 (獨立區塊) --- */
.map-view-container {
  position: relative;
  width: 100%;
  height: 100%;

  /* ★★★ 地圖圓角 12px ★★★ */
  border-radius: 12px;
  overflow: hidden;

  /* 增加陰影讓地圖稍微浮起 (選用) */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#osm-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 浮動按鈕：我的位置 */
.btn-my-location {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 999;
  background-color: var(--secondary-color-1);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-my-location:hover {
  background-color: #1f2a30;
}
.btn-my-location img {
  width: 16px;
  height: 16px;
  filter: invert(1);
}

/* --- 右側：列表容器 (獨立白底區塊) --- */
.map-list-container {
  display: flex;
  flex-direction: column;
  height: 100%;

  /* ★★★ 列表區塊加上白底與圓角 ★★★ */
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);

  overflow: hidden;
}

/* 搜尋區塊 header */
.list-header {
  background-color: #fff;
  padding: 20px; /* 增加內部間距 */
}
.search-group,
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-group label,
.filter-group label {
  font-weight: bold;
  min-width: 40px;
  white-space: nowrap;
}

/* 列表捲動區 body */
.list-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
}

/* 列表項目 */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: var(--color-text-main, #333);
  transition: background 0.2s;
}
.list-item:hover {
  background-color: #f9f9f9;
}

.item-number {
  background-color: var(--secondary-color-1);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-right: 10px;
  flex-shrink: 0;
}

.item-name {
  font-weight: 500;
}

/* 自定義捲軸 */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* =========================================
   RWD 響應式調整 (Media Queries)
   ========================================= */

/* 平板 (Tablet) & 手機 (Mobile) <= 1024px */
@media (max-width: 1024px) {
  .map-container-grid {
    grid-template-columns: 1fr; /* 單欄 */
    grid-template-rows: 400px auto; /* 地圖固定高度 */
    height: auto;
  }

  .map-list-container {
    height: 300px;
  }


}

/* 手機 (Mobile) <= 767px */
@media (max-width: 767px) {
  .language-selector,
  .map-type-selector {
    flex-direction: column;
    align-items: flex-start;
  }
  .map-list-container {
    height: 250px;
  }

  .tab-filter {
    justify-content: center;
  }


}

/* =========================================
   Detail Modal Styles (仿圖二設計)
   ========================================= */

/* 1. 遮罩層 */
.detail-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

/* 2. 容器 (左右兩欄) */
.detail-modal-container {
  width: 900px;
  max-width: 95%;
  height: 600px; /* 固定高度以利內部捲動 */
  background: #fff;
  border-radius: 12px;
  display: flex;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 關閉按鈕 (右上角圓形) */
.detail-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- 左側：資訊欄 (60%) --- */
.modal-left-col {
  width: 60%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #eee;
}

.modal-hero-img {
  height: 60%; /* 上半部圖片 */
  background: #eee;
}
.modal-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info-content {
  padding: 15px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.detail-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}
.detail-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

/* 按鈕群組 */
.detail-action-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn-action-outline {
  flex: 1;
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
  padding: 8px 0;
  border-radius: 6px;
  font-size: 14px;
  transition: 0.2s;
}
.btn-action-outline:hover {
  background: #f8f9fa;
  border-color: #bbb;
}

/* --- 右側：評論欄 (40%) --- */
.modal-right-col {
  width: 40%;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* 評論列表區 (可捲動) */
.review-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.review-item {
  border: 1px solid #eee;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 8px;
  position: relative;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-avatar {
  font-size: 32px;
  color: #4fa8d8; /* 使用主色 */
}
.review-stars {
  color: #ffc107;
  font-size: 14px;
}
.review-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  margin-left: auto;
}
.tag-report {
  background-color: #dc3545;
} /* 紅色檢舉 */
.tag-delete {
  background-color: #6c757d;
} /* 灰色刪除 */

.review-text {
  font-size: 13px;
  color: #555;
  margin: 0;
}

/* 底部輸入區 */
.review-input-area {
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}
.btn-submit-review {
  background: #343a40;
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 4px;
}
.btn-share {
  background: #4fa8d8; /* 綠色按鈕參考圖二，這裡用主色代替，或改成 #28a745 */
  color: #fff;
  border: none;
  padding: 8px;
  border-radius: 4px;
}

/* RWD: 手機版變為垂直排列 */
@media (max-width: 768px) {
  .detail-modal-container {
    flex-direction: column;
    height: 90vh;
    overflow-y: auto;
  }
  .modal-left-col,
  .modal-right-col {
    width: 100%;
    border-right: none;
  }
  .modal-hero-img {
    height: 200px;
  }
}
