html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  background-color: #000;
  color: #fff;
  font-family: Arial, sans-serif;
}

.container {
  width: 100%;
  height: 100vh;
  background-color: #1a1a1a;
  position: relative;
  overflow: hidden;
}

.controls-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 100;
  pointer-events: none;
}

.controls {
  pointer-events: auto;
}

.controls.left {
  display: flex;
  gap: 10px;
  margin: 5px;
}

.skill-points {
  font-size: 1.2em;
  color: #4ade80;
  font-weight: bold;
}

.controls button {
  padding: 8px 16px;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  min-width: 80px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.controls button i {
  font-size: 16px;
}

.controls button:hover {
  background-color: rgba(0, 0, 0, 0.8);
  border-color: #60a5fa;
  color: #60a5fa;
}

.controls button.active {
  background-color: #2563eb;
  color: white;
  border-color: #60a5fa;
}

.skill-tree {
  width: 100%;
  height: 100%;
  position: relative;
}

#skillTreeSvg {
  width: 100vw;
  height: 100vh;
  display: block;
}

/* 노드와 링크 스타일 */
.node image {
  cursor: pointer;
  transition: all 0.3s;
  image-rendering: pixelated;  /* 픽셀 이미지를 선명하게 표시 */
}

.node image.active {
  filter: brightness(1.2);
}

.node image:hover {
  filter: brightness(1.4);
}

/* 툴팁 스타일 */
#tooltip {
  position: absolute;
  display: none;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid #666;
  border-radius: 4px;
  padding: 10px;
  max-width: 300px;
  color: white;
  pointer-events: none;
  z-index: 1000;
  font-size: clamp(12px, 1vw, 14px);  /* 반응형 기본 폰트 크기 */
  line-height: 1.5;
}

#tooltip strong {
  display: block;
  margin-bottom: 5px;
  color: #4a9eff;
  font-size: clamp(14px, 1.2vw, 16px);  /* 반응형 제목 폰트 크기 */
}

#tooltip .cost {
  margin-top: 8px;
  color: #ffd700;
  font-size: clamp(12px, 1vw, 14px);  /* 반응형 코스트 폰트 크기 */
}

/* 포인트 표시 스타일 */
#pointsDisplay {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.points-container {
  background: rgba(0, 0, 0, 0.8);
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.points-title {
  color: #4a9eff;
  font-weight: bold;
}

.points-value {
  color: #ffd700;
  font-size: 1.2em;
  margin-left: auto;
}

.points-total {
  color: #999;
}

/* 초기화 버튼 스타일 */
#resetButton {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 0, 0, 0.5);
  border-radius: 4px;
  cursor: pointer;
  z-index: 100;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

#resetButton i {
  font-size: 14px;
  transition: transform 0.2s ease;
}

#resetButton:hover {
  background: rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.8);
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

#resetButton:hover i {
  transform: rotate(-45deg);
}

/* 알림 스타일 */
#notificationContainer {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.notification {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease-in-out;
}

.notification.info i { color: #4a9eff; }
.notification.success i { color: #4caf50; }
.notification.warning i { color: #ffc107; }
.notification.error i { color: #f44336; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-container {
  position: absolute;
  top: 120px;
  right: 20px;
  width: 300px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  z-index: 100;
}

.stats-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: rgba(0, 0, 0, 0.8);
}

.stats-container.expanded .stats-wrapper {
  max-height: 500px;
  transition: max-height 0.3s ease-in;
}

.toggle-button {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toggle-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.stats-tabs {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  color: white;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.tab.active {
  border-bottom-color: #4a9eff;
  background: rgba(74, 158, 255, 0.1);
}

.stats-content {
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
}

.stats-section {
  margin-bottom: 20px;
}

.stats-section h3 {
  color: #4a9eff;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.stats-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stats-section li {
  color: white;
  padding: 5px 0;
  font-size: 0.9em;
}

/* 스크롤바 스타일링 */
.stats-content::-webkit-scrollbar {
  width: 6px;
}

.stats-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.stats-content::-webkit-scrollbar-thumb {
  background: rgba(74, 158, 255, 0.5);
  border-radius: 3px;
}

.stats-content::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 158, 255, 0.7);
}

/* 모바일 대응 */
@media (max-width: 768px) {
  .controls-container {
    padding: 5px;
  }

  .points-title {
    font-size: 12px;
  }

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

  .points-total {
    font-size: 12px;
  }

  .reset-button {
    padding: 6px 12px;
    font-size: 12px;
  }

  .reset-button i {
    font-size: 14px;
  }
}

/* 화면 크기에 따른 툴팁 크기 조정 */
@media screen and (max-width: 1200px) {
  #tooltip {
    max-width: 30vw;
  }
}

@media screen and (max-width: 768px) {
  #tooltip {
    max-width: 50vw;
  }
}

@media screen and (max-width: 480px) {
  #tooltip {
    max-width: 70vw;
  }
}

#jobSelectorContainer {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

.job-selector {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #4a9eff;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  cursor: pointer;
  outline: none;
}

.job-selector:hover {
  border-color: #7ab8ff;
}

.job-selector option {
  background-color: #1a1a1a;
  color: #fff;
}

.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: white;
  margin-top: 20px;
  font-size: 18px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
