/**********************************************
 * 단위 변환기 컨테이너
 **********************************************/
.unit-converter-container {
  margin: 20px auto !important;
  padding: 25px !important;
  background: #f7f7f7 !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 1180px !important;
  font-family: 'Noto Sans KR', Arial, sans-serif !important;
  color: #333333 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden !important;
  font-size: 14px !important;
}

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

.converter-title {
  text-align: center !important;
  font-size: 1.92em !important;
  margin-top: 0 !important;
  margin-bottom: 5px !important;
  color: #333333 !important;
  font-weight: 700 !important;
}

.converter-subtitle {
  text-align: center !important;
  font-size: 1.07em !important;
  margin-bottom: 20px !important;
  color: #666666 !important;
}

/**********************************************
 * 카테고리 탭 스타일
 **********************************************/
.category-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
  margin-bottom: 15px !important;
  justify-content: center !important;
  background: #ffffff !important;
  padding: 10px !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.category-tab {
  padding: 8px 12px !important;
  background: #f0f0f0 !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 20px !important;
  font-size: 1.02em !important;
  font-weight: 500 !important;
  color: #555555 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.category-tab:hover {
  background: #e9e9e9 !important;
  transform: translateY(-1px) !important;
}

.category-tab.active {
  background: #4361ee !important;
  color: #ffffff !important;
  border-color: #3a56e4 !important;
  box-shadow: 0 2px 5px rgba(67, 97, 238, 0.3) !important;
}

/**********************************************
 * 변환 메인 섹션
 **********************************************/
.converter-main {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
  align-items: center !important;
  justify-content: center !important;
}

.converter-section {
  flex: 1 !important;
  min-width: 280px !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  padding: 15px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e0e0e0 !important;
}

.section-title {
  font-size: 1.22em !important;
  font-weight: 600 !important;
  margin-top: 0 !important;
  margin-bottom: 15px !important;
  color: #333333 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.unit-input-wrapper {
  display: flex !important;
  margin-bottom: 10px !important;
  width: 100% !important;
}

.unit-input {
  flex: 2 !important;
  padding: 10px 12px !important;
  border: 1px solid #cccccc !important;
  border-radius: 6px 0 0 6px !important;
  font-size: 1.22em !important;
  color: #333333 !important;
  background: #ffffff !important;
  transition: all 0.2s !important;
  box-sizing: border-box !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05) !important;
  width: 100% !important;
}

.unit-input:focus {
  border-color: #4361ee !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1) !important;
}

.result-input {
  background-color: #f9f9f9 !important;
  font-weight: bold !important;
  color: #4361ee !important;
}

.unit-select-wrapper {
  flex: 1 !important;
  position: relative !important;
}

.unit-select {
  width: 100% !important;
  height: 100% !important;
  padding: 10px 24px 10px 12px !important;
  border: 1px solid #cccccc !important;
  border-left: none !important;
  border-radius: 0 6px 6px 0 !important;
  font-size: 1.07em !important;
  color: #333333 !important;
  background: #f9f9f9 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05) !important;
  cursor: pointer !important;
}

.unit-select-wrapper::after {
  content: '▼' !important;
  font-size: 0.82em !important;
  color: #666666 !important;
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  pointer-events: none !important;
}

.unit-info {
  font-size: 0.97em !important;
  color: #666666 !important;
  margin-top: 5px !important;
  min-height: 20px !important;
}

/**********************************************
 * 변환 컨트롤 스타일
 **********************************************/
.converter-controls {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 5px !important;
}

