/* 最近巡礼点弹窗样式 */

/* 弹窗容器 */
.nearest-points-popup-container {
  padding: 0;
}

.nearest-points-popup-container .leaflet-popup-content-wrapper {
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nearest-points-popup-container .leaflet-popup-content {
  margin: 0;
  width: auto !important;
  min-width: 280px;
}

.nearest-points-popup-container .leaflet-popup-tip {
  background-color: var(--bs-body-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 深色模式适配 */
.dark-mode .nearest-points-popup-container .leaflet-popup-content-wrapper,
.dark-mode .nearest-points-popup-container .leaflet-popup-tip {
  background-color: rgba(33, 37, 41, 0.85);
}

/* 弹窗内容 */
.nearest-points-popup {
  display: flex;
  flex-direction: column;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

/* 坐标信息 */
.coords-info {
  padding: 8px 12px;
  font-size: 0.85rem;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--bs-body-color);
  text-align: center;
  font-family: monospace;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .coords-info {
  background-color: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 巡礼点列表 */
.nearest-points-list {
  display: flex;
  overflow-x: auto;
  padding: 10px;
  gap: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.nearest-points-list::-webkit-scrollbar {
  height: 4px;
}

.nearest-points-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

.nearest-points-list::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.dark-mode .nearest-points-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode .nearest-points-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 巡礼点项目 */
.nearest-point-item {
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
}

.nearest-point-item:hover {
  transform: translateY(-2px);
}

/* 巡礼点图片容器 */
.nearest-point-img {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nearest-point-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.nearest-point-item:hover .nearest-point-img img {
  transform: scale(1.05);
}

/* 距离标签 */
.distance-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  padding: 4px 6px;
  font-size: 0.75rem;
  text-align: right;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  border-radius: 0 0 8px 0;
}

/* 番剧标签 */
.anime-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  padding: 4px 6px;
  font-size: 0.7rem;
  text-align: left;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 8px 8px 0 0;
}

/* 集数标签 */
.ep-label {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: rgba(255, 20, 147, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 0 0 0 8px;
  font-weight: bold;
}

/* 地址信息 */
.location-info {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--bs-body-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  direction: ltr; /* 确保从左到右显示 */
}

.location-info i {
  margin-right: 5px;
  color: #ff1493;
}

.dark-mode .location-info {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-mode .location-info i {
  color: #ff69b4;
}

/* 按钮容器 */
.nearest-points-buttons {
  display: flex;
  padding: 8px 12px;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  flex-wrap: wrap; /* 允许按钮在空间不足时换行 */
}

.dark-mode .nearest-points-buttons {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nearest-points-buttons button {
  flex: 1;
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 100px; /* 确保按钮有最小宽度 */
  transition: all 0.2s ease; /* 平滑过渡效果 */
}

.nearest-points-buttons button i {
  margin-right: 4px; /* 图标和文字之间的间距 */
}

/* 按钮悬停效果 */
.nearest-points-buttons button:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 移动端适配 */
@media (max-width: 767px) {
  .nearest-points-popup-container .leaflet-popup-content {
    min-width: 240px;
    max-width: 90vw;
  }

  .nearest-point-img {
    width: 100px;
    height: 70px;
  }

  .nearest-points-list {
    padding: 8px;
    gap: 6px;
  }

  .anime-label {
    font-size: 0.65rem;
    padding: 3px 5px;
  }

  .distance-label {
    font-size: 0.7rem;
    padding: 3px 5px;
  }

  .ep-label {
    font-size: 0.65rem;
    padding: 2px 4px;
  }

  .location-info {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .nearest-points-buttons {
    padding: 6px 10px;
    gap: 6px;
    justify-content: space-between; /* 在移动端均匀分布按钮 */
  }

  .nearest-points-buttons button {
    min-width: 0; /* 移动端取消最小宽度限制 */
    padding: 0.25rem 0.5rem; /* 减小内边距 */
    font-size: 0.75rem; /* 减小字体大小 */
  }

  .coords-info {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  /* 确保弹窗不会超出屏幕边界 */
  .nearest-points-popup-container {
    max-width: 95vw !important;
  }

  .nearest-points-popup-container .leaflet-popup-content-wrapper {
    max-width: 95vw !important;
  }
}
