/*
|--------------------------------------------------------------------------
| iToolsEra JSON Formatter & Validator
| v1.0.0
|--------------------------------------------------------------------------
|
| Tool-specific styles only. Global layout, Bootstrap and typography are
| supplied by the existing iToolsEra page system.
|
|--------------------------------------------------------------------------
*/

.json-formatter-tool {
  width: 100%;
}

.json-formatter-card,
.json-formatter-stats-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.json-formatter-card-header,
.json-formatter-stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.json-formatter-kicker {
  display: block;
  margin-bottom: 4px;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.json-formatter-panel {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.json-formatter-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.json-formatter-editor-shell {
  display: flex;
  width: 100%;
  height: 430px;
  min-height: 430px;
  max-height: 430px;
  overflow: hidden;
  background: #fff;
}

.json-formatter-line-numbers {
  flex: 0 0 48px;
  height: 100%;
  overflow: hidden;
  padding: 16px 10px 16px 8px;
  border-right: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  white-space: pre;
}

.json-formatter-line-numbers .is-error-line {
  display: block;
  margin: 0 -10px 0 -8px;
  padding: 0 10px 0 8px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.json-formatter-editor {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  resize: none;
  overflow: auto;
  padding: 16px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #0f172a;
  background: #fff;
}

.json-formatter-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.json-formatter-output-shell {
  display: flex;
  width: 100%;
  height: 430px;
  min-height: 430px;
  max-height: 430px;
  overflow: hidden;
  background: #0f172a;
  border-radius: 0 0 12px 12px;
}

.json-formatter-output-line-numbers {
  flex: 0 0 48px;
  width: 48px;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: 16px 10px 16px 8px;
  border-right: 1px solid rgba(148, 163, 184, 0.28);
  background: #0b1220;
  color: #64748b;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  white-space: pre;
}

.json-formatter-output {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding: 16px;
  background: #0f172a;
  color: #e2e8f0;
  outline: none;
}

.json-formatter-output:focus {
  box-shadow: inset 0 0 0 2px rgba(96, 165, 250, 0.55);
}

.json-formatter-output pre {
  margin: 0;
  min-width: max-content;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre;
}

.json-formatter-empty {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #94a3b8;
  text-align: center;
}

.json-formatter-empty i {
  font-size: 2rem;
}

.json-token-key {
  color: #93c5fd;
}

.json-token-string {
  color: #86efac;
}

.json-token-number {
  color: #fcd34d;
}

.json-token-boolean {
  color: #c4b5fd;
}

.json-token-null {
  color: #fca5a5;
}

.json-formatter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.json-formatter-primary-actions,
.json-formatter-secondary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.json-formatter-indent-control {
  display: inline-flex;
  align-items: center;
}

.json-formatter-indent-control .form-control {
  width: auto;
  min-width: 112px;
}

.json-formatter-status {
  min-height: 24px;
  margin-top: 14px;
}

.json-formatter-status .alert {
  margin-bottom: 0;
}

.json-formatter-error-details {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #7f1d1d;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-formatter-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.json-formatter-stats-grid > div {
  display: flex;
  min-height: 90px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
}

.json-formatter-stats-grid strong {
  font-size: 1.25rem;
  line-height: 1.2;
  color: #0f172a;
}

.json-formatter-stats-grid span {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.78rem;
}

.json-formatter-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.json-formatter-feature-card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.json-formatter-feature-card > i {
  margin-bottom: 3px;
  color: #2563eb;
  font-size: 1.25rem;
}

.json-formatter-feature-card strong {
  font-size: 0.95rem;
}

.json-formatter-feature-card span {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.55;
}

@media (max-width: 991.98px) {
  .json-formatter-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .json-formatter-card,
  .json-formatter-stats-card {
    padding: 16px;
  }

  .json-formatter-card-header,
  .json-formatter-stats-header {
    flex-direction: column;
  }

  .json-formatter-editor-shell,
  .json-formatter-editor,
  .json-formatter-output,
  .json-formatter-output-shell {
    height: 340px;
    min-height: 340px;
    max-height: 340px;
  }

  .json-formatter-output-line-numbers {
    flex-basis: 42px;
    width: 42px;
    padding-right: 8px;
    padding-left: 6px;
    font-size: 0.82rem;
  }

  .json-formatter-line-numbers {
    flex-basis: 42px;
    padding-right: 8px;
    padding-left: 6px;
    font-size: 0.82rem;
  }

  .json-formatter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .json-formatter-primary-actions,
  .json-formatter-secondary-actions {
    width: 100%;
  }

  .json-formatter-primary-actions .btn,
  .json-formatter-secondary-actions .btn {
    flex: 1 1 auto;
  }

  .json-formatter-indent-control {
    width: 100%;
  }

  .json-formatter-indent-control .form-control {
    flex: 1 1 auto;
  }

  .json-formatter-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .json-formatter-feature-grid {
    grid-template-columns: 1fr;
  }
}
