.custom-marker {
    position: relative;
    width: 60px; /* 마커의 전체 너비 조정 */
    text-align: center;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 8px; /* 텍스트 크기 조정 */
}

.custom-marker .label {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px; /* 내부 여백 줄이기 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-marker .label .name {
    font-weight: bold;
    margin-bottom: 2px;
}

.custom-marker .label .address {
    font-size: 7px; /* 주소 텍스트 크기 조정 */
    color: #555;
}

.custom-marker .arrow {
    position: absolute;
    top: 100%; /* 상자 아래쪽에 위치 */
    left: 50%;
    margin-left: -10px; /* 화살표의 절반 너비로 조정 */
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #4A90E2; /* 화살표 색상 */
}

.custom-marker .price {
    position: absolute;
    top: 100%; /* 상자 아래쪽에 위치 */
    left: 50%;
    margin-left: -20px;
    width: 40px; /* 네모 너비 */
    height: 30px; /* 네모 높이 */
    background-color: #4A90E2;
    color: white;
    line-height: 12px; /* 텍스트의 줄 높이 조정 */
    border-radius: 3px;
    font-size: 8px; /* 텍스트 크기 조정 */
    padding: 2px 0; /* 내부 여백 조정 */
}


body, html {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
}

#map {
  height: 80%;
  width: 100%;
}

/* 축적 */
.controls {
  position: fixed;
  bottom: 70px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.btn-current-location,
.btn-goal {
  background-color: white; /* 버튼 배경색 */
  color: black; /* 텍스트 색상 */
  padding: 5px 8px; /* 상하, 좌우 패딩 */
  border: black 1px solid;
  border-radius: 4px; /* 둥근 모서리 */
  cursor: pointer; /* 마우스 오버시 커서 변경 */
  margin-top: 10px; /* 상단 여백 */
}

.btn-current-location:hover,
.btn-goal:hover {
  background-color: #45a049; /* 마우스 오버시 배경색 변경 */
}

/* 툴바: 디자인 시스템 v0.2 (02-map-preview) — 우상단 16px에 세로 스택
   순서: 로그인/로그아웃 → 그림 → 즐겨찾기 → 정보 → 위치 → LIVE
   (네이버 기본 줌 컨트롤은 zoomControl:false로 꺼져 있음) */
.top-right-controls {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

#logoutForm {
  margin: 0;
  padding: 0;
  display: block;
}

.auth-top-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* 플라이아웃(drawOptions/infoOptions/favoritePopup)의 기준점 */
.map-tool-wrap {
  position: relative;
}

#loginLogoutButton,
#drawButton,
#bookmarkedButton,
#infoButton,
#currentLocationButton,
#liveTrackingButton,
#drawOptions button,
#infoOptions button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #111;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
}

/* 긴 텍스트 라벨(로그아웃/즐겨찾기)은 내용 너비만큼 — 40px 안 줄바꿈 방지 */
#loginLogoutButton,
#bookmarkedButton {
  width: auto;
  min-width: 40px;
  padding: 0 10px;
  white-space: nowrap;
}

#loginLogoutButton:hover,
#drawButton:hover,
#bookmarkedButton:hover,
#infoButton:hover,
#currentLocationButton:hover,
#liveTrackingButton:hover,
#drawOptions button:hover,
#infoOptions button:hover {
  background: #f6f8fb;
}

#drawButton.active,
#bookmarkedButton.active,
#infoButton.active,
#liveTrackingButton.active,
#drawOptions button.active,
#infoOptions button.active {
  background-color: #4caf50 !important;
  color: #fff !important;
}

#drawButton,
#bookmarkedButton,
#infoButton,
#loginLogoutButton {
  position: static;
}

/* 위치/LIVE — 우상단 스택의 마지막 그룹 (디자인 v0.2: 현위치·실시간) */
#locationLiveControls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* 줌 +/− — 스택에서 분리해 우하단 고정 (지도 앱 관례, 목업 스택에는 줌 없음) */
.zoom-control-group {
  position: fixed;
  right: 16px;
  bottom: 56px; /* 네이버 축척 컨트롤(BOTTOM_RIGHT)과 겹침 방지 */
  z-index: 1000;
}

