/* pdf-to-jpg-converter-specific styles.
 * Base chrome (variables, .pane, .btn, .actions, .status, .footer) is provided by /_chrome.css.
 * Mirrors image-cropper's dropzone/opt-group pattern for a consistent product line.
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout {
  display: grid;
  gap: 16px;
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.4fr);
  }
}

.pane {
  background: var(--bg-pane);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pane-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--fg-mute);
  text-transform: uppercase;
}

/* ----- Ad slots -------------------------------------------------------- */

.ad-slot {
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--fg-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.ad-label {
  opacity: 0.55;
}

.ad-inline {
  min-height: 250px;
  margin-top: 4px;
}

/* ----- Drop-zone --------------------------------------------------------- */

.dropzone {
  position: relative;
  display: block;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  background: var(--bg-elev);
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.drop-hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev));
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.drop-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.drop-title {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.drop-sub {
  margin: 0;
  font-size: 12px;
  color: var(--fg-mute);
}

/* ----- Controls ----------------------------------------------------------- */

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  border: none;
  margin: 0;
  padding: 0;
}

.controls:disabled {
  opacity: 0.55;
}

.opt-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-label {
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.ratio-row,
.format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ratio {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  background: var(--bg-elev);
  transition: border-color 100ms ease, background 100ms ease, color 100ms ease;
}

.ratio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.ratio:hover {
  border-color: var(--accent);
}

.ratio:has(input:checked) {
  border-color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 20%, var(--bg-elev));
  color: var(--fg);
}

.opt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-mute);
}

.opt > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.opt output {
  font-family: var(--mono);
  color: var(--fg);
  font-weight: 600;
}

.opt-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.opt-inline input[type="text"] {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.opt-quality input[type="range"] {
  width: 100%;
  accent-color: var(--accent-strong);
}

.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.privacy {
  margin: 0;
  font-size: 12px;
  color: var(--fg-mute);
  padding: 8px 10px;
  background: var(--bg-elev);
  border-left: 3px solid var(--ok);
  border-radius: 4px;
}

.privacy code {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ----- Page grid ----------------------------------------------------------- */

.page-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
}

.page-grid:empty {
  display: none;
}

.page-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-thumb-link {
  display: block;
  line-height: 0;
  background: #000;
  border-bottom: 1px solid var(--border);
}

.page-thumb-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #1a1f2e;
}

.page-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
}

.page-name {
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.page-dims {
  font-size: 10px;
  color: var(--fg-mute);
}
