/* Maps Core Styles - 공통 스타일 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans', sans-serif;
  overflow: hidden;
  background: #111;
}

#map-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* 로딩 */
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  text-align: center;
}

#loading img {
  display: block;
  margin: 0 auto;
  max-width: 200px;
  height: auto;
}

#loading-text {
  color: white;
  font-size: 18px;
  margin-top: 20px;
}

/* 로고 컨테이너 (좌측 상단) */
.maps-logo-container {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1500;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  padding: 8px 16px;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  transition: opacity 0.2s ease;
}

.maps-logo-container:hover {
  opacity: 0.8;
}

.maps-logo-container img[src*="lufel.webp"],
.maps-logo-container img[data-april-fools-role="logo-mark"] {
  height: 32px;
  width: auto;
  filter: grayscale(100%) contrast(1.5);
  filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.9));
}

.maps-logo-container img[src*="lufelnet.png"],
.maps-logo-container img[data-april-fools-role="logo-text"] {
  width: 90px;
  object-fit: contain;
  filter: drop-shadow(0px 2px 0px rgba(255, 255, 255, 0.9)) invert(1);
  opacity: 0.9;
}

/* 맵 버전 선택기 (PC: 중앙 상단) */
#map-version-selector {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #800000;
  justify-content: center;
}

.version-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 18px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.version-btn:hover {
  color: #fff;
}

.version-btn.active {
  color: #fff;
  background: #800000;
  font-weight: 700;
}

.version-separator {
  display: none;
}

/* ============================================
   모바일 공통 스타일 (플로팅 버튼, 바텀시트, 오버레이)
   ============================================ */

/* 모바일 브레드크럼 네비게이션 */
.mobile-breadcrumb {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  font-size: 12px;
  z-index: 1500;
  align-items: center;
  gap: 12px;
}

.mobile-breadcrumb-logo {
  display: none;
  flex-shrink: 0;
  cursor: pointer;
  align-items: center;
  gap: 6px;
}

.mobile-breadcrumb-logo img[src*="lufel.webp"],
.mobile-breadcrumb-logo img[data-april-fools-role="logo-mark"] {
  height: 20px;
  width: auto;
  filter: grayscale(100%) contrast(1.5);
  filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.9));
}

.mobile-breadcrumb-logo img[src*="lufelnet.png"],
.mobile-breadcrumb-logo img[data-april-fools-role="logo-text"] {
  width: 55px;
  object-fit: contain;
  filter: drop-shadow(0px 2px 0px rgba(255, 255, 255, 0.9)) invert(1);
  opacity: 0.9;
}

.mobile-breadcrumb-items {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.mobile-breadcrumb-items::-webkit-scrollbar {
  display: none;
}

.breadcrumb-item {
  color: rgba(255, 255, 255, 0.7);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.breadcrumb-item:last-of-type:not([style*="display:none"]),
.breadcrumb-item:last-of-type:not([style*="display: none"]) {
  color: #fff;
  font-weight: 600;
}

.breadcrumb-item[data-level="submap"]:not([style*="display:none"]),
.breadcrumb-item[data-level="submap"]:not([style*="display: none"]) {
  color: #fff;
  font-weight: 600;
}

.breadcrumb-separator {
  color: rgba(255, 255, 255, 0.4);
  margin: 0 6px;
  font-size: 14px;
}

/* 모바일 오버레이 (바텀시트 열릴 때 배경) */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
}

/* 모바일 하단 플로팅 버튼 컨테이너 */
.mobile-floating-buttons {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  gap: 16px;
}

/* 모바일 플로팅 버튼 */
.mobile-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: rgba(167, 0, 0, 1);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  gap: 4px;
}

.mobile-fab:hover,
.mobile-fab:active {
  background: rgba(200, 0, 0);
  transform: scale(1.05);
}

.mobile-fab.active {
  background: rgba(200, 0, 0, 1);
}

.mobile-fab svg {
  width: 24px;
  height: 24px;
}

.mobile-fab-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.mobile-fab span {
  font-size: 10px;
  font-weight: 600;
}

/* 바텀시트 공통 스타일 */
.side-panel.mobile-bottomsheet {
  position: fixed !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 70vh;
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 2000 !important;
  overflow: hidden;
}

.side-panel.mobile-bottomsheet.open {
  transform: translateY(0);
}

/* 바텀시트 헤더 (드래그 핸들) */
.bottomsheet-header {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 8px;
  cursor: grab;
  background: inherit;
}

.bottomsheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.bottomsheet-title {
  display: none;
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-top: 8px;
}

/* 바텀시트 닫기 버튼 */
.bottomsheet-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  z-index: 10;
}

.bottomsheet-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 모바일 반응형 - 1200px 이하 */
@media screen and (max-width: 1200px) {
  /* 브레드크럼 표시 */
  .mobile-breadcrumb {
    display: flex;
  }

  /* 브레드크럼 내 로고 표시 */
  .mobile-breadcrumb-logo {
    display: flex;
  }

  /* PC 로고 컨테이너 숨김 */
  .maps-logo-container {
    display: none;
  }

  /* 플로팅 버튼 표시 */
  .mobile-floating-buttons {
    display: flex;
  }

  /* 오버레이 표시 가능하게 */
  .mobile-overlay {
    display: block;
    pointer-events: none;
  }

  .mobile-overlay.active {
    pointer-events: auto;
  }

  /* 바텀시트 헤더 표시 */
  .side-panel.mobile-bottomsheet .bottomsheet-header {
    display: flex;
    flex-direction: column;
  }

  .side-panel.mobile-bottomsheet .bottomsheet-title {
    display: block;
  }

  .side-panel.mobile-bottomsheet .bottomsheet-close {
    display: flex;
  }

  /* 맵 버전 선택기 위치 조정 */
  #map-version-selector {
    left: 50%;
    transform: translateX(-50%);
    top: 50px;
  }

  /* 모바일에서 로고 컨테이너 크기 조정 */
  .maps-logo-container {
    top: 60px;
    left: 10px;
    padding: 6px 12px;
  }

  .maps-logo-container img[src*="lufel.webp"] {
    height: 24px;
  }

  .maps-logo-container img[src*="lufelnet.png"] {
    width: 70px;
  }
}
