:root {
  --main-background: 109, 122, 196;
}

*,
*::before,
*::after {
  font-family: 'Noto Sans KR', Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}

html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

dl {
  margin: 0;
}

#map {
  height: 100vh;
  width: 100%;
}

button {
  cursor: pointer;
}

button:not(:disabled):hover {
  opacity: 0.8;
}

button:disabled {
  cursor: auto;
}

/* 컴포넌트 */
.km::after {
  font-size: 0.8em;
  content: ' km';
}

.cost::after {
  font-size: 0.8em;
  content: ' 원';
}

.roundHorizon {
  width: 100%;
  margin: 4px 0;
  border-radius: 50%;
  border-top: none;
  border-bottom: 1px solid #d5d5d5;
}

/* ------------------------------------------------ */

/* 메인 컨테이너 */
#mainContainer {
  display: flex;
}
#mainContainer > * {
  width: 100%;
}

#mainContainer > *:first-child {
  max-width: 29%;
}

#reportContainer {
  display: inline-block;
  height: 100vh;

  transition: 0.4s ease;
}

/* 정보 테이블 */
#infoTable {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  gap: 16px;

  background: white;
  box-shadow: 2px 2px 24px rgb(0, 0, 0, 0.2);
}

.next {
  background: rgb(var(--main-background));
  border-radius: 4px;
  border: none;

  width: 100%;
  padding: 16px;
  color: white;
  font-size: 20px;
  font-weight: bold;
}

#daumLocation, #daumLocation2 {
  margin-left: 16px;
  background: rgb(var(--main-background));
  border: none;
  border-radius: 2px;

  padding: 4px 8px;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.flexBottom {
  margin-top: auto;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: center;
}

.grid3 > :first-child {
  text-align: left;
}

.transmissionContainer {
  display: flex;
  flex-direction: column;

  gap: 32px;
}

.transmission {
  display: grid;
  grid-template-columns: 1fr 2.5fr;

  align-items: center;
  justify-content: center;
  text-align: center;

  gap: 10px;
}

.transmission > .transmissionInputContainer {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.transmission > .transmissionInputContainer > div {
  display: grid;

  grid-template-columns: 1fr 1fr 1.2fr;
  align-items: center;
}

.transmission > .transmissionInputContainer > div > span:first-child {
  text-align: left;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap:10px

}

.routeBox {
  display: flex;
  flex-direction: column;

  width: 100%;
  padding: 8px;

  border: 1px solid #ccc;
  border-radius: 4px;

  font-weight: bold;
}

.routeBox > h3 {
  text-align: center;
}

.routeBox > hr {
  width: 100%;
  border-top: 1px solid #ccc;
}

.elementBox {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.elementBox > .element {
  display: grid;
  grid-template-columns: 1fr 3fr;
  justify-content: center;

  padding: 0 16px;
}

.elementBox > .element > :first-child {
  text-align: center;
}

.elementBox > .element > :last-child {
  text-align: right;
}

/* ------------------------- */

#legendContainer {
  position: fixed;
  top: 8px;
  right: 0%;

  z-index: 1;

  display: grid;
  /* grid-template-columns: 1fr 1fr 1fr 1fr; */
  gap: 8px;
  border-radius: 4px;

  /* transition: 0.4s ease;
  transform: translateX(-5%); */
  margin-right:10px;
  background: white;

  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;

  box-shadow: 2px 2px 8px rgb(0, 0, 0, 0.2);
}

.legend {
  user-select: none;
  cursor: pointer;
  display: flex;
  gap: 4px;
  align-items: center;
  color: #999;
}

.legend > input[name='legend'] {
  display: none;
}

.legend:has(:checked) {
  color: black;
}

.legendIcon {
  width: 24px;
  height: 24px;
}

/* 사이드 바 */
#infoContainer {

  position: fixed;
  top: 50%;
  left: 43%;
  transform: translate(-50%, -50%);
  /* left: -850px; */

  height: 90vh;

  /* display: none; */
  display: none;
  grid-template-columns: 7fr 1fr;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;

  /*transition: 0.4s ease;*/
}

