@charset "utf-8";
/* 마을지도 페이지 스타일 */

.village-map-page {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
  margin: calc(var(--spacing-xl, 2rem) * -1) 0 0 0;
  padding: 0;
  overflow: hidden;
  --map-primary-tabs-height: 56px;
}

body.is-map-page .footer {
  display: none;
}

body.is-map-page {
  overflow: hidden;
}

/* 1차 분류 탭 (상단) */
.map-primary-tabs {
  background: var(--color-primary-green, #28a745);
  padding: 0;
  flex-shrink: 0;
  z-index: 10;
}

.map-primary-tabs .container {
  max-width: 100%;
  padding: 0;
}

.map-primary-tabs-inner {
  padding: 0.5rem var(--spacing-md, 1rem);
  gap: var(--spacing-sm);
  background: var(--color-primary-green-dark);
}

.map-primary-tabs-inner .tab-item {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  position: relative;
  background: transparent;
}

.map-primary-tabs-inner .tab-item.active {
  background: #fff;
  color: var(--color-text-black);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.map-primary-tabs-inner .tab-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.village-map-page .tabs-secondary .tab-item {
  border: none;
}

/* 지도 컨테이너 */
.map-container-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-container {
  width: 100%;
  height: 100%;
  position: relative;
  background: #f5f5f5;
}

/* 2차 분류 (모바일 상단 가로 스크롤) */
.map-secondary-scroll {
  display: flex;
  gap: var(--spacing-sm);
  position: relative;
  padding: var(--spacing-sm);
  overflow-x: auto;
  white-space: nowrap;
  background: transparent;
  -webkit-overflow-scrolling: touch;
}

.map-secondary-scroll .category-button {
  flex-shrink: 0;
}

.map-secondary-scroll::-webkit-scrollbar {
  display: none;
}

/* 지도 placeholder */
.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #666;
  font-size: 1.125rem;
}

/* 2차 분류 카테고리 버튼들 (데스크톱 - 지도 위) */
.map-category-buttons {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  z-index: 20;
  max-width: calc(100% - 320px); /* 필터 패널 공간 확보 */
}

.category-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.05rem;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 600;
  color: var(--color-text-black, #414141);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.category-button:hover {
  background: #fefefe;
  border-color: #d9d9d9;
}

.category-button.active {
  background: #fff;
  border-color: var(--color-primary-orange, #FF6733);
  color: var(--color-primary-orange, #FF6733);
}

.category-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 필터 패널 (데스크톱 - 오른쪽) */
.map-filter-panel {
  position: absolute;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  box-sizing: border-box;
  width: 300px;
  max-height: calc(100% - 10rem);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  z-index: 30;
  padding: var(--spacing-md);
}

.filter-section {
  margin-bottom: var(--spacing-md);
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section-title {
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  color: var(--color-text-dark, #333);
  margin-bottom: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.filter-button {
  padding: var(--spacing-xs) var(--spacing-md);
  background: #eee;
  border: 1px solid #eee;
  border-radius: 20px;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--color-text-gray, #666);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-button:hover {
  border-color: var(--color-primary-purple);
  background: #fff;
  color: var(--color-primary-purple);
}

.filter-button.active {
  background: #fff;
  border-color: var(--color-primary-purple);
  color: var(--color-primary-purple);
}

/* 인포윈도우 (데스크톱) */
.map-info-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  max-width: 350px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: var(--spacing-md);
  z-index: 40;
  box-sizing: border-box;
  pointer-events: auto;
  display: block;
  margin: 0;
  /* 바텀시트처럼 올라오지 않도록 명시적으로 설정 */
  bottom: auto;
  animation: none;
}


.map-info-window.hidden {
  display: none;
}

.info-window-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.info-window-close img {
  width: 100%;
  height: 100%;
}

.info-window-title {
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  color: var(--color-text-dark, #333);
  padding-right: 2rem;
}

.info-window-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px dashed var(--color-border, #ddd);
}

.info-tag {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-primary-orange, #ff6b35);
  color: #fff;
  border-radius: 20px;
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: 500;
}

.info-window-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.info-label {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-gray, #666);
  flex: 0 0 72px;
}

.info-value {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-dark, #333);
  line-height: 1.5;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  text-align: end;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* 모바일 필터 토글 버튼 */
.map-filter-toggle {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  background: var(--color-primary-purple, #28a745);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1100;
  padding: 0;
  line-height: 0;
}

.map-filter-toggle img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.map-location{
  position: absolute;
  bottom: calc(1rem + 80px )
  left: 15px;
  width: 50px;
  height: 47px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  padding: 0;
  line-height: 0;
}

map-location img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.map-location.active img {
  filter: invert(0%)sepia(0%)hue-rotate(190deg)
}

/* 모바일 필터 오버레이 */
.map-filter-overlay {
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: calc(80vh - 80px);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.map-filter-overlay.active {
  display: flex !important;
}

.filter-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border, #ddd);
  flex-shrink: 0;
}

.filter-overlay-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.filter-overlay-close img {
  width: 100%;
  height: 100%;
}

.filter-overlay-title {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: 600;
  color: var(--color-text-dark, #333);
}

.filter-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.filter-more {
  width: 100%;
  padding: 1rem;
  background: none;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  font-size: var(--font-size-base, 1rem);
  color: var(--color-text-gray, #666);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.filter-more img {
  width: 16px;
  height: 16px;
}

.filter-overlay-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--color-border, #ddd);
  flex-shrink: 0;
}

.filter-reset {
  flex: 1;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  font-size: var(--font-size-base, 1rem);
  font-weight: 500;
  color: var(--color-text-gray, #666);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.filter-reset img {
  width: 16px;
  height: 16px;
}

.filter-apply {
  flex: 2;
  background: var(--color-primary-orange);
  border: none;
  border-radius: 8px;
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}

.map-info-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 350px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  z-index: 40;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
}


.info-card-title {
  font-size: var(--font-size-lg, 1.125rem);
  font-weight: 600;
  color: var(--color-text-dark, #333);
  margin-bottom: var(--spacing-md);
}

.info-card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px dashed var(--color-border, #ddd);
}

.info-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 반응형: 데스크톱/모바일 표시 제어 */


.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .village-map-page {
    height: calc(100vh - var(--header-height, 60px));
  }

  .map-primary-tabs {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
  }
   .mobile-only {
    display: block; /* 또는 초기값 */
  }
  
  .map-filter-overlay.mobile-only {
    display: none; /* 기본은 숨김 */
  }
  
  .map-filter-overlay.mobile-only.active {
    display: flex !important;
  }

  .desktop-only {
    display: none !important;
  }


  .map-primary-tabs-inner {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .map-primary-tabs-inner::-webkit-scrollbar {
    display: none;
  }

  .map-primary-tabs-inner .tab-item {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .map-secondary-scroll {
    position: absolute;
    top: 50px;
    display: flex;
    left: 0;
    right: 0;
    z-index: 55;
  }

  .map-filter-toggle, .map-location {
    bottom: calc(1rem + 70px);
  }

  .map-filter-overlay {
    animation: slideUp 0.3s ease-out;
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .map-info-card {
    /* 애니메이션 제거 - 중앙에 고정 표시 */
    animation: none;
    flex-direction: column;
  }

  /* 모바일에서 인포윈도우는 절대 표시되지 않도록 */
  .map-info-window {
    display: none !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    bottom: auto !important;
    right: auto !important;
  }
}

#panohtml {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
}

#pano {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.pano-ui {
    position: absolute;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
}

.info-panorama-close {
    pointer-events: auto;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: none;
    border: none;
    cursor: pointer;
}

.info-panorama-close img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
}

@media (max-width: 500px) {
  .map-filter-overlay {
    bottom: 70px;
  }
}
