: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 {
  min-width: 70%;
}

#reportContainer {
  display: none;
  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 {
  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: 24px;
}

.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;
}

.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;
  left: 50%;

  z-index: 1;

  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 8px;
  border-radius: 4px;

  transition: 0.4s ease;
  transform: translateX(-50%);
  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: 0;
  left: -335px;

  width: 400px;
  height: 100%;

  display: grid;
  grid-template-columns: 7fr 1fr;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;

  transition: 0.4s ease;
}

#infoContainer:has(input[name='route']:checked) {
  left: 0;
}

/* 경로 선택 */
#selector {
  display: flex;
  flex-direction: column;

  user-select: none;
  background: transparent;
  border-bottom-right-radius: 16px;
}

#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;
}

input[type='text']:not(:disabled) {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid #999;

  font-size: 15px;
}

#selector > label > span {
  display: flex;
  text-align: center;
  justify-content: center;
  padding: 20px;

  font-weight: bold;
  font-size: 20px;

  transition: 0.3s ease;
}

#selector > label:has(:checked) > span {
  transform: rotate(180deg);
}

/* --------------------------------------------- */

#transmission {
  display: none;
}

#NWAs {
  display: none;
  overflow-y: scroll;
}

#NWAs::-webkit-scrollbar {
  display: none;
}

.formContainer {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.energyFormContainer::-webkit-scrollbar {
  display: none;
}

.energyForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 보고서 버튼 */

input[name='sideMenu'] {
  display: none;
}

#buttonContainer {
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 48px;
  height: 48px;
  padding: 8px;

  background: white;
  border-radius: 50%;
}

#buttonContainer svg:last-child,
#buttonContainer input[name='sideMenu']:checked + svg {
  display: none;
}

#buttonContainer:has(input[name='sideMenu']:checked) svg:last-child {
  display: block;
}

/* 보고서 폼 */
#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: 16px;
  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: 40%;
  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;
}

#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;
  }
}
