/* ==========================================================================
   ToolIxa JSON Formatter & Validator Component Styles
   Matches global design system tokens, responsive grid, light & dark theme
   ========================================================================== */

/* Two-Column Desktop Developer Workspace Grid */
.json-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: stretch;
}

/* Code Editor Container */
.json-editor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);

}

.json-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.json-editor-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Input Code Textarea */
.json-textarea {
  width: 100%;
  min-height: 380px;
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace, var(--font-heading);
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  resize: vertical;
  tab-size: 2;
  white-space: pre;
  overflow-x: auto;
}

.json-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Syntax Highlighting Output Box */
.json-output-viewer {
  width: 100%;
  min-height: 380px;
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace, var(--font-heading);
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--bg-body);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  white-space: pre;
  overflow-x: auto;
  user-select: text;
}

/* Syntax Token Highlighting Colors */
.json-key { color: #8B5CF6; font-weight: 700; }     /* Violet */
.json-string { color: #10B981; }                  /* Emerald */
.json-number { color: #F59E0B; font-weight: 600; }  /* Amber */
.json-boolean { color: #EC4899; font-weight: 700; } /* Pink */
.json-null { color: #64748B; font-style: italic; }  /* Slate */

[data-theme="dark"] .json-key { color: #A78BFA; }
[data-theme="dark"] .json-string { color: #34D399; }
[data-theme="dark"] .json-number { color: #FBBF24; }
[data-theme="dark"] .json-boolean { color: #F472B6; }
[data-theme="dark"] .json-null { color: #94A3B8; }

/* Validation Status Banners */
.json-status-banner {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.json-status-banner.valid {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}

.json-status-banner.invalid {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #DC2626;
}

[data-theme="dark"] .json-status-banner.valid { color: #34D399; }
[data-theme="dark"] .json-status-banner.invalid { color: #F87171; }

/* Editor Footer Stats */
.json-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Toolbar & Settings Row */
.json-controls-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Responsive Adaptations */
@media (max-width: 900px) {
  .json-workspace-grid {
    grid-template-columns: 1fr;
  }
}
