/* Schema Generator specific styles */

/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-group label {
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
  font-size: 0.9375rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary-600);
  color: white;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background-color: var(--primary-700);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-500);
  color: var(--primary-500);
}

.btn-outline:hover {
  background-color: rgba(99, 179, 237, 0.1);
  border-color: var(--primary-400);
  color: var(--primary-400);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Select Dropdown */
select {
  background-color: var(--input-bg);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--input-border);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 160px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Code Editor */
.code-container {
  position: relative;
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.code-container:focus-within {
  box-shadow: 0 0 0 2px var(--primary-500);
  border-color: var(--primary-500);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--card-bg);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}

.code-title {
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-400);
}

.code-actions {
  display: flex;
  gap: 0.5rem;
}

textarea {
  width: 100%;
  min-height: 300px;
  padding: 1.25rem;
  background-color: var(--card-bg);
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  border: none;
  resize: vertical;
  transition: all 0.2s ease;
  outline: none;
  tab-size: 2;
  -moz-tab-size: 2;
}

textarea:focus {
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.5);
}

/* Syntax highlighting for JSON preview */
.json-key { color: var(--primary-400); }
.json-string { color: var(--success); }
.json-number { color: #d19a66; }
.json-boolean { color: #61afef; }
.json-null { color: #e06c75; }

/* Preview Section */
.preview-container {
  margin-top: 2rem;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
}

.preview-content {
  padding: 1.25rem;
  font-family: 'Fira Code', monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--card-bg);
  color: var(--text);
  transition: all 0.2s ease;
}

.preview-content pre {
  margin: 0;
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--gray-500);
  transition: all 0.2s ease;
}

.empty-state i {
  margin-bottom: 1rem;
  color: var(--gray-600);
}

.empty-state p {
  margin: 0;
  max-width: 400px;
  line-height: 1.5;
}

/* Tooltips */
.tooltip {
  position: fixed;
  background-color: var(--tooltip-bg);
  color: var(--tooltip-text);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  max-width: 250px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  select, .btn {
    width: 100%;
  }
  
  .code-actions {
    display: none;
  }
}

@media (max-width: 600px) {
  body { padding: 20px; }
  textarea { height: 250px; }
}
