:root {
  --primary: #2c3e50;
  --accent: #d4a373;
  --bg: #f4f7f6;
  --meal-bg: #fdf2e9;
  --hotel-bg: #e8f4f8;
}
* {
  box-sizing: border-box;
}
body,
html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
}
.main-container {
  display: flex;
  height: 100vh;
  flex-direction: row;
}
#sidebar {
  width: 45%;
  /* 桌機版此設定會影響aos 特效 */
  overflow-y: auto;
  background: white;
  z-index: 10;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
}
.header {
  padding: 30px 25px;
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 20;
}
.itinerary {
  padding: 20px;
  background-color: seashell;
}
.day-group {
  padding: 20px;
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.03);
}
.day-group:not(:last-child) {
  margin-bottom: 20px;
}
.day-label {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  /* 增加左側裝飾線條，強化視覺重點 */
  border-left: 5px solid var(--accent);
  border-bottom: none; /* 移除原本的底線 */
  padding: 0 0 0 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}
.card {
  background: #fcfcfc;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid #f0f0f0;
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateX(5px);
  border-left: 5px solid var(--accent);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.spot-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}
.spot-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

/* 新增：餐食與住宿樣式 */
.info-box {
  font-size: 13px;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
}
.info-box i {
  margin-right: 10px;
  margin-top: 3px;
  width: 15px;
  text-align: center;
}
.meal-info {
  background: var(--meal-bg);
  color: #873600;
  border: 1px solid #fad7a0;
}
.hotel-info {
  background: var(--hotel-bg);
  color: #1b4f72;
  border: 1px solid #aed6f1;
  cursor: pointer;
}
.meal-item {
  margin-right: 10px;
}

#map-container {
  width: 55%;
  flex-grow: 1;
}
iframe {
  width: 100%;
  height: 100%;
  border: none;
}
#goToTop {
  position: fixed;
  bottom: 30px;
  right: calc(50% + 100px);
  z-index: 999;
  border: none;
  outline: none;
  background-color: var(--primary); /* 使用你原本的深藍色 */
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
}

#goToTop:hover {
  background-color: var(--accent); /* 滑過時變為暖木色 */
  transform: translateY(-5px);
}

/* 當按鈕顯示時的 class */
#goToTop.show {
  opacity: 1;
  visibility: visible;
}

.flight-trigger {
  position: relative; /* 重要：讓 popup 以此為基準 */
  display: inline-block;
  cursor: pointer;
}

.flight-trigger p {
  margin: 0;
  display: flex;
  align-items: center;
}

.info-icon {
  margin-left: 10px;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.flight-popup {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 130%; /* 距離觸發點下方一段距離 */
  left: 0;
  width: 280px;
  background-color: white;
  color: var(--primary); /* 使用你原本的深藍色 */
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: all 0.3s ease;
  pointer-events: none; /* 防止擋住下方滑鼠操作 */
}

/* 內部排版微調 */
.flight-item strong {
  color: var(--accent); /* 使用暖木色強調航班號 */
  display: block;
  margin-bottom: 3px;
}
.flight-item p {
  font-size: 13px;
  color: #555;
  margin: 0;
}
.flight-popup hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 10px 0;
}

/* Hover 觸發顯示 */
.flight-trigger:hover .flight-popup {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.specialty-text {
  /* display: flex;
  align-items: center;
  justify-content: space-between; */
  flex: 1;          /* 新增：佔滿剩餘空間 */
  min-width: 0;     /* 新增：允許文字收縮，防止撐破容器 */
  gap: 8px;
  word-break: keep-all;
}

/* 特產 info-box 內的圖示容器 */
.specialty-icon-container {
  position: relative;
  cursor: help; /* 讓鼠標變成問號，提示有隱藏資訊 */
}

/* 預設隱藏的小圖片 */
.specialty-preview-img {
  position: absolute;
  bottom: 120%; /* 顯示在圖示上方 */
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  width: 200px;
  height: 140px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  border: 2px solid white;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  pointer-events: none; /* 避免擋住滑鼠操作 */
}

/* Hover 圖示時顯示圖片 */
.specialty-icon-container:hover .specialty-preview-img {
  opacity: 1;
  visibility: visible;
  transform: translateX(-75%) scale(1);
}

/* 針對特產區塊內的相機圖示放大 */
.specialty-icon-container i.fa-image {
  font-size: 20px;         /* 調整這裡的大小，原本預設大約是 14-16px */
  margin-left: 10px;       /* 與左側文字保持距離 */
  color: #a569bd;          /* 稍微淡一點點的紫色，增加層次感 */
  transition: color 0.3s;
}

/* Hover 圖示時，圖示本身也可以有一點變化回饋 */
.specialty-icon-container:hover i.fa-image {
  color: #6c3483;          /* 變回深紫色 */
}

/* 調整 info-box 內部對齊，確保放大後的圖示與文字置中對齊 */
.specialty-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;      /* 稍微增加一點內距 */
  background: #f5eef8;
  color: #6c3483;
  border: 1px solid #d7bde2;
  cursor: pointer;
  transition: all 0.3s ease;
}

.day-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.weather-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 400;
  font-size: 16px;
  font-weight: 400;
  background: rgba(212, 163, 115, 0.12);
  border: 1px solid rgba(212, 163, 115, 0.3);
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
  transition: all 0.4s ease;
}

.weather-badge:hover {
  transform: scale(1.1);
}

.wb-icon { font-size: 16px; }
.wb-hi { color: #c0392b; font-weight: 600; }
.wb-sep { color: #aaa; }
.wb-lo { color: #2980b9; font-weight: 600; }
.wb-rain { color: #555; margin-left: 4px; }

@media (max-width: 992px) {
  .main-container {
    flex-direction: column;
    height: auto;
  }
  h1 {
    margin: 0px 0px 10px 0px;
  }
  #sidebar {
    width: 100%;
    order: 2;
  }
  #map-container {
    width: 100%;
    height: 40vh;
    position: sticky;
    top: 0;
    z-index: 100;
    order: 1;
  }
  #goToTop {
    right: 20px;
  }
  .flight-popup {
    position: absolute; /* 改回 absolute，不再固定於螢幕中央 */
    top: 130%; 
    left: 0;
    transform: none; /* 移除位移修正 */
    width: 260px; /* 給予固定寬度，避免手機寬度撐開 */
    visibility: hidden;
    opacity: 0;
    z-index: 1000;
  }
  /* 重新把小箭頭顯示回來 */
  .flight-popup::after {
    display: block;
  }
  /* 修正手機版 Header 空間，避免 popup 被裁切 */
  .header {
    padding: 10px 25px;
    overflow: visible !important;
  }
  .specialty-info {
    flex-direction: column;   /* 左右改為上下排列 */
    align-items: flex-start;  /* 靠左對齊 */
    gap: 8px;
  }
  .specialty-icon-container {
    align-self: flex-end;     /* 圖片預覽圖示推到右側 */
  }
  /* 手機版預覽圖改為向上展開，避免被裁切 */
  .specialty-preview-img {
    left: auto;
    right: 0;
    transform: translateX(0) scale(0.8);
  }
  .specialty-icon-container:hover .specialty-preview-img {
    transform: translateX(0) scale(1);
  }
  .day-label {
    font-size: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}