/* =================================
   freeArr Tool Pages
   ================================= */

/* =================================
   Layout
   ================================= */

.tool-page {
  padding: 24px 0 40px;
}

.tool-container {
  width: min(calc(100% - 48px), var(--max-width));

  margin: 0 auto;
}

/* =================================
   Header
   ================================= */

.tool-header {
  margin-bottom: 16px;
}

.tool-header .eyebrow {
  display: inline-block;

  margin-bottom: 5px;

  color: var(--accent);

  font-size: 9px;
  font-weight: 700;

  letter-spacing: 0.12em;
}

.tool-header h1 {
  margin: 0 0 3px;

  color: var(--text);

  font-size: 23px;
  line-height: 1.2;

  letter-spacing: -0.035em;
}

.tool-header p {
  margin: 0;

  color: var(--text-soft);

  font-size: 12px;
}

/* =================================
   Main Panel
   ================================= */

.tool-panel {
  padding: 14px;

  background: var(--surface);

  border: 1px solid var(--border);
  border-radius: 10px;

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

/* =================================
   JSON Editor
   ================================= */

.json-editor {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 10px;
}

.json-editor .tool-field {
  margin: 0;
}

/* =================================
   Fields
   ================================= */

.tool-field label {
  display: block;

  margin-bottom: 6px;

  color: var(--text-soft);

  font-size: 11px;
  font-weight: 600;
}

/* =================================
   Textareas
   ================================= */

.tool-field textarea {
  width: 100%;
  min-height: 360px;

  display: block;

  padding: 11px;

  resize: vertical;

  background: var(--bg);

  border: 1px solid var(--border);
  border-radius: 7px;

  color: var(--text);

  outline: none;

  font-family: "Cascadia Code", "Consolas", monospace;

  font-size: 12px;
  line-height: 1.55;

  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.tool-field textarea::placeholder {
  color: var(--text-muted);
}

.tool-field textarea:focus {
  border-color: var(--accent);

  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Readonly result */

#json-output {
  background: var(--surface-hover);

  cursor: default;
}

/* =================================
   Buttons
   ================================= */

.tool-actions {
  display: flex;

  align-items: center;

  gap: 6px;

  flex-wrap: wrap;

  margin-top: 10px;
}

.tool-button {
  padding: 7px 11px;

  border: 1px solid var(--border);

  border-radius: 6px;

  font-size: 11px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.tool-button:hover {
  transform: translateY(-1px);
}

.tool-button:active {
  transform: translateY(0);
}

/* Primary */

.tool-button-primary {
  background: var(--accent);

  border-color: var(--accent);

  color: #ffffff;
}

.tool-button-primary:hover {
  background: var(--accent-hover);

  border-color: var(--accent-hover);
}

/* Secondary */

.tool-button-secondary {
  background: var(--surface-hover);

  color: var(--text-soft);
}

.tool-button-secondary:hover {
  background: var(--bg);

  border-color: var(--border-hover);

  color: var(--text);
}

/* =================================
   Result Status
   ================================= */

.tool-result {
  margin-top: 10px;

  padding: 9px 11px;

  background: var(--bg);

  border: 1px solid var(--border);

  border-radius: 7px;
}

.tool-result-label {
  display: block;

  margin-bottom: 2px;

  color: var(--text-muted);

  font-size: 9px;

  text-transform: uppercase;

  letter-spacing: 0.08em;
}

.tool-result-value {
  color: var(--text);

  font-size: 11px;

  font-weight: 600;

  word-break: break-word;
}

/* =================================
   Mobile
   ================================= */

@media (max-width: 800px) {
  .tool-container {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .json-editor {
    grid-template-columns: 1fr;
  }

  .tool-field textarea {
    min-height: 240px;
  }
}

@media (max-width: 480px) {
  .tool-container {
    width: calc(100% - 20px);
  }

  .tool-page {
    padding-top: 18px;
  }

  .tool-panel {
    padding: 10px;
  }

  .tool-actions {
    display: grid;

    grid-template-columns: repeat(2, 1fr);
  }

  .tool-button {
    width: 100%;
  }
}
