/* PDFlyHQ — tools/add-watermark/options.css
   File card + watermark text/appearance controls + CSS-only live preview.
   Matches _Options.cshtml. JS contract: #file-name, #file-size,
   #btn-remove-file, #opt-text, #opt-font-size, #opt-color, #opt-opacity,
   #opt-rotation, #watermark-preview-text, #btn-watermark, #btn-back.

   The preview is intentionally NOT a pdf.js page render (unlike Sign PDF /
   Organize PDF) — a watermark's exact placement over real content doesn't
   need to be pixel-accurate to be useful, so a plain CSS box showing the
   text at the chosen size/color/opacity/angle is enough, and needs no
   canvas or worker round-trip to stay live. */

.options-wrap { display: flex; flex-direction: column; gap: var(--space-6); }

/* ── File card (shared shape across every tool's Options step) ── */
.file-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--color-primary-500) 6%, var(--color-surface-alt));
  border: 1px solid color-mix(in srgb, var(--color-primary-500) 18%, var(--color-border));
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.file-card__icon { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--color-surface); border-radius: var(--radius-sm); color: var(--color-primary-600); }
.file-card__icon svg { width: 20px; height: 20px; }
.file-card__meta { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.file-card__meta #file-name { font-weight: var(--font-semibold); color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card__meta #file-size { font-size: var(--text-xs); color: var(--color-text-muted); }

#btn-remove-file {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-base) var(--ease-default), background-color var(--duration-base) var(--ease-default);
}
#btn-remove-file:hover { color: var(--color-danger-500); background: var(--color-danger-50); }
#btn-remove-file:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
#btn-remove-file svg { width: 14px; height: 14px; }

.options-group { display: flex; flex-direction: column; gap: var(--space-3); }
.options-group__label { font-size: var(--text-xs); font-weight: var(--font-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }

.select {
  height: 40px;
  width: 100%;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: border-color var(--duration-base) var(--ease-default),
              box-shadow var(--duration-base) var(--ease-default);
}
.select:focus { outline: none; border-color: var(--color-primary-500); box-shadow: var(--shadow-focus); }

/* ── Layout: controls | live preview, side by side from tablet up ── */
.watermark-layout { display: flex; flex-direction: column; gap: var(--space-6); }
.watermark-layout__controls { display: flex; flex-direction: column; gap: var(--space-6); }
@media (min-width: 768px) {
  .watermark-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .watermark-layout__preview { position: sticky; top: var(--space-4); }
}

.watermark-controls { display: flex; flex-direction: column; gap: var(--space-4); }
.watermark-control { display: flex; flex-direction: column; gap: var(--space-2); }
.watermark-control--row { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-3); }
.watermark-control--row .select { width: auto; flex: 1; }
.watermark-control__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}
.watermark-control__label output { color: var(--color-text); font-weight: var(--font-semibold); }

.watermark-control input[type="range"] { width: 100%; accent-color: var(--color-primary-500); }

.watermark-control input[type="color"] {
  flex: none;
  width: 44px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}
.watermark-control input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.watermark-control input[type="color"]::-webkit-color-swatch { border: none; border-radius: 2px; }

/* ── Live preview ── */
.watermark-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 0.77; /* approximates an A4/Letter page */
  overflow: hidden;
  background:
    repeating-linear-gradient(var(--color-surface-alt) 0 24px, color-mix(in srgb, var(--color-border) 40%, transparent) 24px 25px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.watermark-preview__text {
  display: inline-block;
  max-width: 90%;
  font-weight: var(--font-bold);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  will-change: transform;
}

.options-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.options-note svg { flex: none; width: 14px; height: 14px; margin-top: 1px; color: var(--color-text-muted); }

.options-actions { display: flex; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.options-actions .btn--primary { flex: 1; }
