/* 전역 box-sizing */
.celsius-fahrenheit-converter-container,
.celsius-fahrenheit-converter-container *,
.celsius-fahrenheit-converter-container *::before,
.celsius-fahrenheit-converter-container *::after {
  box-sizing: border-box;
}

/* CSS 변수 - 라이트 모드 (기본) */
.celsius-fahrenheit-converter-container {
  /* 배경색 */
  --bg-primary: #f5f5f0;
  --bg-secondary: #fff;
  --bg-section: #fff;
  
  /* 테두리 */
  --border-color: #333;
  
  /* 텍스트 */
  --text-primary: #222;
  --text-secondary: #555;
  --text-light: #666;
  
  /* 브랜드 색상 */
  --color-accent: #3498db;
  --color-success: #27ae60;
  --color-warning: #f39c12;
  --color-danger: #e74c3c;
  --color-purple: #9b59b6;
  --color-teal: #1abc9c;
  
  /* 그림자 */
  --shadow-sm: 2px 2px 0 rgba(0,0,0,0.1);
  --shadow-md: 4px 4px 0 rgba(0,0,0,0.15);
  --shadow-lg: 8px 8px 0 rgba(0,0,0,0.15);
  
  /* 입력 포커스 */
  --input-focus-bg: #fffacd;
  
  /* 헤더 타이틀 */
  --title-color: #2c3e50;
  --title-shadow: 2px 2px 0 rgba(255,255,255,0.5);
  
  /* 버튼 호버 */
  --btn-hover-overlay: rgba(0,0,0,0.1);
}

/* 다크 모드 - 수동 토글 시 */
.celsius-fahrenheit-converter-container.dark {
  /* 배경색 - 다크 그레이 톤 */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-section: #2d2d2d;
  
  /* 테두리 - 밝은 그레이로 대비 */
  --border-color: #e0e0e0;
  
  /* 텍스트 - 밝은 색상으로 가독성 확보 */
  --text-primary: #e8e8e8;
  --text-secondary: #b0b0b0;
  --text-light: #909090;
  
  /* 브랜드 색상 - 다크 배경에서 더 밝게 조정 */
  --color-accent: #5dade2;
  --color-success: #52c77a;
  --color-warning: #f5b041;
  --color-danger: #ec7063;
  --color-purple: #af7ac5;
  --color-teal: #48d1cc;
  
  /* 그림자 - 밝은 색으로 변경 (네오브루탈리즘) */
  --shadow-sm: 2px 2px 0 rgba(255,255,255,0.08);
  --shadow-md: 4px 4px 0 rgba(255,255,255,0.12);
  --shadow-lg: 8px 8px 0 rgba(255,255,255,0.12);
  
  /* 입력 포커스 - 약간 밝은 다크 그레이 */
  --input-focus-bg: #3a3a3a;
  
  /* 헤더 타이틀 - 밝은 파란색 계열 */
  --title-color: #7fb3d5;
  --title-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  
  /* 버튼 호버 배경 */
  --btn-hover-overlay: rgba(255,255,255,0.1);
}

/* 시스템 다크모드 자동 감지 (prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
  /* 시스템이 다크모드일 때 자동 적용 (수동 설정 없을 시) */
  .celsius-fahrenheit-converter-container:not(.dark):not(.light) {
    /* 배경색 */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-section: #2d2d2d;
    
    /* 테두리 */
    --border-color: #e0e0e0;
    
    /* 텍스트 */
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-light: #909090;
    
    /* 브랜드 색상 */
    --color-accent: #5dade2;
    --color-success: #52c77a;
    --color-warning: #f5b041;
    --color-danger: #ec7063;
    --color-purple: #af7ac5;
    --color-teal: #48d1cc;
    
    /* 그림자 */
    --shadow-sm: 2px 2px 0 rgba(255,255,255,0.08);
    --shadow-md: 4px 4px 0 rgba(255,255,255,0.12);
    --shadow-lg: 8px 8px 0 rgba(255,255,255,0.12);
    
    /* 입력 포커스 */
    --input-focus-bg: #3a3a3a;
    
    /* 헤더 타이틀 */
    --title-color: #7fb3d5;
    --title-shadow: 2px 2px 0 rgba(0,0,0,0.5);
    
    /* 버튼 호버 배경 */
    --btn-hover-overlay: rgba(255,255,255,0.1);
  }
}

