/* 引入 Google Fonts：帶點優雅溫暖的字體 */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Noto+Sans+TC:wght@400;700&family=Noto+Serif+TC:wght@400;700&display=swap');

/* 全域設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 
  讓 body 有更豐富的多段漸層,
  使用 4~5 個顏色, 從淺到深的暖色, 
  由左上(0%) 到右下(100%)
*/
body {
  font-family: 'Noto Sans TC', sans-serif;
  /* 內文字體 */
  line-height: 1.8;
  background: linear-gradient(to bottom right,
      #FFF8F0 0%,
      /* 最淺的奶白 */
      #FFE5CC 25%,
      /* 帶點橘的奶茶色 */
      #FFD8B5 50%,
      /* 更飽和一點的暖色 */
      #FFC79A 75%,
      /* 帶橘調的淺褐 */
      #FFB579 100%
      /* 稍深暖橘 */
    );
  color: #4A3B37;
  /* 帶點咖啡感的深色 */
}

/* 左側固定導覽列 */
.navbar {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  overflow-y: auto;
  /* 多段漸層, 走同一色系但稍作變化 */
  background: linear-gradient(to bottom right,
      #FFECE0 0%,
      #FFDCC2 40%,
      #FFCBA3 70%,
      #FFBD90 100%);
  border-right: 3px solid #FFB27A;
  padding: 20px;
  /* 圓角修飾, 製造柔和感 */
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* 導覽列標題 */
.navbar h2 {
  margin-bottom: 20px;
  font-size: 1.6em;
  text-align: center;
  color: #9C4D2E;
  /* 溫暖的棕色 */
  font-family: 'Merriweather', 'Noto Serif TC', serif;
}

/* 導覽列清單 */
.navbar ul {
  list-style: none;
}

/* 預覽效果 */
html {
  scroll-behavior: smooth;
}


.navbar li {
  margin-bottom: 10px;
}

/* 導覽列連結 */
.navbar a {
  text-decoration: none;
  color: #9C4D2E;
  font-weight: 400;
  transition: color 0.2s ease;
}

/* 讓 section-container 變得更粗 */
.navbar .section-container {
  font-weight: 800 !important;
}


.section-container {
  font-weight: bold;
}

.navbar a:hover {
  color: #BF6A44;
  /* 滑鼠懸停, 更深暖橘 */
}

/* 主內容區 */
main {
  display: flex;
  flex-direction: column;
  margin-left: 240px;
  /* 預留導覽列空間 */
  padding: 20px;
}

/* 頁首 */
header {
  /* 也可以用多段漸層 */
  background: linear-gradient(135deg,
      #FFEADD 0%,
      #FFDCC2 33%,
      #FFCBA3 66%,
      #FFBD90 100%);
  padding: 20px;
  text-align: center;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 2px solid #FFC7A0;
}

header h1 {
  font-size: 2.4em;
  margin-bottom: 10px;
  color: #9C4D2E;
  font-family: 'Merriweather', 'Noto Serif TC', serif;
}

header p {
  font-size: 1.2em;
  color: #5D4E49;
}

/* 分區標題 */
.section-container h2 {
  font-size: 2em;
  margin-bottom: 20px;
  border-left: 6px solid #D78F68;
  padding-left: 10px;
  color: #9C4D2E;
  font-family: 'Merriweather', 'Noto Serif TC', serif;
}

/* 卡片區塊 */
.item-card {
  display: flex;
  /* 圖片與文字都置中（在垂直方向上） */
  align-items: center;
  background-color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #FFDCC2;
  /* 暖色系陰影 */
  box-shadow: 0 3px 8px rgba(156, 77, 46, 0.2);
  transition: background-color 0.3s;
}

/* 圖片貼左側，垂直置中，但不會自動填滿卡片高度 */
.item-card img {
  display: block;
  margin: 0 0 0 10px;
  /* 添加左邊距離 */
  padding: 0;
  width: 200px;
  /* 固定寬度，可自行調整 */
  height: 150px;
  /* 固定高度 */
  object-fit: cover;
  transition: transform 0.3s ease;
  /* 讓放大效果有過渡 */
}

/* 當滑鼠懸停在圖片上時，應用放大效果 */
.item-card img:hover {
  transform: scale(1.1);
  /* 放大 10% */
}

/* 文字區塊 */
.item-info {
  padding: 15px;
  flex: 1;
  /* 文字區塊自動填滿剩餘空間 */
}

.item-info h3 {
  margin-bottom: 10px;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9C4D2E;
  font-family: 'Merriweather', 'Noto Serif TC', serif;
}

.item-info h3 a {
  font-size: 0.85em;
  color: #9C4D2E;
}

.item-info h3 a:hover {
  color: #BF6A44;
}

.item-info p {
  font-size: 1.1em;
  line-height: 1.7;
  margin-bottom: 10px;
  color: #4A3B37;
}

.cost {
  font-weight: bold;
  color: #BF6A44;
  /* 可根據整體色調自行調整 */
  margin-left: 5px;
}

/* 頁尾 */
footer {
  text-align: center;
  background: linear-gradient(135deg,
      #FFEADD 0%,
      #FFDCC2 33%,
      #FFCBA3 66%,
      #FFBD90 100%);
  padding: 10px;
  margin-top: 40px;
  border-radius: 12px;
  border: 2px solid #FFC7A0;
  font-size: 1em;
  color: #5D4E49;
}

#calcButton {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  font-size: 1em;
  color: #fff;
  background-color: #BF6A44;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#calcButton:hover {
  background-color: #A35B3A;
}

#nights {
  width: 30px;
}

/* 搜尋框容器 */
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: fixed;
  /* 固定在右上角 */
  top: 20px;
  /* 從頁面頂部距離 20px */
  right: 20px;
  /* 從頁面右側距離 20px */
  z-index: 10;
  /* 保證搜尋框在其他內容上面 */
  background-color: white;
  /* 讓搜尋框背景顯示清楚 */
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 搜尋輸入框 */
#search-input {
  padding: 8px;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

/* 搜尋按鈕 */
#search-btn {
  padding: 8px 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#clear-btn {
  padding: 8px 16px;
  background-color: #ec3737;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#search-btn:hover {
  background-color: #45a049;
}

/* 高亮顯示符合條件的項目 */
.item-card.highlight {
  background-color: #f0f8ff;
  border-color: #4CAF50;
}

.item-card h3 {
  margin: 0;
}

.item-card p {
  margin: 0;
}

/* 漢堡菜單按鈕 */
.navbar-toggle {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #9C4D2E;
  color: white;
  border: none;
  padding: 10px;
  font-size: 1.5em;
  cursor: pointer;
  z-index: 20;
}

/* 導覽列容器 */
.navbar-container {
  position: relative;
}

/* 當螢幕寬度大於等於 769px 時，顯示導覽列 */
@media (min-width: 769px) {
  .navbar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(
      to bottom right,
      #FFECE0 0%,  
      #FFDCC2 40%,
      #FFCBA3 70%,
      #FFBD90 100%
    );
    border-right: 3px solid #FFB27A;
    padding: 20px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
  }

  main {
    margin-left: 240px; /* 預留導覽列空間 */
  }
}

