/* 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  overflow-x: auto;
}

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
}

/* 헤더 스타일 */
header {
  text-align: center;
  margin-bottom: 2px;
  padding: 20px;
  background: linear-gradient(52deg, #95c0d5 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.2em;
}

header p {
  font-size: 0.4em;
  opacity: 0.9;
}

/* GNB 네비게이션 */
.gnb-nav {
  display: flex;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  position: relative;
}

.gnb-item {
  flex: 1;
  position: relative;
}

.gnb-btn {
  width: 100%;
  padding: 15px 20px;
  border: none;
  background: white;
  color: #666;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 10px;
}

.gnb-btn:hover {
  background: #f8f9fa;
}

.gnb-item.active .gnb-btn {
  background: #667eea;
  color: white;
}

/* 드롭다운 메뉴 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  border-top: 1px solid #e1e5e9;
  margin-top: 1px;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.gnb-item.active .dropdown-menu,
.gnb-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  flex: 1;
  min-width: 0;
  padding: 12px 20px;
  border: none;
  background: white;
  color: #666;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border-right: 1px solid #f1f3f5;
  white-space: nowrap;
}

.dropdown-item:last-child {
  border-right: none;
  border-radius: 0 0 10px 0;
}

.dropdown-item:first-child:last-child {
  border-radius: 0 0 10px 10px;
}

.dropdown-item:hover {
  background: #f8f9fa;
  color: #667eea;
}

.dropdown-item.active {
  background: #667eea;
  color: white;
}

.dropdown-item.active:hover {
  background: #5a6fd8;
}

/* 도구 컨텐츠 */
.tool-content {
  display: none;
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.tool-content.active {
  display: block;
}

.tool-content h2 {
  color: #667eea;
  margin-bottom: 20px;
  font-size: 1.8em;
}

/* 도구 섹션 */
.tool-section {
  max-width: 800px;
  margin: 0 auto;
}

.input-section {
  margin-bottom: 20px;
}

.input-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.input-section textarea {
  width: 100%;
  min-height: 200px;
  max-height: 60vh;
  padding: 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s ease;
  overflow-y: auto;
}

.input-section textarea:focus {
  outline: none;
  border-color: #667eea;
}

.input-section textarea[readonly] {
  background-color: #f8f9fa;
}

/* SQL 맵핑 컨테이너 */
.sql-mapping-container {
  display: flex;
  gap: 20px;
  align-items: stretch;
  margin: 0 auto;
}

.input-panel{
  max-width:400px;
}
.input-panel, .output-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.input-panel label, .output-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.textarea-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  overflow: hidden;
}

.line-numbers {
  background: #f8f9fa;
  color: #666;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 8px;
  text-align: right;
  white-space: pre;
  overflow: hidden;
  user-select: none;
  min-width: 50px;
  border-right: 1px solid #e1e5e9;
  flex-shrink: 0;
}

.input-panel textarea, .output-panel textarea {
  width: 100%;
  min-height: 400px;
  padding: 12px;
  border: none;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  flex: 1;
  tab-size: 4;
  overflow-y: auto;
}

.textarea-wrapper:focus-within {
  border-color: #667eea;
}

.input-header, .output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 15px;
}

.dbms-selector {
  flex-shrink: 0;
}

.dbms-select {
  padding: 8px 12px;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: border-color 0.3s ease;
  min-width: 120px;
}

.dbms-select:hover {
  border-color: #667eea;
}

.dbms-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.copy-btn {
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
}

.output-panel textarea[readonly] {
  background-color: #f8f9fa;
}

.arrow-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  padding: 0 10px;
}

.arrow-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 50px;
  border: 2px solid #667eea;
  border-radius: 10px;
  background: white;
  color: #667eea;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 8px;
}

.arrow-btn:hover {
  background: #667eea;
  color: white;
  transform: scale(1.1);
}

.arrow-btn span {
  font-size: 20px;
  line-height: 1;
}

.arrow-btn small {
  font-size: 10px;
  font-weight: 400;
  margin-top: 2px;
}

/* 버튼 스타일 */
button {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#map-btn, #json-btn, #js-btn, #css-btn {
  background: #667eea;
  color: white;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#map-btn:hover, #json-btn:hover, #js-btn:hover, #css-btn:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

#unicode-encode-btn, #unicode-decode-btn, 
#url-encode-btn, #url-decode-btn, 
#base64-encode-btn, #base64-decode-btn {
  background: #667eea;
  color: white;
  flex: 1;
  max-width: 150px;
}

#unicode-encode-btn:hover, #unicode-decode-btn:hover, 
#url-encode-btn:hover, #url-decode-btn:hover, 
#base64-encode-btn:hover, #base64-decode-btn:hover {
  background: #5a6fd8;
  transform: translateY(-1px);
}

/* 서브 네비게이션 */
.sub-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  justify-content: center;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 8px;
}

.sub-btn {
  padding: 10px 20px;
  background: white;
  color: #666;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sub-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.sub-btn:hover {
  background: #e9ecef;
  border-color: #d6d9dc;
}

.sub-btn.active:hover {
  background: #5a6fd8;
}

/* 서브 컨텐츠 */
.sub-content {
  display: none;
}

.sub-content.active {
  display: block;
}

/* 출력 섹션 */
.output-section {
  margin-top: 20px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  header h1 {
    font-size: 2em;
  }
  
  .gnb-nav {
    flex-direction: column;
  }
  
  .gnb-item {
    margin-bottom: 5px;
  }
  
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    margin-top: 0;
    border-radius: 0;
  }
  
  .tool-content {
    padding: 20px;
    margin-top: 10px;
  }
  
  .sql-mapping-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .arrow-panel {
    order: 2;
    min-width: auto;
    padding: 10px 0;
  }
  
  .arrow-btn {
    transform: rotate(90deg);
  }
  
  .input-panel {
    order: 1;
  }
  
  .output-panel {
    order: 3;
  }
  
  .line-numbers {
    min-width: 40px;
    padding: 12px 6px;
  }
  
  .sub-nav {
    flex-wrap: wrap;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  #unicode-encode-btn, #unicode-decode-btn, 
  #url-encode-btn, #url-decode-btn, 
  #base64-encode-btn, #base64-decode-btn {
    max-width: none;
  }
}