#infoContainer:has(input[name='report_check']:checked) {
  left: 30%;
}

/* 경로 선택 */
#selector {
  display: flex;
  flex-direction: column;

  user-select: none;
  background: transparent;
  border-bottom-right-radius: 16px;
  width: 50px;
}

#selector > label {
  display: flex;
  text-align: center;
  justify-content: center;
  cursor: pointer;

  background: white;
  border-left: 1px solid #ccc;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

#selector > label > input {
  display: none;
}

#selector .routeButton {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #ccc;
  font-weight: bold;

  width: 65px;
  height: 65px;
  background: white;
  text-align: center;

  border-left: 1px solid #ccc;
}

#selector .routeButton:first-child {
  border-top-right-radius: 4px;
}

#selector .routeButton:last-child {
  border-bottom-right-radius: 4px;
}

#selector .routeButton:not(:first-child) {
  border-top: 1px solid #ccc;
}

#selector .routeButton > input {
  display: none;
}

#selector .routeButton:has(:checked) {
  color: rgb(var(--main-background));
}

input[type='text'] {
  padding: 4px;
  font-weight: bold;
  width: 100px;
}

input.w250 {
  width: 250px;
}

select {
  width: 250px;
  padding: 5px 10px;
}

input[type='text']:not(:disabled) {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid #999;

  font-size: 15px;
  width: 100px;
}

#selector > label > span {
  display: flex;
  text-align: center;
  justify-content: center;
  padding: 15px;

  font-weight: bold;
  font-size: 20px;

  transition: 0.3s ease;
}

#selector > label:has(:checked) > span {
  transform: rotate(180deg);
}

/* --------------------------------------------- */

#transmission, #NWAs, #distribution {
  display: none;
}


#NWAs::-webkit-scrollbar {
  display: none;
}

.formContainer {
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-height: 95vh;
  overflow-y: scroll;
}

.formContainer::-webkit-scrollbar {
  display: none;
}

.energyForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 보고서 버튼 */

input[name='sideMenu'] {
  display: none;
}

#buttonContainer {
  cursor: pointer;
  position: absolute;
  
  /* top: 20px;
  left: 20px; */

  display: flex;
  justify-content: center;
  align-items: center;

  width: 64px;
  height: 64px;
  /* padding: 8px; */

  background: white;
  /* border-radius: 50%; */
}

#buttonContainer svg:last-child,
#buttonContainer input[name='sideMenu']:checked + svg {
  display: block;
}

#buttonContainer:has(input[name='sideMenu']:checked) svg:last-child {
  display: none;
}

/* 보고서 폼 */
#reportContainer {
  user-select: none;
}

#reportContainer > nav {
  display: flex;
  margin: 4px;

  padding: 8px;
}

#reportContainer > nav > label {
  color: #ccc;

  transition: 0.3s ease;

  border-bottom: 1px solid white;
}

#reportContainer > nav > label > input[type='radio'] {
  display: none;
}

#reportContainer > nav > label > span {
  display: flex;
  text-align: center;
  justify-content: center;
  padding: 16px;

  font-weight: bold;
  font-size: 24px;
}

#reportContainer > nav > label:has(input[type='radio']:checked) {
  color: rgb(var(--main-background));
  border-bottom: 1px solid rgb(var(--main-background));
}

#reportContainer > nav > label:has(input[type='radio']:not(:disabled)) {
  cursor: pointer;
}

#reportContainer > nav > label:has(input[type='radio']:disabled) {
  display: none;
}

.roundBox {
  padding: 12px;
  border-radius: 4px;

  box-shadow: 4px 4px 12px rgb(213, 213, 213, 0.5);
  border: 0.5px solid #dfdfdf;
}

.report {
  padding: 20px;
  height: calc(100% - 98px);

  display: flex;
  flex-direction: column;

  gap: 8px;
}

.report > h2 {
  text-align: center;
}

.flex-col-gap16 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 보고서 결과 모달 */
#reportSummary {
  width: 50%;
  height: 90vh;

  box-shadow: 2px 2px 24px rgb(0, 0, 0, 0.4);
  border: none;
  padding: 0;

  overflow: unset;
}