/* 當螢幕寬度小於 768px 時，調整佈局 */
@media (max-width: 768px) {
  .navbar-toggle {
    display: block;
  }

  .navbar {
    width: 0;
    padding: 0;
    border: none;
    transition: width 0.1s linear, padding 0.1s linear;
  }

  .navbar.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 40%;
    padding: 20px;
    background-color: #FFECE0;
    border-bottom: 3px solid #FFB27A;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 10; /* 導覽列在最上層 */
  }

  .search-container {
    /* 固定在右上角 */
    top: 0;
    right: 0;
  }

  main {
    margin-left: 0;
    margin-top: 60px;
    /* 預留導覽列空間 */
  }

  .item-card {
    flex-direction: column;
    align-items: center;
  }

  .item-card img {
    width: 100%;
    height: auto;
  }

  .navbar h2 {
    font-size: 1.4em;
  }

  .navbar a {
    font-size: 1em;
  }

  header h1 {
    font-size: 2em;
  }

  header p {
    font-size: 1em;
  }

  .section-container h2 {
    font-size: 1.6em;
  }

  .item-info h3 {
    font-size: 1.2em;
  }

  .item-info p {
    font-size: 1em;
  }

  footer {
    font-size: 0.9em;
  }
}

/* 搜尋框容器 */
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed; /* 固定在右上角 */
  top: 20px; /* 從頁面頂部距離 20px */
  right: 20px; /* 從頁面右側距離 20px */
  z-index: 1000; /* 保證搜尋框在其他內容上面 */
  background-color: white; /* 讓搜尋框背景顯示清楚 */
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 搜尋輸入框 */
#search-input {
  padding: 8px;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  margin-right: 10px;
}

/* 搜尋按鈕 */
#search-btn {
  padding: 8px 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#clear-btn {
  padding: 8px 16px;
  background-color: #ec3737;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

#search-btn:hover {
  background-color: #45a049;
}

/* 項目卡片 */
.item-card {
  display: block;
  padding: 10px;
  border: 1px solid #ddd;
  margin: 10px 0;
  transition: background-color 0.3s;
}

/* 高亮顯示符合條件的項目 */
.item-card.highlight {
  background-color: #f0f8ff;
  border-color: #4CAF50;
}

.item-card h3 {
  margin: 0;
}

.item-card p {
  margin: 0;
}

