/* =========================================
   1. 기본 설정 및 레이아웃
   ========================================= */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #ffffff;
  margin: 0;
  box-sizing: border-box; 
}

.hidden {
  display: none !important;
}

.container {
  max-width: 520px;
  margin: 0px auto;
  padding: 25px;
  background: linear-gradient(135deg, #0d233a 0%, #11496c 50%, #1aa6a6 100%);
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  min-height: 450px; 
  position: relative;
  overflow: hidden; 
}

/* =========================================
   2. 헤더 및 텍스트 스타일
   ========================================= */
.header-area {
  max-width: 520px;
  margin: 30px auto 40px auto;
  padding: 0 25px;
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  color: #7d7d7d;
  font-size: 0.8rem;
  position: relative;
}

.header-text {
  flex: 1; 
  cursor: pointer; 
  transition: opacity 0.2s;
}

.header-text:hover {
  opacity: 0.8; 
}

.header-text h1 {
  margin: 0;
  padding: 0;
  color: #11496c;
  font-size: 2.0rem; 
  margin-bottom: 0px; 
  text-align: left;
}

.header-text h2 {
  margin: 0;
  padding: 0;
  color: #5c5c5c;
  font-size: 1rem;
  margin-bottom: 5px;
}

.disclaimer-area {
  max-width: 520px;
  width: 100%;
  margin: 0 auto 10px auto;
  padding: 0 0px;
  box-sizing: border-box;
  text-align: left; 
  font-size: 0.75rem;
  color: #7d7d7d;
}

.disclaimer-area p {
  margin: 0;
  line-height: 1.2;
}

.twovision-logo {
  width: 95px;
  height: auto;
  vertical-align: middle;
}

.footer-text {
  margin-top: 24px;
  text-align: center;
  color: #1aa6a6;
  font-size: 0.85rem;
  line-height: 1.4;
}

.hamburger-btn-wrapper {
  width: 44px;  
  height: 44px; 
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center; 
  border-radius: 50%;
  transition: background-color 0.2s;
  margin-left: 10px; 
}

.hamburger-btn-wrapper:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.hamburger-icon {
  width: 24px;
  height: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #11496c;
  border-radius: 2px;
}

/* =========================================
   슬라이드 메뉴 스타일
   ========================================= */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.slide-menu {
  position: fixed;
  top: 0;
  right: -280px; 
  width: 280px;
  height: 100%;
  background-color: #ffffff;
  z-index: 3000;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  transition: right 0.3s ease;
  padding: 30px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.slide-menu.open {
  right: 0;
}

.menu-title {
  font-size: 1.4rem;
  color: #11496c;
  margin-top: 0;
  margin-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 15px;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-list li {
  margin-bottom: 10px;
}

.menu-list a {
  text-decoration: none;
  color: #333;
  font-size: 1.1rem;
  display: block;
  padding: 12px 10px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.menu-list a:hover {
  background-color: #f5f7fa;
  color: #11496c;
  font-weight: 700;
}

/* =========================================
   새 페이지(작동원리, 팀소개) 공통 스타일
   ========================================= */
.page-title {
  font-size: 1.5rem;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center; 
}

.content-placeholder {
  color: #333333;
  font-size: 1rem;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 40px;
  min-height: 200px; 
  display: flex;
  flex-direction: column; /* 세로 정렬을 위해 수정 */
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 20px;
}

/* =========================================
   모달(설정 및 결과) 스타일
   ========================================= */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.25); 
  backdrop-filter: blur(3px); 
  z-index: 2000; 
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background-color: rgba(18, 50, 75, 0.95); 
  width: 90%;
  max-width: 480px; 
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.settings-title {
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 20px;
  color: #ffffff;
  font-weight: 700;
  text-align: left; 
}

.settings-card {
  background-color: rgba(255, 255, 255, 0.08); 
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.settings-desc {
  font-size: 0.95rem;
  color: #e0f4ff; 
  margin-top: 0;
  margin-bottom: 24px;
  line-height: 1.5;
  font-weight: 500;
}

.settings-group {
  margin-bottom: 10px !important;
}


/* =========================================
   3. 입력 필드 및 버튼 스타일
   ========================================= */
.input-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0px; 
}

.input-row {
  display: flex;
  gap: 15px; 
  margin-bottom: 0px; 
}

.input-row .input-group {
  flex: 1; 
  margin-bottom: 0;
}

.divider-line {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.2);
  width: 100%;
  margin: 20px 0; 
}

.divider-line-2 {
  height: 1px;
  background-color: rgba(17, 73, 108, 0.2);
  width: 100%;
  margin: 20px 0 20px 0; 
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.input-label {
  font-size: 0.9rem;
  text-align: left;
  color: #ffffff;
  min-height: 1em; 
}

.break-display {
  font-size: 1rem;
  font-weight: 700;
  color: #a3f7f7; 
}

.field-wrapper {
  width: 100%;
}

input[type="number"], 
input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #ffffff;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

input[type="number"]::placeholder,
input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.status-box {
  background-color: rgba(255, 255, 255, 0.2); 
  border-radius: 999px;
  padding: 12px 16px;
  text-align: center;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 12px;     
  margin-bottom: 20px;  
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.status-box:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.status-box .divider {
  opacity: 0.5;
  font-size: 0.8rem;
}

.green-speed-group {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.green-speed-btn {
  flex: 1;
  padding: 10px 4px;
  font-size: 0.8rem;
  color: #ffffff;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.green-speed-btn.active {
  background-color: rgba(255, 255, 255, 0.95);
  color: #11496c;
  border-color: #ffffff;
  font-weight: 700;
}

button#calcButton {
  width: 100%;
  padding: 14px 16px;
  margin-top: 0px; 
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #11496c;
  cursor: pointer;
  transition: transform 0.1s;
}

button#calcButton:active {
  transform: scale(0.98);
}

button.secondary-btn {
  width: 100%;
  padding: 12px 16px;
  margin-top: 30px;
  font-size: 0.95rem;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background-color: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s;
}

button.secondary-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

/* =========================================
   4. 슬라이더 (Range Input) 스타일
   ========================================= */
.range-wrapper {
  width: 100%;
  padding: 0 5px;
  box-sizing: border-box;
  position: relative; 
}

.settings-slider-wrapper {
  margin-top: 20px; 
}

.break-wrapper {
  margin-bottom: 10px;
}

input[type=range] {
  -webkit-appearance: none; 
  appearance: none;        
  width: 100%;
  background: transparent;
  margin: 10px 0;
  z-index: 2; 
  position: relative;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}
input[type=range]::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#passingDistanceSlider::-webkit-slider-runnable-track {
  background: linear-gradient(to right, 
    rgba(255, 255, 255, 0.3) 0%, 
    rgba(255, 255, 255, 0.3) 25%, 
    #a3f7f7 25%, 
    #a3f7f7 50%, 
    rgba(255, 255, 255, 0.3) 50%, 
    rgba(255, 255, 255, 0.3) 100%
  );
}
#passingDistanceSlider::-moz-range-track {
  background: linear-gradient(to right, 
    rgba(255, 255, 255, 0.3) 0%, 
    rgba(255, 255, 255, 0.3) 25%, 
    #a3f7f7 25%, 
    #a3f7f7 50%, 
    rgba(255, 255, 255, 0.3) 50%, 
    rgba(255, 255, 255, 0.3) 100%
  );
}

input[type=range]::-webkit-slider-thumb {
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  margin-top: -9px; 
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border: 2px solid #11496c;
}

input[type=range]::-moz-range-thumb {
  height: 24px;
  width: 24px;
  border: 2px solid #11496c;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-labels-container {
  position: relative;
  width: 100%;
  height: 20px; 
  margin-top: 10px; 
}

.label-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.75rem; 
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.label-marker[style*="left: 0%"] {
  transform: translateX(0%);
}
.label-marker[style*="left: 100%"] {
  transform: translateX(-100%);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 15px; 
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
}

.recommendation-label {
  position: absolute;
  top: 25px; 
  left: 37.5%; 
  transform: translateX(-50%); 
  font-size: 0.75rem;
  color: #a3f7f7;
  font-weight: 700;
  pointer-events: none; 
}

.marker-label {
  position: absolute;
  top: -15px; 
  font-size: 0.7rem;
  color: #a3f7f7;
  font-weight: 700;
  transform: translateX(-50%);
  pointer-events: none;
}

.marker-0-5 {
  left: 25%; 
}

.marker-1-0 {
  left: 50%; 
}

/* =========================================
   5. 결과 모달 내부 스타일
   ========================================= */
#resultBoxModal {
  margin-top: 10px;
  width: 100%;
  min-height: 200px; /* 높이 고정 효과 */
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.15); 
  display: flex;
  justify-content: center;
  align-items: center;
  color: #e9e9e9;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
}

