/* 도구 페이지 스타일 */
.tools-container {
  display: flex;
  height: calc(100vh - 70px);
}

/* 초기 순서 명시적 설정 - JavaScript 로딩 전에도 올바른 순서 유지 */
.tools-container .sidebar {
  order: 1;
  width: 250px;
  background: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-right: 1px solid rgba(0, 255, 136, 0.3);
  flex-shrink: 0;
}

.tool-content {
  order: 2;
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tools-container .ad-sidebar {
  order: 3;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  flex-shrink: 0;
}

.tools-container .sidebar h3 {
  color: #00ff88;
  margin-bottom: 20px;
  font-size: 18px;
}

/* 도구 헤더 - 게임 헤더와 동일한 디자인 */
.tool-header {
  background: rgba(0, 0, 0, 0.8);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
}

.tool-title {
  font-size: 24px;
  font-weight: bold;
  color: #00ff88;
}

.tool-stats {
  display: flex;
  gap: 30px;
  font-size: 16px;
}

.tool-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.tool-stat-label {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
}

.tool-stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #00ff88;
}

/* 도구 영역 */
.tool-area {
  flex: 1;
  position: relative;
  background: radial-gradient(
    circle at center,
    rgba(0, 255, 136, 0.1) 0%,
    transparent 70%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 500px;
  padding: 40px;
  gap: 30px;
}

.tool-list {
  list-style: none;
}

.tool-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  color: white;
  text-decoration: none;
  display: block;
}

.tool-item:hover,
.tool-item.active {
  background: rgba(0, 255, 136, 0.1);
  border-left-color: #00ff88;
  color: #00ff88;
}

.tool-instructions {
  text-align: center;
  max-width: 800px;
}

.tool-instructions h2 {
  color: #00ff88;
  margin-bottom: 15px;
}

.tool-instructions p {
  color: #aaa;
  line-height: 1.6;
}

.tool-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 색상 팔레트 도구 */
.color-palette {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.color-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.color-box {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.color-box:hover {
  transform: scale(1.1);
  border-color: #00ff88;
}

.color-code {
  font-size: 12px;
  color: #aaa;
  text-align: center;
  font-family: monospace;
}

/* 키워드 도구 */
.keyword-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 15px;
  width: 100%;
  max-width: 700px;
}

.keyword-tag {
  background: rgba(0, 255, 136, 0.2);
  padding: 12px 16px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(0, 255, 136, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.keyword-tag:hover {
  background: rgba(0, 255, 136, 0.3);
  transform: translateY(-2px);
}

/* 단위 변환기 도구 */
.unit-converter-form {
  background: rgba(0, 0, 0, 0.6);
  padding: 30px;
  border-radius: 15px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  width: 100%;
  max-width: 700px;
}

.conversion-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.input-group label,
.result-group label {
  display: block;
  color: #00ff88;
  margin-bottom: 8px;
  font-weight: bold;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
}

.arrow {
  font-size: 24px;
  color: #00ff88;
}

#conversionResult {
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  font-size: 16px;
  min-height: 20px;
}

.unit-selectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.unit-group label {
  display: block;
  color: #aaa;
  margin-bottom: 8px;
}

.unit-group select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  background: rgba(26, 26, 46, 0.9);
  color: white;
  font-size: 16px;
}

/* 텍스트 변환기 도구 */
.text-transformer-form {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 550px;
}

.input-section label,
.result-section label {
  display: block;
  color: #00ff88;
  margin-bottom: 10px;
  font-weight: bold;
}

.input-section textarea {
  width: 100%;
  height: 120px;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
  resize: vertical;
  line-height: 1.5;
}

.transform-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

#textResult {
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 136, 0.3);
  min-height: 100px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.copy-result {
  align-self: center;
  padding: 12px 30px;
}
/* ===== PC 전용 (1200px 이상) ===== */
@media (min-width: 1200px) {
}

/* ===== 태블릿 (768px ~ 1199px) ===== */
@media (max-width: 1199px) and (min-width: 768px) {
  .tools-container .sidebar {
    width: 200px;
    order: 1;
  }

  .tools-container .ad-sidebar {
    display: none !important;

    order: 2;
  }
}

@media (max-width: 767px) {
  .tools-container {
    flex-direction: column;
  }

  .tools-container .sidebar {
    order: 1;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    margin: 0 -15px 20px -15px;
  }

  .tools-container .ad-sidebar {
    display: none !important;
    order: 2;
  }
}
