/* 지도 컨테이너 스타일 오버라이드 */
#container {
  display: flex !important;
  width: 100% !important;
  height: 600px !important; /* 명시적인 높이 설정 */
  flex-grow: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important; /* 컨테이너 내부에만 overflow 적용 */
  background-color: #f5f5f5;
}

#mapWrapper {
  position: relative !important;
  width: 100% !important;
  min-height: 300px !important; /* 최소 높이 설정 변경 */
}

#map {
  width: 100% !important;
  height: 100% !important;
  min-height: 300px !important; /* 최소 높이 설정 변경 */
}

/* 로드뷰 영역 스타일 추가 */
#roadview {
  min-height: 300px !important; /* 로드뷰 최소 높이 설정 */
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* 모바일 세로모드에서 로드뷰 활성화 시 스타일 */
@media (max-width: 1024px) and (orientation: portrait) {
  #container.roadview-active #mapWrapper {
    height: 45% !important;
    min-height: 200px !important;
  }
  
  #container.roadview-active #roadview {
    display: block !important;
    width: 100% !important;
    height: 55% !important;
    min-height: 250px !important;
  }
}

/* 모바일 가로모드에서 통계 오버레이 위치 조정 */
@media (max-width: 1024px) and (orientation: landscape) {
  .stats-overlay {
    top: 70px !important; /* 위치를 아래로 내림 (노트코드 입력란 아래로) */
    left: 70px !important; /* 왼쪽 버튼 그룹 오른쪽으로 위치 */
    max-width: 240px !important;
    max-height: 70vh !important;
    z-index: 1300 !important; /* 다른 UI 요소보다 위에 표시 */
    background-color: rgba(255, 255, 255, 0.95) !important; /* 약간 투명도 조정 */
  }
}

/* 설정 버튼 관련 스타일 */
.settings-button-container {
  position: absolute !important;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  right: 20px !important;
  z-index: 1500 !important; /* 높은 z-index 설정 */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 설정 버튼 스타일 명시적 지정 */
#settingsButton {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background-color: white !important;
  border: 1px solid #ddd !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  font-size: 24px !important;
  line-height: 1 !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 모바일 환경에서 설정 버튼 스타일 조정 */
@media (max-width: 1024px) {
  .settings-button-container {
    bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
    flex-direction: row !important;
    gap: 10px !important;
  }
}
