/* ─── Box•E QR Label Generator Styles ─────────────────────────────── */

/* ─── Page wrapper ──────────────────────────────────────────────── */
.qrgen-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 992px) {
  .qrgen-wrap { padding: 0 1.5rem; }
}

/* ─── Monospace textarea ────────────────────────────────────────── */
.font-mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: .82rem;
  line-height: 1.5;
}

/* ─── Controls panel ────────────────────────────────────────────── */
.controls-panel {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* ─── Custom dimensions panel ───────────────────────────────────── */
.custom-fields-panel {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
}
.custom-fields-header {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .45px;
  color: var(--text-muted);
}

/* ─── Preview panel ─────────────────────────────────────────────── */
.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.preview-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .7rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-alt);
}

/* ─── Preview wrapper (canvas area) ────────────────────────────── */
.preview-wrapper {
  padding: 1.25rem;
  background: #c8c8c8;
  min-height: 420px;
  overflow: auto;
}
.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: var(--text-muted);
  font-size: .9rem;
  text-align: center;
  user-select: none;
}
.preview-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #842029;
  font-size: .9rem;
  text-align: center;
  padding: 1rem;
}

/* ─── Page container ────────────────────────────────────────────── */
.page-container {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  margin-bottom: 1.25rem;
  /* zoom is applied inline by JS for preview scaling */
}
.page-container:last-child { margin-bottom: 0; }

/* ─── Label cell ────────────────────────────────────────────────── */
.label-cell {
  display: flex;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
  background: #fff;
  /* Use web-safe fonts for reliable print rendering */
  font-family: Arial, Helvetica, sans-serif;
}

/* Cut guides: dashed outline inset from the edge */
.label-cell.label-guides {
  outline: 0.3mm dashed #bbb;
  outline-offset: -0.15mm;
}

/* ─── QR code container ─────────────────────────────────────────── */
.label-qr {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.label-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ─── Label text ────────────────────────────────────────────────── */
.label-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding-left: 1.5mm;
}
.label-name {
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-family: Arial, Helvetica, sans-serif;
}
.label-url {
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  font-family: Arial, Helvetica, sans-serif;
}
.label-url--solo {
  font-weight: 600;
  color: #000;
}

/* ─── Print styles ──────────────────────────────────────────────── */
@media print {
  /* Show only #print-root (page containers cloned there by JS) */
  body > *:not(#print-root) { display: none !important; }
  #print-root               { display: block !important; }

  /* Reset page container zoom set for preview */
  .page-container {
    zoom: 1 !important;
    transform: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
  }

  /* Cut guides print as fine dashed lines */
  .label-cell.label-guides {
    outline: 0.2pt dashed #bbb;
    outline-offset: -0.1pt;
  }
}


/* ─── Print-root hidden on screen ───────────────────────────────── */
#print-root { display: none; }