.swap-button {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 1px solid #e0e0e0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 1.32em !important;
  color: #4361ee !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

.swap-button:hover {
  background: #f0f0f0 !important;
  transform: scale(1.05) !important;
}

.equals-sign {
  font-size: 1.62em !important;
  color: #666666 !important;
  font-weight: bold !important;
}

@media screen and (max-width: 768px) {
  .converter-controls {
    flex-direction: row !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 5px 0 !important;
  }
}

/**********************************************
 * 즐겨찾기 스타일
 **********************************************/
.favorites-section {
  background: #ffffff !important;
  border-radius: 8px !important;
  margin-bottom: 15px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e0e0e0 !important;
  overflow: hidden !important;
}

.favorites-toggle {
  padding: 12px 15px !important;
  font-weight: 600 !important;
  color: #333333 !important;
  cursor: pointer !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  transition: background 0.2s !important;
}

.favorites-toggle:hover {
  background: #f9f9f9 !important;
}

.favorites-icon {
  color: #ffc107 !important;
  margin-right: 5px !important;
}

.arrow-icon {
  font-size: 0.92em !important;
  color: #666666 !important;
  transition: transform 0.3s !important;
}

.favorites-toggle.active .arrow-icon {
  transform: rotate(180deg) !important;
}

.favorites-content {
  max-height: 0 !important;
  overflow: hidden !important;
  transition: max-height 0.3s ease-out !important;
}

.favorites-toggle.active + .favorites-content {
  max-height: 300px !important;
  transition: max-height 0.5s ease-in !important;
}

.favorites-list {
  padding: 0 15px 15px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.favorite-item {
  background: #f0f4ff !important;
  border: 1px solid #d1deff !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 1.02em !important;
  color: #333333 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.2s !important;
}

.favorite-item:hover {
  background: #e0e8ff !important;
  transform: translateY(-1px) !important;
}

.favorite-remove {
  margin-left: 5px !important;
  color: #999 !important;
  font-size: 1.02em !important;
  cursor: pointer !important;
}

.favorite-remove:hover {
  color: #ff4136 !important;
}

.empty-favorites-message {
  width: 100% !important;
  padding: 10px !important;
  color: #666666 !important;
  font-size: 1.02em !important;
  text-align: center !important;
  font-style: italic !important;
}

.favorite-button {
  background: transparent !important;
  border: none !important;
  color: #cccccc !important;
  font-size: 1.32em !important;
  cursor: pointer !important;
  padding: 0 5px !important;
  transition: color 0.2s !important;
}

.favorite-button:hover, .favorite-button.active {
  color: #ffc107 !important;
}

/**********************************************
 * 공식 및 설명 카드 스타일
 **********************************************/
.formula-section {
  background: #ffffff !important;
  border-radius: 8px !important;
  margin-bottom: 15px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e0e0e0 !important;
  overflow: hidden !important;
}

.formula-toggle {
  padding: 12px 15px !important;
  font-weight: 600 !important;
  color: #333333 !important;
  cursor: pointer !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  transition: background 0.2s !important;
}

.formula-toggle:hover {
  background: #f9f9f9 !important;
}

.formula-icon {
  margin-right: 5px !important;
}

.formula-content {
  max-height: 0 !important;
  overflow: hidden !important;
  transition: max-height 0.3s ease-out !important;
}

.formula-toggle.active + .formula-content {
  max-height: 300px !important;
  transition: max-height 0.5s ease-in !important;
}

#formulaDisplay {
  padding: 15px !important;
  font-size: 1.07em !important;
  line-height: 1.5 !important;
  color: #444444 !important;
}

.formula-math {
  background: #f6f8ff !important;
  padding: 8px 12px !important;
  border-radius: 4px !important;
  font-family: monospace !important;
  margin: 10px 0 !important;
  border-left: 3px solid #4361ee !important;
}

/**********************************************
 * 일반적인 변환 예시 스타일
 **********************************************/
.examples-section {
  background: #ffffff !important;
  border-radius: 8px !important;
  padding: 15px !important;
  margin-bottom: 15px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid #e0e0e0 !important;
}

.examples-title {
  font-size: 1.22em !important;
  font-weight: 600 !important;
  margin-top: 0 !important;
  margin-bottom: 12px !important;
  color: #333333 !important;
}

.examples-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 10px !important;
}

.example-item {
  background: #f9f9f9 !important;
  border: 1px solid #e9e9e9 !important;
  border-radius: 6px !important;
  padding: 10px !important;
  font-size: 1.02em !important;
  color: #333333 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
}

.example-title {
  font-weight: 600 !important;
  color: #4361ee !important;
}

.example-value {
  display: flex !important;
  justify-content: space-between !important;
}

/**********************************************
 * 버튼 스타일
 **********************************************/
.action-buttons {
  display: flex !important;
  gap: 10px !important;
  margin-top: 10px !important;
  margin-bottom: 5px !important;
  justify-content: center !important;
}

.action-button {
  padding: 10px 15px !important;
  border-radius: 6px !important;
  font-size: 1.07em !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.2s !important;
}

.copy-button {
  background: #4361ee !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 5px rgba(67, 97, 238, 0.3) !important;
}

.copy-button:hover {
  background: #3a56e4 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 7px rgba(67, 97, 238, 0.35) !important;
}

.reset-button {
  background: transparent !important;
  color: #666666 !important;
  border: 1px solid #cccccc !important;
}

.reset-button:hover {
  background: #f0f0f0 !important;
  border-color: #aaaaaa !important;
  color: #333333 !important;
}

.button-icon {
  font-size: 1.22em !important;
}

/**********************************************
 * 알림 메시지 스타일
 **********************************************/
.notification {
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(100px) !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  padding: 10px 20px !important;
  border-radius: 30px !important;
  font-size: 1.02em !important;
  z-index: 1000 !important;
  opacity: 0 !important;
  transition: transform 0.3s, opacity 0.3s !important;
}

.notification.show {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

/**********************************************
 * 모바일 대응
 **********************************************/
@media screen and (max-width: 768px) {
  .category-tabs {
    padding: 8px !important;
    gap: 4px !important;
  }
  
  .category-tab {
    padding: 6px 10px !important;
    font-size: 0.97em !important;
  }
  
  .converter-section {
    padding: 12px !important;
    min-width: 100% !important;
  }
  
  .examples-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)) !important;
  }
  
  .action-button {
    flex: 1 !important;
    justify-content: center !important;
  }
}

@media screen and (max-width: 480px) {
  .unit-converter-container {
    padding: 12px 8px !important;
  }
  
  .converter-title {
    font-size: 1.72em !important;
  }
  
  .converter-subtitle {
    font-size: 1.02em !important;
    margin-bottom: 15px !important;
  }
  
  .category-tab {
    padding: 5px 8px !important;
    font-size: 0.92em !important;
  }
  
  .unit-input {
    font-size: 1.12em !important;
    padding: 8px 10px !important;
  }
  
  .unit-select {
    padding: 8px 20px 8px 10px !important;
    font-size: 1.02em !important;
  }
}

/* 애니메이션 효과 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out forwards !important;
}