/* pdf.css — styles for the PDF export modal (T7) + its responsive/a11y rules (T11).
   Scoped entirely under #pdfExportModal / .pdf-export-trigger so it cannot affect any
   other part of the page. Reuses .history-modal / .history-modal-content as the base
   (dark modal chrome), see styles.css. */

.pdf-export-trigger {
  width: auto;
  padding: 0 18px;
}

/* ----- Modal shell ----- */
.pdf-modal-content {
  width: 92%;
  max-width: 760px;
  max-height: 90vh;
}

.pdf-modal-body {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.pdf-modal-col {
  min-width: 0;
}

.pdf-modal-controls {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pdf-modal-preview {
  flex: 1 1 45%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.pdf-modal-footer {
  gap: 10px;
}

.pdf-modal-footer .secondary-btn {
  width: auto;
  padding: 10px 20px;
}

/* ----- Fieldsets / radios ----- */
.pdf-fieldset {
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
}

.pdf-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b949e;
}

.pdf-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 12px 4px 0;
  min-height: 44px;
  color: #ffffff;
  font-weight: 400;
  cursor: pointer;
}

.pdf-radio-label input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--rf-accent, #22c55e);
}

.pdf-section-title {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b949e;
}

/* ----- History selection list ----- */
.pdf-history-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdf-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.pdf-history-empty {
  color: #8b949e;
  font-size: 13px;
  padding: 10px 0;
}

.pdf-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px;
  background-color: #24292e;
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
  font-weight: 400;
}

.pdf-history-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pdf-history-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  accent-color: var(--rf-accent, #22c55e);
}

.pdf-history-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background-color: #ffffff;
  object-fit: contain;
  padding: 2px;
  flex-shrink: 0;
}

.pdf-history-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

/* ----- Captions ----- */
.pdf-captions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-caption-group label {
  color: #ffffff;
  font-size: 13px;
  margin-bottom: 4px;
}

.pdf-caption-group input {
  background-color: #24292e;
  border: 1px solid #30363d;
  color: #ffffff;
}

.pdf-caption-group input:focus {
  border-color: var(--rf-accent, #22c55e);
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.25);
}

.pdf-modal-content .field-error {
  color: #f85149;
}

.pdf-modal-content .field-hint {
  color: #8b949e;
}

/* ----- Preview canvas ----- */
.pdf-preview-wrap {
  width: 100%;
  max-width: 320px;
  display: flex;
  justify-content: center;
}

#pdfPreviewCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ----- Responsive (T11): reuse the project's existing 480px breakpoint ----- */
@media (max-width: 480px) {
  .pdf-modal-content {
    width: 95%;
    max-height: 92vh;
  }

  .pdf-modal-body {
    flex-direction: column-reverse;
    gap: 16px;
    padding: 12px 14px;
  }

  .pdf-modal-preview {
    flex: none;
  }

  .pdf-preview-wrap {
    max-width: 220px;
  }

  .pdf-modal-footer {
    flex-wrap: wrap;
  }

  .pdf-modal-footer .secondary-btn {
    flex: 1 1 auto;
  }
}

/* Printed QR size control */
.pdf-size-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.pdf-size-input {
  width: 100px;
  min-height: 44px;
  padding: 6px 10px;
  box-sizing: border-box;
}
