/* philtext/static/philtext/css/import_paragraphs.css
   Styles for the import_paragraphs template (text_import app).
*/

/* ── Page header ──────────────────────────────────────────────────────────── */
.import-para-header { margin-bottom: 1.6rem; }
.import-para-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-text);
  margin: 0;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent-soft-bg);
}
.import-para-header .text-meta {
  font-size: 0.83rem;
  color: var(--label);
  margin: 0.5rem 0 0;
}

/* ── Two-column layout ────────────────────────────────────────────────────── */
.import-para-layout {
  display: flex;
  gap: 1.8rem;
  align-items: flex-start;
}

/* ── Controls sidebar ─────────────────────────────────────────────────────── */
.import-controls {
  width: 270px;
  flex-shrink: 0;
  background: var(--surface-card-2);
  border: 1px solid var(--line-mid);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
  position: sticky;
  top: calc(54px + 1.5rem);
}
.ctrl-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--label);
  margin: 0 0 1.1rem;
}
.ctrl-field { margin-bottom: 1.1rem; }
.ctrl-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 0.3rem;
}
.ctrl-field input[type="file"],
.ctrl-field input[type="number"],
.ctrl-field select {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ctrl-field input:focus,
.ctrl-field select:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 2px rgba(61,61,122,0.12);
}
.ctrl-uploaded-file {
  font-size: 0.82rem;
  color: var(--text-mid);
  background: var(--control-hover-bg);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 0.4rem 0.65rem;
  word-break: break-all;
}

/* Trim inputs (two side by side) */
.ctrl-trim { display: flex; gap: 0.7rem; margin-bottom: 1.1rem; }
.ctrl-trim > div { flex: 1; }
.ctrl-trim label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 0.3rem;
}
.ctrl-trim input {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--input-bg);
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ctrl-trim input:focus {
  outline: none;
  border-color: var(--focus-border);
  box-shadow: 0 0 0 2px rgba(61,61,122,0.12);
}

/* Action buttons */
.ctrl-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-mid);
}
.ctrl-actions .btn-primary {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.2rem;
  border-radius: 5px;
  border: none;
  background: var(--accent-soft-bg);
  color: var(--accent-soft-text);
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}
.ctrl-actions .btn-primary:hover { background: var(--accent-soft-hover-bg); }
.ctrl-actions .btn-secondary {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 1.2rem;
  border-radius: 5px;
  border: 1px solid var(--focus-border);
  background: var(--surface-card);
  color: var(--accent-text);
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.ctrl-actions .btn-secondary:hover { background: var(--accent-soft-hover-bg); color: var(--accent-soft-text); }

/* ── Preview panel ────────────────────────────────────────────────────────── */
.import-preview { flex: 1; min-width: 0; }
.preview-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--label);
  margin: 0 0 0.9rem;
}
.preview-empty { color: var(--text-faint); font-style: italic; padding: 1rem 0; }

/* ── Paragraph preview table ──────────────────────────────────────────────── */
/* Child combinators keep these rules from leaking into an imported <table>
   rendered inside a preview cell (see .preview-table below). */
.para-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.para-table > thead th {
  background: var(--surface-wash);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 2px solid var(--line-mid);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
}
.para-table > tbody > tr > td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.para-table > tbody > tr > td:first-child {
  color: var(--label);
  font-size: 0.78rem;
  white-space: nowrap;
  width: 3rem;
}
.para-table > tbody > tr:hover > td { background: var(--row-hover); }

/* Imported tables rendered inside a preview cell: shown as a real grid. */
.preview-table { overflow-x: auto; max-width: 100%; }
.preview-table table { border-collapse: collapse; font-size: 0.82rem; }
.preview-table td,
.preview-table th {
  border: 1px solid var(--line-strong);
  padding: 0.25rem 0.45rem;
  vertical-align: top;
}
.preview-table td[colspan] { text-align: center; font-style: italic; }