/* 메인 컨테이너 - 2px 테두리 */
.celsius-fahrenheit-converter-container {
  position: relative;
  max-width: 1180px;
  width: 100%;
  margin: 15px auto;
  padding: 12px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  font-family: 'Noto Sans KR', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  line-height: 1.5;
}

/* 헤더 */
.calculator-header {
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 3px double var(--border-color);
}

.calculator-header h2 {
  margin: 0 0 6px 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--title-color);
  text-shadow: var(--title-shadow);
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.4;
}

/* 메인 그리드 */
.calculator-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* 섹션 공통 - 1px 테두리 */
.input-section,
.result-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px;
  box-shadow: var(--shadow-md);
}

/* 섹션 타이틀 */
.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.input-section .section-title {
  color: var(--color-accent);
}

.result-section .section-title {
  color: var(--color-success);
}

/* 입력 그룹 */
.input-group {
  margin-bottom: 12px;
}

.input-group:last-child {
  margin-bottom: 0;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 입력 래퍼 */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: 10px 50px 10px 10px;
  border: 1px solid var(--border-color);
  font-size: 15px;
  font-family: 'Courier New', monospace;
  background: var(--bg-section);
  color: var(--text-primary);
  transition: all 0.2s;
}

.input-wrapper input:focus {
  outline: none;
  background: var(--input-focus-bg);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.input-wrapper .unit {
  position: absolute;
  right: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
}

/* 결과 행 */
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.result-row:last-child {
  margin-bottom: 0;
}

.result-row.highlight {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-section) 100%);
  border-width: 1.5px;
}

.result-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.result-value {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--color-accent);
}

.result-row.highlight .result-value {
  color: var(--color-purple);
  font-size: 16px;
}

/* 버튼 그룹 */
.button-group {
  margin-bottom: 12px;
}

/* 계산하기 버튼 - 1.5px 테두리 */
.btn-calculate {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--color-accent);
  border: 1.5px solid var(--border-color);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
  font-family: inherit;
  margin-bottom: 10px;
}

.btn-calculate:hover {
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.btn-calculate:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

/* 액션 버튼 */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 샘플 버튼 - 1px 테두리 */
.btn-sample {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: var(--color-success);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  font-family: inherit;
  white-space: nowrap;
}

.btn-sample:hover {
  transform: translate(0.5px, 0.5px);
  box-shadow: 1.5px 1.5px 0 rgba(0,0,0,0.2);
}

.btn-sample:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* 초기화 버튼 - 1px 테두리 */
.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: var(--color-warning);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  font-family: inherit;
}

.btn-reset:hover {
  transform: translate(0.5px, 0.5px);
  box-shadow: 1.5px 1.5px 0 rgba(0,0,0,0.2);
}

.btn-reset:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

/* 정보 박스 */
.info-box {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.info-box svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-teal);
}

.info-content {
  flex: 1;
}

.info-content strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.info-content p {
  margin: 3px 0;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

/* 반응형 - 768px */
@media (max-width: 768px) {
  .celsius-fahrenheit-converter-container {
    margin: 8px 5px;
    width: calc(100% - 10px);
    padding: 10px;
  }

  .calculator-main {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-sample {
    width: 100%;
    justify-content: center;
  }
}

/* 반응형 - 480px */
@media (max-width: 480px) {
  .celsius-fahrenheit-converter-container {
    padding: 8px;
    border-width: 1px;
  }

  .calculator-header h2 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 13px;
  }

  .section-title {
    font-size: 15px;
  }

  .input-wrapper input {
    padding: 8px 40px 8px 8px;
    font-size: 14px;
  }

  .btn-calculate {
    padding: 10px 16px;
    font-size: 15px;
  }

  .result-value {
    font-size: 16px;
  }

  .info-content p {
    font-size: 12px;
  }
}