/* Bulk Renamer – card and button styles shared with Revision Renamer / PDF Compress;
   colours, fonts, tool bar and theme come from ../shared/rm-tools.css */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

.container {
  width: 100%;
  max-width: 1600px;   /* wider than the other tools: long drawing filenames */
  margin: 0 auto;
  padding: 0 20px;
}
main.container { padding: 28px 20px 60px; }


/* Hero band */
.br-hero { padding: 40px 0 34px; }
.br-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.08; }
.br-hero p { margin: 0; max-width: 560px; }

.card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--rm-shadow-sm);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-primary);
  color: var(--rm-primary-ink);
  font: 600 .8rem var(--rm-mono);
}

.dropzone {
  border: 2px dashed var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 28px;
  text-align: center;
  color: var(--rm-muted);
  background: var(--rm-surface-2);
  transition: background 0.15s, border-color 0.15s;
}
.dropzone.is-dragover {
  background: var(--rm-primary-soft);
  border-color: var(--rm-primary);
}
.dropzone p { margin: 0 0 12px; }
.drop-icon { width: 34px; height: 34px; margin-bottom: 6px; fill: none; stroke: var(--rm-primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The file input stays focusable (keyboard users tab to it) but is invisible; the label is the button */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.browse-btn { position: relative; }
.browse-btn:focus-within { outline: 2px solid var(--rm-primary); outline-offset: 2px; }

.btn--large { padding: 12px 26px; font-size: 1rem; min-height: 46px; }
.btn--small { padding: 6px 12px; font-size: 0.82rem; min-height: 32px; }
.rm-btn:disabled { opacity: 0.55; cursor: wait; }

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.status-msg { font-size: 0.9rem; color: var(--rm-primary); }
.status-msg.is-error { color: var(--rm-danger); }

.table-scroll { overflow-x: auto; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); }
.output-note { font-size: 0.85rem; line-height: 1.6; color: var(--rm-muted); margin: 14px 0 0; }



/* ---------- Bulk Renamer ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--rm-amber); border-radius: var(--rm-radius); background: var(--rm-surface); line-height: 1.5; }
.notice svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: var(--rm-amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-btn { color: var(--rm-danger); margin-left: auto; }
.hint { margin: 10px 0 0; font-size: .82rem; color: var(--rm-muted); font-style: italic; }
.hint .reset-cols { font-style: normal; margin-left: 6px; }
.folder-line { display: flex; gap: 8px; align-items: baseline; margin: 14px 0 12px; font-size: .9rem; }
.folder-line .lbl { color: var(--rm-muted); font-weight: 600; }
.folder-name { color: var(--rm-primary); font-weight: 600; word-break: break-all; }

.grid-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); outline: none; }
.grid-wrap:focus-visible { box-shadow: 0 0 0 2px var(--rm-primary); }
.grid { border-collapse: collapse; table-layout: fixed; font-size: .86rem; user-select: none; }   /* width comes from the column widths (script.js) */
.grid th { position: sticky; top: 0; z-index: 1; background: var(--rm-navy, #0b2a4a); color: #e8f2ff; font: 600 .74rem var(--rm-mono); letter-spacing: .06em; text-align: left; padding: 8px 14px 8px 10px; border-right: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid th.sortable { cursor: pointer; }
.grid th.sortable:hover { color: var(--rm-amber); }
.grid th.rownum, .grid tbody th.rownum { text-align: center; }
/* Drag the right edge of a header to resize a column; double-click it to fit the longest entry */
.grid th .th-label { display: block; overflow: hidden; text-overflow: ellipsis; }
.col-resize { position: absolute; top: 0; right: 0; width: 12px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }   /* fully inside its own header cell: the next cell covers anything outside */
.col-resize::after { content: ""; position: absolute; top: 20%; bottom: 20%; right: 0; width: 1px; background: rgba(255,255,255,.35); }
.col-resize:hover::after, .col-resize.is-active::after { top: 0; bottom: 0; width: 3px; background: var(--rm-amber); }
.grid tbody th.rownum { position: static; background: var(--rm-surface-2); color: var(--rm-muted); font: .72rem var(--rm-mono); border-right: 1px solid var(--rm-border); border-bottom: 1px solid var(--rm-border); padding: 0 4px; }
.grid td { height: 28px; padding: 0 8px; border-right: 1px solid var(--rm-border); border-bottom: 1px solid var(--rm-border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; background: var(--rm-surface); }
.grid td.calc { background: var(--rm-surface-2); color: var(--rm-muted); }
.grid td.calc-tint { background: var(--rm-surface-2); }
.grid td[data-c="3"] { color: var(--rm-text); font-weight: 600; }
.grid td.st-ok { color: var(--rm-success); font-weight: 700; }
.grid td.st-skip { color: #8a5a00; font-weight: 700; }   /* dark amber: readable on the light grid */
:root[data-theme="dark"] .grid td.st-skip { color: var(--rm-amber); }
.grid td.st-err { color: var(--rm-danger); font-weight: 700; }
.grid td.sel { background: var(--rm-primary-soft); }
.grid td.focus { box-shadow: inset 0 0 0 2px var(--rm-primary); }
.grid td:has(.cell-input) { padding: 0; }
.cell-input { width: 100%; height: 28px; border: 0; padding: 0 8px; font: inherit; color: var(--rm-text); background: var(--rm-surface); outline: 2px solid var(--rm-primary); outline-offset: -2px; }

.pager-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.rows-label { font: .8rem var(--rm-mono); color: var(--rm-muted); }
.pager { display: flex; align-items: center; gap: 6px; }
.page-label { font: 600 .85rem var(--rm-mono); min-width: 100px; text-align: center; }
.action-row { justify-content: flex-end; margin: 18px 0 0; }
.status-bar { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rm-border); font-size: .85rem; color: var(--rm-muted); min-height: 1.4em; }

.br-dialog { border: 1px solid var(--rm-border); border-radius: var(--rm-radius-lg); background: var(--rm-surface); color: var(--rm-text); padding: 22px 24px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--rm-shadow-lg); }
.br-dialog::backdrop { background: rgba(4, 16, 30, .6); }
.br-dialog h3 { margin: 0 0 8px; font-size: 1.3rem; }
.br-dialog p { margin: 0 0 16px; color: var(--rm-muted); white-space: pre-line; word-break: break-word; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 560px) {
  .toolbar .rm-btn { flex: 1 1 100%; justify-content: center; }
  .danger-btn { margin-left: 0; }
  .action-row .btn--large { width: 100%; }
}
