.mass-conversion-calculator {
  max-width: 1180px;
  margin: 20px auto;
  padding: 20px;
  background: #f5f5f0;
  border: 2px solid #333;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: #222;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.15);
}

.calculator-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px double #333;
}

.calculator-header h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: #666;
}

/* 예시 버튼 */
.example-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-example,
.btn-clear {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  color: #222;
}

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

.btn-example:active,
.btn-clear:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

/* 메인 레이아웃 */
.calculator-main {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.settings-section,
.conversion-section,
.results-section {
  background: #fff;
  border: 1px solid #333;
  padding: 15px;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

.section-title {
  margin: 0 0 15px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

/* 설정 섹션 */
.settings-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 15px;
  align-items: end;
}

/* 변환 섹션 - 50:50 그리드 */
.conversion-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 15px;
  align-items: start;
}

.conversion-from,
.conversion-to {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

/* 교환 애니메이션 */
.swapping-from {
  animation: swapFromAnim 0.5s ease;
}

.swapping-to {
  animation: swapToAnim 0.5s ease;
}

@keyframes swapFromAnim {
  0% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(20px); opacity: 0.5; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes swapToAnim {
  0% { transform: translateX(0); opacity: 1; }
  50% { transform: translateX(-20px); opacity: 0.5; }
  100% { transform: translateX(0); opacity: 1; }
}

/* 교환 버튼 */
.conversion-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 100px;
}

.btn-swap {
  width: 50px;
  height: 50px;
  padding: 0;
  background: #e67e22;
  border: 1px solid #333;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  transition: all 0.2s;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-swap:hover {
  background: #d35400;
  transform: translate(1px, 1px) rotate(180deg);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.btn-swap:active {
  transform: translate(3px, 3px) rotate(180deg);
  box-shadow: none;
}

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

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
}

.cost-input,
.select-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #333;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  box-sizing: border-box;
}

.cost-input:focus,
.select-input:focus {
  outline: none;
  background: #fffacd;
  border-color: #e67e22;
}

.unit-select {
  min-height: 160px;
}

.select-input {
  cursor: pointer;
}

.input-status {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  min-height: 16px;
  font-weight: 600;
}

.input-status.error {
  color: #e74c3c;
}

.input-status.success {
  color: #27ae60;
}

.cost-input.error {
  border-color: #e74c3c;
  background: #ffe6e6;
}

.cost-input.success {
  border-color: #27ae60;
  background: #e6ffe6;
}

/* 결과 미리보기 */
.result-preview {
  padding: 12px 15px;
  background: #27ae60;
  border: 1px solid #333;
  text-align: center;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  word-break: break-all;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.result-placeholder {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 600;
}

/* 체크박스 */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  height: 100%;
  box-sizing: border-box;
}

.checkbox-label:hover {
  background: #fff;
  border-color: #999;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  accent-color: #e67e22;
}

/* 결과 섹션 */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.results-header .section-title {
  margin: 0;
  padding: 0;
  border: none;
}

/* 메인 결과 박스 */
.main-result-box {
  margin-bottom: 15px;
  padding: 15px;
  background: #f9f9f9;
  border: 1px solid #ddd;
}

.main-result-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.result-from,
.result-to {
  flex: 1;
  text-align: center;
}

.result-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}

.result-value {
  font-size: 20px;
  color: #3498db;
  font-weight: 700;
  word-break: break-all;
}

.result-arrow {
  font-size: 24px;
  color: #3498db;
  font-weight: 700;
}

/* 전체 결과 */
.all-results h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: #555;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 350px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #ddd;
  background: #fafafa;
}

.no-result {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.result-item {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  transition: all 0.15s;
}

.result-item:hover {
  border-color: #3498db;
  box-shadow: 0 2px 4px rgba(52,152,219,0.2);
  transform: translateX(2px);
}

.result-item-selected {
  background: #ebf5fb;
  border-color: #3498db;
  border-width: 2px;
}

.result-item-label {
  font-weight: 600;
  color: #495057;
  flex: 1;
}

.result-item-value {
  font-weight: 700;
  color: #3498db;
  text-align: right;
  flex: 1;
  word-break: break-all;
}

.result-item-selected .result-item-label {
  color: #3498db;
}

/* 공식 박스 */
.formula-box {
  margin-top: 15px;
  padding: 12px;
  background: #fff8e1;
  border: 1px solid #ffc107;
}

.formula-box h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: #555;
}

.formula-content {
  font-size: 13px;
  color: #333;
  line-height: 1.6;
}

.formula-content code {
  background: #ffe082;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  word-break: break-all;
  font-weight: 600;
}

/* 빠른 변환 */
.quick-convert {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
}

.quick-convert h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: #555;
}

.quick-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.quick-btn {
  padding: 7px 10px;
  background: #fff;
  border: 1px solid #3498db;
  color: #3498db;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 2px 2px 0 rgba(52,152,219,0.2);
}

.quick-btn:hover {
  background: #ebf5fb;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(52,152,219,0.2);
}

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

/* 복사 버튼 */
.btn-copy {
  padding: 8px 16px;
  background: #3498db;
  border: 1px solid #333;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
  transition: all 0.1s;
}

.btn-copy:hover:not(:disabled) {
  background: #2980b9;
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.btn-copy:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.btn-copy:disabled {
  background: #bdc3c7;
  border-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

/* 푸터 */
.footer-note {
  padding: 12px;
  background: #f0f0f0;
  border: 2px dashed #999;
  text-align: center;
}

.footer-note p {
  margin: 0;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}

/* 스크롤바 */
.results-grid::-webkit-scrollbar {
  width: 8px;
}

.results-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.results-grid::-webkit-scrollbar-thumb {
  background: #999;
}

.results-grid::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* 반응형 */
@media (max-width: 1024px) {
  .settings-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .conversion-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .conversion-swap {
    padding-top: 0;
    order: 2;
  }
  
  .conversion-from {
    order: 1;
  }
  
  .conversion-to {
    order: 3;
  }
  
  .btn-swap {
    transform: rotate(90deg);
  }
  
  .btn-swap:hover {
    transform: rotate(270deg) translate(1px, 1px);
  }
  
  .btn-swap:active {
    transform: rotate(270deg) translate(3px, 3px);
  }
}

@media (max-width: 768px) {
  .mass-conversion-calculator {
    padding: 15px;
    margin: 15px 10px;
  }
  
  .calculator-header h2 {
    font-size: 24px;
  }
  
  .example-buttons {
    flex-direction: column;
  }
  
  .btn-example,
  .btn-clear {
    width: 100%;
  }
  
  .quick-buttons {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
    max-height: 300px;
  }
  
  .main-result-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .result-arrow {
    transform: rotate(90deg);
  }
}