#reactSaveButtonContainer {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1200;
}

#saveButton {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 6px;
  background-color: #4caf50;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#saveButton:hover {
  background-color: #45a049;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#currentLocationButton:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* 플라이아웃 — 각 버튼(.map-tool-wrap) 왼쪽에 가로로 펼침 */
#drawOptions {
  position: absolute;
  top: 0;
  right: 48px;
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

#infoOptions {
  position: absolute;
  top: 0;
  right: 48px;
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

#drawOptions.hidden,
#infoOptions.hidden {
  display: none !important;
}

#lineButton.active {
  background-color: #4caf50;
  color: white;
}

.popup {
  position: absolute;
  background-color: white;
  border: 1px solid black;
  padding: 5px;
  z-index: 1000;
}
/* 숨겨진 옵션들의 초기 상태 */
.hidden {
  display: none;
}

/* 애니메이션 효과를 위한 CSS */
.sliding-left {
  animation: slideLeft 0.7s forwards;
}

.sliding-down {
  /* display: inline; */
  animation: slideDown 0.5s forwards;
}

@keyframes slideLeft {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 검색 패널 스타일 */
.search-panel {
  position: fixed;
  left: 0; /* 검색 패널이 왼쪽에 숨겨져 있을 때의 기본 위치 */
  top: 50%; /* 화면의 중간에 위치 */
  transform: translate(
    -100%,
    -50%
  ); /* 왼쪽으로 전체 너비만큼, 그리고 위로 50%만큼 이동 */
  width: 375px; /* 원하는 너비로 설정 */
  height: 100%; /* 원하는 높이로 설정 */
  background-color: white;
  transition: transform 0.5s; /* transform 속성에 대한 transition을 사용 */
  z-index: 1000;
  box-sizing: border-box;
  padding: 10px;

  display: flex;
  flex-direction: column;
}

/* 화면에 검색창이 표시되어야 하는 경우의 스타일 */
.search-panel.active {
  transform: translateX(0%) translateY(-50%); /* 원래 위치로 돌아오도록 */
}

/* 토글 버튼 스타일 */
#toggleSearch {
  position: absolute;
  right: -30px; /* 토글 버튼이 검색 패널 외부에 보이도록 설정 */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  cursor: pointer;
  background-color: white;
  border-color: white;
}

/* 검색 컨테이너 스타일 */
.search-container {
  position: relative; /* 상대적 위치 설정 */
  width: 100%; /* 또는 원하는 너비 */
  /* 기타 스타일링 */
}

#deleteButton {
  background-color: red;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
}

/* 검색창 스타일 */
#searchInput {
  width: 100%; /* 너비를 컨테이너의 100%로 설정 */
  padding: 10px;
  padding-right: 40px; /* 검색 버튼 공간 확보 */
  font-size: 16px; /* 원하는 폰트 사이즈로 설정 */
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

/* 검색 버튼 스타일 */
#searchButton {
  position: absolute; /* 절대 위치 설정 */
  right: 0; /* 컨테이너 오른쪽 끝에 배치 */
  top: 0;
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
}

/* FontAwesome 아이콘 스타일 */
.fa-search {
  font-size: 20px; /* 아이콘 크기 설정 */
}

.search-and-info {
  flex: 1; /* 상단 1/4 부분 */
  overflow: hidden; /* 내용이 넘치면 숨김 */
}

.scrollable-content {
  flex: 3; /* 나머지 3/4 부분 */
  overflow-y: auto; /* 세로 스크롤 허용 */
}

/* '선' 버튼 활성화 스타일 */
.button-active {
  background-color: gray;
}

/* 팝업 스타일 */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background-color: white;
  border: 1px solid #ccc;
  z-index: 1000;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.popup-content {
  display: flex;
  flex-direction: column;
}

.popup-content label {
  margin-bottom: 10px;
}

.popup-content input {
  margin-bottom: 20px;
  padding: 5px;
}

.popup-content button {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
}

.popup-content button:hover {
  background-color: #0056b3;
}

#favoritePopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 300px;
}

.route-item {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.route-actions {
  display: flex;
  gap: 5px;
}

.route-actions button {
  padding: 4px 8px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.delete-btn {
  background-color: #ff4444;
  color: white;
}

.load-btn {
  background-color: #4caf50;
  color: white;
}

#bookmarkedPopup {
  position: absolute;
  top: 100%; /* 버튼 바로 아래에 위치 */
  left: 0;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 10px;
  z-index: 1000;
  width: 200px; /* 필요에 따라 조정 */
  max-height: 300px; /* 필요에 따라 조정 */
  overflow-y: auto;
}

#bookmarkedList {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#bookmarkedList li {
  padding: 5px 0;
  cursor: pointer;
}

#bookmarkedList li:hover {
  background-color: #f0f0f0;
}

#bookmarkedList li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

#bookmarkedList li span {
  cursor: pointer;
}

#bookmarkedList li button {
  background-color: #ff4d4d;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

#bookmarkedList li button:hover {
  background-color: #ff0000;
}

.hidden {
  display: none;
}

#bookmarkedButton.active {
  background-color: #4caf50; /* 또는 원하는 색상 */
  color: white;
}

.memo-marker {
  background-color: yellow;
  border: 2px solid orange;
  border-radius: 50%;
  width: 20px;
  height: 20px;
}

#memoPopup {
  position: absolute;
  background-color: #ffffa0;
  border: 1px solid #ffd700;
  padding: 10px;
  z-index: 1000;
}

.memo-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.memo-buttons button {
  padding: 5px 10px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
}

.memo-buttons button:hover {
  background-color: #e0e0e0;
}

#memoInput {
  width: 100%;
  height: 100px;
  resize: vertical;
}

#memoButton {
  cursor: pointer;
  padding: 8px 16px;
  background-color: #4B89DC;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

#memoButton:hover {
  background-color: #357ABD;
}

#memoButton.active {
  background-color: #4CAF50;
}

.memo-window {
  position: absolute;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 1000;
  min-width: 200px;
}

.memo-textarea {
  width: 100%;
  height: 100px;
  resize: none;
  border: 1px solid #ddd;
  padding: 5px;
  margin-top: 5px;
  font-size: 14px;
}

.memo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  cursor: move;
}

.memo-header button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px 5px;
  font-size: 16px;
  color: #666;
}

.memo-header button:hover {
  color: #333;
}

/* === Memo Editor Popup (clean card style) === */
.memo-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1099;
  animation: memoFadeIn 0.15s ease-out;
}

.memo-popup-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 440px);
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.18),
    0 4px 8px rgba(15, 23, 42, 0.08);
  z-index: 1100;
  animation: memoSlideIn 0.18s ease-out;
}

.memo-popup-card.hidden {
  display: none;
}

.memo-popup-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.memo-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.memo-popup-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.memo-popup-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.memo-popup-close:hover:not(:disabled) {
  background: #f3f4f6;
  color: #374151;
}

.memo-popup-close:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.memo-popup-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: #111827;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.memo-popup-textarea::placeholder {
  color: #9ca3af;
  font-size: 13px;
}

.memo-popup-textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.memo-popup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #9ca3af;
  min-height: 16px;
}

.memo-popup-dirty {
  color: #f59e0b;
  font-weight: 500;
}

.memo-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.memo-popup-btn {
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  font-family: inherit;
}

.memo-popup-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.memo-popup-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.memo-popup-btn-primary {
  background: #111827;
  color: #ffffff;
}

.memo-popup-btn-primary:hover:not(:disabled) {
  background: #1f2937;
}

.memo-popup-btn-secondary {
  background: #ffffff;
  color: #4b5563;
  border-color: #e5e7eb;
}

.memo-popup-btn-secondary:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #d1d5db;
}

.memo-popup-btn-danger {
  background: #ffffff;
  color: #dc2626;
  border-color: #fecaca;
  margin-right: auto; /* 좌측 정렬 */
}

.memo-popup-btn-danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
}

@keyframes memoFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes memoSlideIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
