/* Khung thông tin chi tiết */
.place-info {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 400px;
  max-height: 95vh;
  overflow-y: auto;
  background: linear-gradient(145deg, #f9f9f9, #ffffff);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 1001;
  display: none;
  border: 2px solid #eee;
}

.place-info:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.info-title {
  font-size: 20px;
  margin-bottom: 15px;
  font-weight: bold;
  color: #2c3e50;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
}

#place-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 10px;
}

.no-img {
  width: 100%;
  height: 180px;
  background-color: #ecf0f1;
  color: #7f8c8d;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  margin-bottom: 10px;
  font-style: italic;
  font-size: 14px;
}

/* Nút đóng */
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 10px;
}

.close-btn:hover {
  color: red;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.info-title {
  font-size: 20px;
  margin: 0;
  color: #2c3e50;
}

.info-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.save-btn {
  position: absolute;
  top: 12px;
  right: 40px;
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 10px;
}

.save-btn:hover {
  color: yellow;
}

/* Nội dung chi tiết */
#place-details h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

#place-details p {
  margin: 8px 0;
  font-size: 14px;
}

#place-details strong {
  color: #1abc9c;
}

.info-section {
  margin-bottom: 10px;
}

/* Khung hiển thị địa điểm đã lưu */
#saved-places-popup {
  position: absolute;
  top: 80px;
  left: 20px;
  width: 300px;
  background: linear-gradient(145deg, #e0f0ff, #ffffff);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  height: 400px;
  overflow: hidden;
  display: none;
}

#saved-places-popup h3 {
  margin: 0;
  padding: 14px 20px;
  background-color: #1e90ff;
  color: white;
  font-size: 18px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  text-align: center;
}

#saved-places-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  list-style: none;
  margin: 0;  
  height: 300px;
}

#saved-places-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  border-left: 4px solid #1e90ff;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  color: #1e90ff;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

#saved-places-list li:hover {
  background-color: #e6f3ff;
  transform: translateX(4px);
}

#saved-places-popup .close-popup-btn {
  background-color: #1e90ff;
  color: white;
  border: none;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  transition: background-color 0.2s ease;
  position: absolute;
  width: 100%;
  bottom: 0;
}

#saved-places-popup .close-popup-btn:hover {
  background-color: #0c6cd4;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.delete-btn:hover {
  color: red;
}

.delete-btn i {
  pointer-events: none;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .place-info  {
    position: fixed; 
    top: auto;      
    bottom: 20px;
    left: 65%; 
    transform: translateX(-50%);
    width: 90%;     
    max-width: 380px;
    z-index: 2000; 
  }

  #saved-places-popup {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 280px;
    background: linear-gradient(145deg, #e0f0ff, #ffffff);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    height: 350px;
    overflow: hidden;
    display: none;
  }

  #saved-places-list {
    height: 250px;
  }
}

@media (max-width: 580px) {
  .place-info  {
    position: fixed; 
    top: auto;      
    bottom: 20px;
    left: 50%; 
    transform: translateX(-50%);
    width: 90%;     
    max-width: 380px;
    z-index: 2000; 
  }

  #saved-places-popup {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 250px;
    background: linear-gradient(145deg, #e0f0ff, #ffffff);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    height: 300px;
    overflow: hidden;
    display: none;
  }

  #saved-places-list {
    height: 200px;
  }
}