#resultTextModal {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.result-highlight {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 결과 이미지 및 화살표 스타일 */
.result-image-wrapper {
  text-align: center;
  margin-bottom: 20px;
  position: relative; /* 화살표 절대 위치 기준 */
  display: inline-block; /* 이미지 크기에 맞게 */
  width: 100%;
  max-width: 450px; /* 적절한 최대 너비 */
  margin-left: auto;
  margin-right: auto;
}

.result-image {
  width: 100%;
  height: auto;
  border-radius: 12px; 
  display: block;
}

/* 화살표 오버레이 */
.arrow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* 클릭 통과 */
}

/* [변경] 화살표 시작 위치 */
.arrow-line {
  position: absolute;
  top: 33.6%;  /* 시작점 세로 */
  left: 64.5%; /* 시작점 가로 */
  width: 35.5%; /* 100% - 64.5% = 35.5% (오른쪽 끝까지) */
  height: 10px; 
  margin-top: -5px; /* height의 절반만큼 올려서 중앙 정렬 */
  transform-origin: 0% 100%; /* 회전축: 왼쪽 중앙 */
  display: none; 
}

.arrow-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wipe-text {
  display: inline-block;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  animation: wipe 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes wipe {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.portrait-image {
  width: 100px;
  height: auto;
  border-radius: 12px; 
  display: block;
}

/* 푸터 링크 스타일 추가 */
#footerTeamLink {
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.2s;
}

#footerTeamLink:hover {
  opacity: 0.7;
}

/* =========================================
   6. 모바일 반응형
   ========================================= */
@media (max-width: 480px) {
  .container {
    padding: 20px;
    margin: 15px;
    min-height: 400px;
  }
  
  .header-area h1 {
    font-size: 1.5rem;
  }

  .disclaimer-area {
    padding: 0 15px; 
  }

  .input-label {
    font-size: 1rem;
  }

  .green-speed-btn {
    font-size: 0.9rem;
    padding: 12px 4px;
  }

  input[type="number"], 
  input[type="text"] {
    font-size: 1rem;
    padding: 12px 16px;
  }

  button#calcButton {
    font-size: 1.1rem;
    padding: 16px;
  }

  #resultTextModal {
    font-size: 1rem;
  }
  
  .result-highlight {
    font-size: 1.3rem;
  }
}