/* ============================================================
   Image to PDF — controls.css
   Step 2: PDF build settings — page size, orientation, image fit,
   margin, quality, page numbers, watermark
   ============================================================ */


/* ══════════════════════════════════════════
   1. CONTROLS WRAPPER
   ══════════════════════════════════════════ */
.ip-img2pdf-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 26px 0 4px;
  padding-top: 20px;
  border-top: 1.5px solid var(--ip-line);
}

.ip-img2pdf-controls__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-img2pdf-controls__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ip-ink);
}

/* Toggle rows (page numbers / watermark) sit label-left, switch-right */
.ip-img2pdf-controls__row--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}


/* ══════════════════════════════════════════
   2. SEGMENTED CONTROLS (shared look)
   Page size / Orientation / Image fit / Margin / Quality all use
   the same pill-segmented pattern, just different column counts —
   grouped here instead of duplicated per component.
   ══════════════════════════════════════════ */
.ip-img2pdf-pagesize,
.ip-img2pdf-orientation,
.ip-img2pdf-fitmode,
.ip-img2pdf-margin,
.ip-img2pdf-quality {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ip-img2pdf-orientation,
.ip-img2pdf-fitmode,
.ip-img2pdf-margin {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.ip-img2pdf-quality {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.ip-img2pdf-pagesize__btn,
.ip-img2pdf-orientation__btn,
.ip-img2pdf-fitmode__btn,
.ip-img2pdf-margin__btn,
.ip-img2pdf-quality__btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--ip-line);
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ip-ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ip-img2pdf-pagesize__btn.is-active,
.ip-img2pdf-orientation__btn.is-active,
.ip-img2pdf-fitmode__btn.is-active,
.ip-img2pdf-margin__btn.is-active,
.ip-img2pdf-quality__btn.is-active {
  border-color: var(--ip-brand);
  color: var(--ip-brand-dark);
  background: var(--ip-brand-soft);
}

/* Page-size row wraps onto two lines on narrow screens — each pill
   grows to fill available width rather than staying tiny */
.ip-img2pdf-pagesize__btn {
  flex: 1 1 auto;
  text-align: center;
}


/* ══════════════════════════════════════════
   3. CUSTOM PAGE SIZE INPUTS (shown only when "Custom" selected)
   ══════════════════════════════════════════ */
.ip-img2pdf-customsize {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ip-img2pdf-customsize input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ip-line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ip-ink);
  min-width: 0;
}

.ip-img2pdf-customsize input:focus-visible {
  outline: none;
  border-color: var(--ip-brand);
  box-shadow: 0 0 0 4px var(--ip-brand-soft);
}

.ip-img2pdf-customsize span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ip-ink-soft);
  flex-shrink: 0;
}

.ip-img2pdf-customsize[hidden] {
  display: none;
}


/* ══════════════════════════════════════════
   4. WATERMARK BOX (shown only when watermark toggle is on)
   ══════════════════════════════════════════ */
.ip-img2pdf-watermark-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: -6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--ip-bg);
  animation: ipCardIn 0.2s ease both;
}

.ip-img2pdf-watermark-box[hidden] {
  display: none;
}

.ip-img2pdf-watermark-box input[type="text"] {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ip-line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ip-ink);
}

.ip-img2pdf-watermark-box input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--ip-brand);
  box-shadow: 0 0 0 4px var(--ip-brand-soft);
}

.ip-img2pdf-watermark-box__row {
  display: flex;
  align-items: center;
}

.ip-img2pdf-watermark-box__row label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ip-ink-soft);
}

.ip-img2pdf-watermark-box__row input[type="range"] {
  flex: 1;
  accent-color: var(--ip-brand);
  height: 4px;
  cursor: pointer;
}


/* ══════════════════════════════════════════
   5. GENERIC OPTION BOX
   Shared shell for the file-name / password / compress panels —
   same footprint as the watermark box, just without its specific
   row layout so each can hold different controls.
   ══════════════════════════════════════════ */
.ip-img2pdf-optionbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -6px;
  padding: 14px;
  border-radius: 14px;
  background: var(--ip-bg);
  animation: ipCardIn 0.2s ease both;
}

.ip-img2pdf-optionbox[hidden] {
  display: none;
}

.ip-img2pdf-optionbox input[type="text"],
.ip-img2pdf-optionbox input[type="password"] {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ip-line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ip-ink);
  width: 100%;
}

.ip-img2pdf-optionbox input:focus-visible {
  outline: none;
  border-color: var(--ip-brand);
  box-shadow: 0 0 0 4px var(--ip-brand-soft);
}

.ip-img2pdf-optionbox__hint {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ip-ink-soft);
}


/* ══════════════════════════════════════════
   6. PASSWORD FIELD — text input + show/hide eye button
   ══════════════════════════════════════════ */
.ip-img2pdf-passfield {
  position: relative;
  display: flex;
}

.ip-img2pdf-passfield input {
  padding-right: 46px !important;
}

.ip-img2pdf-passfield__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ip-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ip-img2pdf-passfield__toggle svg {
  width: 19px;
  height: 19px;
}

.ip-img2pdf-passfield__toggle.is-visible {
  color: var(--ip-brand-dark);
}

.ip-img2pdf-passfield__toggle:active {
  background: var(--ip-line);
}


/* ══════════════════════════════════════════
   7. COMPRESSION LEVEL PILLS — same segmented look as row 2
   ══════════════════════════════════════════ */
.ip-img2pdf-compresslevel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ip-img2pdf-compresslevel__btn {
  height: 40px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1.5px solid var(--ip-line-strong);
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ip-ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ip-img2pdf-compresslevel__btn.is-active {
  border-color: var(--ip-brand);
  color: var(--ip-brand-dark);
  background: var(--ip-brand-soft);
}


/* ══════════════════════════════════════════
   8. ALERT BANNER — used under the compress toggle
   ══════════════════════════════════════════ */
.ip-img2pdf-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--ip-warn-soft);
  color: var(--ip-warn);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.ip-img2pdf-alert svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}


/* ══════════════════════════════════════════
   9. DESKTOP ENHANCEMENTS (≥768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .ip-img2pdf-pagesize__btn:hover,
  .ip-img2pdf-orientation__btn:hover,
  .ip-img2pdf-fitmode__btn:hover,
  .ip-img2pdf-margin__btn:hover,
  .ip-img2pdf-quality__btn:hover,
  .ip-img2pdf-compresslevel__btn:hover {
    border-color: var(--ip-brand);
    color: var(--ip-brand);
  }

  .ip-img2pdf-passfield__toggle:hover {
    background: var(--ip-line);
  }

  .ip-img2pdf-controls {
    gap: 22px;
  }
}
