/**********************************************
 * 통계 계산기 컨테이너
 **********************************************/
.statistics-calculator {
  margin: 20px auto !important;
  padding: 30px !important;
  background: #f8fafc !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1180px !important;
  font-family: 'Noto Sans KR', 'Roboto', Arial, sans-serif !important;
  color: #334155 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  overflow: hidden !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

@media screen and (max-width: 768px) {
  .statistics-calculator {
    padding: 15px 10px !important;
    margin: 10px auto !important;
    border-radius: 8px !important;
  }
}

.calculator-title {
  text-align: center !important;
  font-size: 1.9em !important;
  margin-bottom: 5px !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

.calculator-description {
  text-align: center !important;
  font-size: 0.97em !important;
  margin-bottom: 25px !important;
  color: #64748b !important;
}

/**********************************************
 * 계산기 레이아웃
 **********************************************/
.calculator-layout {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px !important;
  margin-bottom: 20px !important;
}

.input-section {
  flex: 1 !important;
  min-width: 320px !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.output-section {
  flex: 1.5 !important;
  min-width: 320px !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.section-title {
  font-size: 1.25em !important;
  font-weight: 600 !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
  color: #0f172a !important;
  padding-bottom: 10px !important;
  border-bottom: 2px solid #f1f5f9 !important;
}

/**********************************************
 * 입력 필드 스타일
 **********************************************/
.input-group {
  margin-bottom: 20px !important;
}

.input-group label {
  display: block !important;
  margin-bottom: 8px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  font-size: 1.1em !important;
}

.input-group textarea {
  width: 100% !important;
  min-height: 120px !important;
  padding: 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 1em !important;
  font-family: inherit !important;
  color: #334155 !important;
  background: #fff !important;
  resize: vertical !important;
  transition: all 0.2s !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  line-height: 1.5 !important;
}

.input-group textarea:focus {
  border-color: #3b82f6 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.input-helper {
  font-size: 0.9em !important;
  color: #64748b !important;
  margin-top: 4px !important;
  margin-left: 2px !important;
}

/**********************************************
 * 샘플 데이터 버튼
 **********************************************/
.sample-data {
  margin-bottom: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.sample-data-title {
  font-size: 1em !important;
  font-weight: 500 !important;
  color: #334155 !important;
}

.sample-data-options {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.sample-btn {
  padding: 6px 12px !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 20px !important;
  color: #334155 !important;
  font-size: 0.9em !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.sample-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}

/**********************************************
 * 데이터 옵션 설정
 **********************************************/
.data-options {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
  margin-bottom: 20px !important;
}

.option-group {
  margin-bottom: 10px !important;
}

.option-group label {
  display: block !important;
  margin-bottom: 8px !important;
  font-weight: 500 !important;
  color: #334155 !important;
  font-size: 1.1em !important;
}

.radio-group {
  display: flex !important;
  gap: 15px !important;
  margin-bottom: 5px !important;
}

.radio-item {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.radio-item label {
  margin-bottom: 0 !important;
  font-size: 1em !important;
  font-weight: normal !important;
}

.option-group select {
  width: 100% !important;
  padding: 10px 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-size: 1em !important;
  color: #334155 !important;
  background: #fff !important;
  transition: all 0.2s !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
}

.option-group select:focus {
  border-color: #3b82f6 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/**********************************************
 * 버튼 스타일
 **********************************************/
.calculator-buttons {
  display: flex !important;
  gap: 10px !important;
  margin-top: 25px !important;
}

.btn-calculate {
  flex: 3 !important;
  padding: 12px !important;
  background: #3b82f6 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 1.1em !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2) !important;
  text-align: center !important;
}

.btn-calculate:hover {
  background: #2563eb !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 6px rgba(59, 130, 246, 0.25) !important;
}

.btn-calculate:active {
  transform: translateY(1px) !important;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.1) !important;
}

.btn-reset {
  flex: 1 !important;
  background: transparent !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
  padding: 12px 16px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 1em !important;
  transition: all 0.2s !important;
  text-align: center !important;
}

.btn-reset:hover {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border-color: #94a3b8 !important;
}

/**********************************************
 * 결과 탭
 **********************************************/
.result-tabs {
  margin-top: 10px !important;
}

.tab-control {
  display: flex !important;
  border-bottom: 1px solid #e2e8f0 !important;
  margin-bottom: 20px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.tab-btn {
  padding: 10px 15px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  font-size: 1.0em !important;
  font-weight: 500 !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
  min-width: auto !important;
  margin-right: 5px !important;
}

.tab-btn:hover {
  color: #0f172a !important;
}

.tab-btn.active {
  color: #3b82f6 !important;
  border-bottom-color: #3b82f6 !important;
  font-weight: 600 !important;
}

.tab-content {
  position: relative !important;
}

.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
}

/**********************************************
 * 통계 결과 카드
 **********************************************/
.no-data-message {
  text-align: center !important;
  padding: 30px !important;
  color: #64748b !important;
  font-style: italic !important;
}

.stats-summary {
  margin-bottom: 20px !important;
}

.stats-cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 15px !important;
}

.stats-card {
  background: #f8fafc !important;
  border-radius: 8px !important;
  padding: 15px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.stats-card-title {
  font-size: 1.1em !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  margin-bottom: 12px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.stats-card-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.stats-item {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 4px 0 !important;
}

.stats-label {
  font-size: 0.95em !important;
  color: #475569 !important;
  flex: 1 !important;
}

.stats-value {
  font-size: 1em !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  text-align: right !important;
  min-width: 80px !important;
}

.stats-badge {
  display: inline-block !important;
  padding: 2px 8px !important;
  border-radius: 12px !important;
  font-size: 0.8em !important;
  font-weight: 500 !important;
  margin-left: 8px !important;
  background: #e2e8f0 !important;
  color: #475569 !important;
}

.text-wrap {
  word-break: break-word !important;
  white-space: normal !important;
  max-width: 200px !important;
}

/**********************************************
 * 시각화
 **********************************************/
.visualization-container {
  padding: 5px !important;
}

.viz-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px !important;
  margin-bottom: 20px !important;
}

.viz-card {
  flex: 1 !important;
  min-width: 300px !important;
  background: #f8fafc !important;
  border-radius: 8px !important;
  padding: 15px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.viz-card.full-width {
  flex-basis: 100% !important;
  width: 100% !important;
}

.viz-title {
  font-size: 1.1em !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  margin-bottom: 12px !important;
  text-align: center !important;
}

.viz-canvas-container {
  height: 280px !important;
  position: relative !important;
  margin-bottom: 10px !important;
}

.viz-controls {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  justify-content: center !important;
  padding-top: 5px !important;
  font-size: 0.9em !important;
  color: #475569 !important;
}

.range-slider {
  -webkit-appearance: none !important;
  width: 150px !important;
  height: 6px !important;
  border-radius: 3px !important;
  background: #e2e8f0 !important;
  outline: none !important;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #3b82f6 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

.range-slider::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #3b82f6 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
  border: none !important;
}

.viz-description {
  margin-top: 10px !important;
  font-size: 0.9em !important;
  color: #64748b !important;
  text-align: center !important;
  line-height: 1.5 !important;
}

/**********************************************
 * Z-점수 및 빈도 테이블
 **********************************************/
.z-score-table-container, .summary-table-container {
  max-height: 300px !important;
  overflow-y: auto !important;
  margin-top: 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
}

.z-score-table, .summary-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.9em !important;
}

.z-score-table th, .summary-table th,
.z-score-table td, .summary-table td {
  padding: 8px 10px !important;
  text-align: left !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.z-score-table th, .summary-table th {
  background: #f1f5f9 !important;
  font-weight: 600 !important;
  color: #334155 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

.z-score-table tr:nth-child(even), .summary-table tr:nth-child(even) {
  background: #f8fafc !important;
}

.stats-description {
  font-size: 0.9em !important;
  color: #475569 !important;
  margin-bottom: 10px !important;
  line-height: 1.5 !important;
}

/**********************************************
 * 추가 정보 섹션
 **********************************************/
.additional-info {
  margin-top: 30px !important;
  background: #fff !important;
  border-radius: 10px !important;
  padding: 20px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e2e8f0 !important;
}

.info-tabs {
  margin-top: 15px !important;
}

.info-tab-buttons {
  display: flex !important;
  flex-wrap: wrap !important;
  border-bottom: 1px solid #e2e8f0 !important;
  margin-bottom: 15px !important;
}

.info-tab-btn {
  padding: 10px 15px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  font-size: 1.0em !important;
  font-weight: 500 !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  margin-right: 10px !important;
  margin-bottom: -1px !important;
}

.info-tab-btn:hover {
  color: #0f172a !important;
}

.info-tab-btn.active {
  color: #3b82f6 !important;
  border-bottom-color: #3b82f6 !important;
  font-weight: 600 !important;
}

.info-tab-content {
  position: relative !important;
}

.info-tab-pane {
  display: none !important;
}

.info-tab-pane.active {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 15px !important;
}

.info-card {
  flex: 1 !important;
  min-width: 280px !important;
  background: #f8fafc !important;
  padding: 15px !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
}

.info-card.wide {
  flex-basis: 100% !important;
  width: 100% !important;
}

.info-card h4 {
  font-size: 1.1em !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

.info-card p {
  font-size: 0.95em !important;
  color: #334155 !important;
  margin: 0 0 10px !important;
  line-height: 1.6 !important;
}

.formula {
  padding: 8px !important;
  background: #f1f5f9 !important;
  border-radius: 4px !important;
  margin-bottom: 10px !important;
  overflow-x: auto !important;
  font-size: 0.95em !important;
}

/**********************************************
 * 면책 조항
 **********************************************/
.disclaimer {
  margin-top: 20px !important;
  font-size: 0.9em !important;
  color: #64748b !important;
  text-align: center !important;
}

.disclaimer p {
  margin: 5px 0 !important;
}

/**********************************************
 * 모바일 대응
 **********************************************/
@media screen and (max-width: 1120px) {
  .input-section, 
  .output-section {
    flex: 1 1 100% !important;
  }
  
  .info-card {
    min-width: 100% !important;
  }
}

@media screen and (max-width: 768px) {
  .tab-control {
    flex-wrap: wrap !important;
  }
  
  .tab-btn {
    flex: 1 1 auto !important;
    padding: 8px 10px !important;
    font-size: 0.9em !important;
    text-align: center !important;
  }
  
  .info-tab-buttons {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 5px !important;
  }
  
  .info-tab-btn {
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }
  
  .stats-item {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .stats-value {
    text-align: left !important;
    margin-top: 2px !important;
  }
  
  .stats-badge {
    margin-left: 0 !important;
    margin-top: 2px !important;
  }
  
  .viz-card {
    min-width: 250px !important;
  }
}

@media screen and (max-width: 480px) {
  .input-section, 
  .output-section,
  .additional-info {
    padding: 15px 10px !important;
  }
  
  .calculator-buttons {
    flex-direction: column !important;
  }
  
  .btn-reset {
    margin-top: 10px !important;
  }
  
  .sample-data-options {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
}