/* Minecraft Custom Model Data Converter Styling */
.cmd-section {
  margin: 30px 0;
}

.cmd-section h2 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #2c3e50;
}

/* Form elements */
.cmd-form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}

.cmd-form-select {
  padding: 12px;
  border: 2px solid #d1d5db;
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  background-color: #F8F9FA;
  color: #374151;
  transition: border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.cmd-form-select:focus {
  outline: none;
  border-color: #3984a7;
}

/* Direction selector */
.cmd-direction-selector {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  flex-wrap: wrap;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cmd-selector-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  flex: 1;
  max-width: 200px;
}

.cmd-selector-group .cmd-form-label {
  margin-bottom: 8px;
  text-align: center;
}

.cmd-format-pill {
  padding: 12px;
  border: 2px solid #d1d5db;
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  background-color: #F8F9FA;
  color: #374151;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-weight: 500;
}

/* Swap button - reuse converter.css styles */
.swap-button {
  background: #f8f9fa;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.swap-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: rgba(19, 118, 179, 0.2);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.swap-button:active::before {
  opacity: 1;
}

.swap-button:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.swap-button.rotated {
  transform: rotate(180deg);
}

.swap-button svg {
  width: 20px;
  height: 20px;
  color: #374151;
}

/* Dual editors container */
.cmd-editors-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}

.cmd-editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cmd-editor-panel > .cmd-form-label {
  text-align: center;
}

.cmd-output-label {
  color: #6b7280;
}

/* JSON Editor Container */
.json-editor-container {
  position: relative;
  display: flex;
  border: 2px solid #d1d5db;
  border-radius: 24px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease;
  height: 400px;
}

.json-editor-container:focus-within {
  border-color: #3984a7;
}

.json-editor-container.has-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}

.output-editor {
  background: #f8f9fa;
  border-color: #e9ecef;
}

.output-editor:focus-within {
  background: #ffffff;
  border-color: #3984a7;
}

.output-editor .line-numbers {
  background-color: #f1f3f4;
}

/* Line numbers */
.line-numbers {
  padding: 16px 8px;
  background-color: #f8f9fa;
  border-right: 1px solid #e5e7eb;
  color: #6b7280;
  font-family: Consolas, 'Roboto Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Liberation Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
  user-select: none;
  white-space: pre;
  min-width: 40px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Editor wrapper for highlight overlay */
.editor-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  min-width: 0;
}

/* Syntax highlight overlay */
.json-highlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  font-family: Consolas, 'Roboto Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Liberation Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  box-sizing: border-box;
  color: #2c3e50;
  background: transparent;
  min-height: 100%;
}

.json-highlight .json-key { color: #0550ae; }
.json-highlight .json-string { color: #0a3069; }
.json-highlight .json-number { color: #0550ae; }
.json-highlight .json-boolean { color: #cf222e; }
.json-highlight .json-null { color: #cf222e; }

/* Textarea styling */
.json-textarea {
  width: 100%;
  height: 100%;
  font-family: Consolas, 'Roboto Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Liberation Mono', 'Courier New', monospace;
  padding: 16px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  color: transparent;
  caret-color: #2c3e50;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  tab-size: 4;
  -moz-tab-size: 4;
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
}

.json-textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.json-textarea::-moz-placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Buttons */
.cmd-button, .cmd-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 2px solid;
  border-radius: 24px;
  font-weight: bold;
  font-size: 16px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-height: 44px;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.cmd-button {
  background-color: #3984a7;
  color: #ffffff;
  border: 2px solid #d1d5db;
}

.cmd-button:hover {
  background-color: #2d6a89;
  border-color: #7fa8c0;
}

.cmd-button:active {
  transform: scale(0.98);
}

.cmd-button-secondary {
  background-color: #85898f;
  color: #ffffff;
  border-color: #a5a9ae;
}

.cmd-button-secondary:hover {
  background-color: #6a6e73;
  border-color: #85898f;
}

.cmd-button-secondary:active {
  transform: scale(0.98);
}

.clear-button {
  background-color: #dd5151 !important;
  color: #ffffff !important;
  border-color: #d1d5db !important;
}

.clear-button:hover {
  background-color: #c44040 !important;
  border-color: #9ca3af !important;
}

.clear-button:active {
  transform: scale(0.98);
}

.clear-icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  flex-shrink: 0;
  display: block;
  margin-top: 0 !important;
}

.generate-icon {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px;
  max-height: 16px;
  flex-shrink: 0;
  display: block;
  margin-top: 0 !important;
}

.copy-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Button container */
.cmd-buttons-container {
  display: grid;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  max-width: 800px;
  margin: 0 auto;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr;
}

/* Drag and drop */
.cmd-editor-panel.drag-over .json-editor-container {
  border-color: #3984a7;
  background: #f0f8ff;
  box-shadow: 0 0 0 3px rgba(57, 132, 167, 0.2);
}

/* Focus states */
.json-editor-container:focus-within,
.cmd-form-select:focus,
.cmd-button:focus,
.cmd-button-secondary:focus {
  box-shadow: 0 0 0 3px rgba(19, 118, 179, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .cmd-editors-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .json-editor-container {
    height: 300px;
  }

  .cmd-buttons-container {
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .cmd-options {
    max-width: 100%;
  }

  .json-textarea {
    font-size: 13px;
  }

  .json-editor-container {
    height: 250px;
  }

  .line-numbers {
    padding: 16px 6px;
    font-size: 13px;
    min-width: 35px;
  }

  .cmd-direction-selector {
    gap: 8px;
    width: 100%;
  }

  .cmd-selector-group {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .swap-button {
    margin: 0 4px;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) and (min-width: 349px) {
  .cmd-buttons-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    max-width: 400px;
  }
}

@media (max-width: 348px) {
  .cmd-buttons-container {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    max-width: 300px;
  }
}