#modalButtonContainer {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

#modalButtonContainer > button {
  height: 56px;

  font-size: 24px;
  font-weight: bold;
  border: none;

  background: rgb(var(--main-background));
  color: white;
}

#modalButtonContainer > button:last-child {
  background: #999;
}

#reportSummaryContainer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;

  overflow-y: auto;

  height: calc(100% - 56px);
}

#chartContainer {
  width: 100%;

  display: grid;
  flex-direction: column;
  grid-template-columns: 1fr 1fr;

  justify-content: center;
  align-items: center;
  gap:50px;
}

#reportSummaryContainer dl > dt {
  margin: 8px 0;
}

.mr32 {
  margin-right: 32px;
}

.mt8 {
  margin-top: 8px;
}

.tdu {
  text-decoration: underline;
}

#chartSummary {
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;
}

#chartSummary > p {
  text-align: right;
}

#chartSummary > * {
  width: 100%;
}

.baseTable {
  width: 100%;
  margin: 4px 0;
  border-collapse: collapse;
  border-top: 1px solid #999;
}

.baseTable :where(th, td) {
  padding: 5px 0 11px;
  border-bottom: 1px solid #999;
  text-align: center;
}
/* 경로 마우스 호버시 나타나는 툴팁 창 */
#tooltipContainer {
  display: none;
  position: absolute;
  background: white;
  border-radius: 8px;
  padding: 20px 12px;

  transform: translateY(calc(-100% - 2px));
  animation: hover-tooltip 0.5s;
}
/* ----------------------------------- */

@keyframes hover-tooltip {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}



#fixed-infowindow {
  position: fixed;
  bottom: 8px;
  right: 0%;
  max-height: 520px;
  overflow-y: scroll;
  z-index: 1;
  display: none;
  padding: 16px 20px;
  min-width: 300px;
  border-radius: 4px;
  /* transition: 0.4s ease;
  transform: translateX(-5%); */
  margin-right: 10px;
  background: white;
  box-shadow: 2px 2px 8px rgb(0, 0, 0, 0.2);
}


.info-content {
  font-family: Arial, sans-serif;
  line-height: 1.5;
}
.info-header {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 10px;
  align-items: center;
}
.info-header button {
  background: white;
  border: 1px solid #3498db;
  color: #3498db;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.info-header button:hover {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}
.info-item {
  margin-bottom: 8px;
}
.info-item strong {
  color: #3498db;
}
.info-item p {
  margin: 0;
}

/* 전체 스크롤바 스타일 */
#fixed-infowindow::-webkit-scrollbar {
  width: 8px; /* 스크롤바 너비 */
}

#fixed-infowindow::-webkit-scrollbar-track {
  background: #f1f1f1; /* 스크롤바 배경 */
  border-radius: 4px; /* 스크롤바 배경의 모서리 둥글게 */
}

#fixed-infowindow::-webkit-scrollbar-thumb {
  background: #3498db; /* 스크롤바 손잡이 색상 */
  border-radius: 4px; /* 스크롤바 손잡이의 모서리 둥글게 */
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2); /* 손잡이 그림자 */
}

/* 스크롤바 손잡이의 hover 상태 */
#fixed-infowindow::-webkit-scrollbar-thumb:hover {
  background: #2980b9; /* 손잡이 hover 색상 */
}

/* 스크롤바 손잡이의 active 상태 */
#fixed-infowindow::-webkit-scrollbar-thumb:active {
  background: #1f5c9e; /* 손잡이 active 색상 */
}

/* 로딩바 디자인 */
/* 로딩바의 배경 설정 (화면 전체 어둡게) */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* 어두운 배경 */
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* 다른 요소 위에 표시 */
}

/* 로딩 점들 */
.dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 50%;
  opacity: 0.5;
  animation: blink 1.4s infinite both;
}

/* 각 점의 애니메이션 딜레이 */
.dot:nth-child(1) {
  animation-delay: 0s;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* 점 깜빡임 애니메이션 */
@keyframes blink {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}


#distributionChart {
  display: none;
}

.flex_center {
  display: flex;
  justify-content: center;
}