@import '../main.css';

.pdf-main {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.pdf-panel-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

.pdf-result-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
}

.pdf-result-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.pdf-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  word-break: break-all;
}

.pdf-result-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
}

.pdf-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ── Tool type grid (mirrors qr-type-grid) ───────────────────────────────── */

.qr-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

@media (min-width: 560px) {
  .qr-type-grid { grid-template-columns: repeat(7, 1fr); }
}

.qr-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  background: var(--color-bg);
  border: none;
  border-right: var(--border);
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.qr-type-card:last-child { border-right: none; }

@media (max-width: 559px) {
  .qr-type-card:nth-child(4n) { border-right: none; }
  .qr-type-card:nth-child(n+5) { border-top: var(--border); }
  .qr-type-card:nth-child(4n+1):nth-last-child(-n+3),
  .qr-type-card:nth-child(4n+1):nth-last-child(-n+3) ~ .qr-type-card {
    border-top: var(--border);
  }
}

.qr-type-card:hover { background: var(--color-surface); }

.qr-type-card.is-active {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
}

.qr-type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.qr-type-card.is-active .qr-type-icon {
  color: var(--color-primary);
}

.qr-type-name {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

@media (min-width: 560px) {
  .qr-type-name {
    font-size: 0.75rem;
  }
}

.qr-type-card.is-active .qr-type-name {
  color: var(--color-primary);
  font-weight: 600;
}

/* ── qr-box, qr-main, qr-input-col, qr-preview-col ─────────────────────── */

.qr-box {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.qr-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.qr-input-col {
  flex: 1;
  padding: 20px;
  min-width: 0;
}

.qr-preview-col {
  padding: 20px;
  border-top: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

@media (min-width: 720px) {
  .qr-main {
    flex-direction: row;
  }

  .qr-input-col {
    padding: 24px;
    border-right: var(--border);
  }

  .qr-preview-col {
    width: 260px;
    flex-shrink: 0;
    padding: 24px;
    border-top: none;
    min-height: unset;
  }
}

.qr-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.qr-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qr-input {
  width: 100%;
  padding: 10px 12px;
  border: var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s;
}

.qr-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.qr-error {
  color: var(--color-danger, #dc2626);
  font-size: 0.875rem;
  margin-top: 8px;
  min-height: 1.2em;
}


.faq-section { background-color: var(--color-bg); }
.faq-list { max-width: 640px; margin-inline: auto; display: flex; flex-direction: column; gap: 0; border: var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.faq-item { border-bottom: var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--color-text); padding: var(--space-5) var(--space-6); cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); transition: background-color var(--transition-fast); }
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; font-size: var(--text-xl); color: var(--color-muted); flex-shrink: 0; transition: transform var(--transition-fast); }
.faq-item[open] .faq-question::after { transform: rotate(45deg); }
.faq-item[open] .faq-question { background-color: var(--color-surface); color: var(--color-primary); }
.faq-answer { font-size: var(--text-sm); line-height: var(--leading-loose); color: var(--color-text-dim); padding: 0 var(--space-6) var(--space-5); margin: 0; }


/* ── Drop zone ───────────────────────────────────────────────────────────── */

.pdf-drop {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  margin-bottom: 16px;
}

@media (min-width: 560px) {
  .pdf-drop {
    padding: 32px 20px;
  }
}

.pdf-drop.is-over {
  border-color: var(--color-primary);
  background: rgba(7, 126, 89, 0.04);
}

.pdf-drop-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.pdf-drop-icon {
  color: var(--color-text-muted);
  opacity: 0.4;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-drop-label {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}

.pdf-drop-link {
  color: var(--color-primary);
  text-decoration: underline;
  cursor: pointer;
}

.pdf-drop-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ── Selected file chip ──────────────────────────────────────────────────── */

.pdf-file-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--color-bg);
  color: var(--color-primary);
}

.pdf-file-selected-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-file-selected-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  white-space: nowrap;
  font-family: inherit;
}

.pdf-file-selected-clear:hover {
  color: var(--color-text);
}

/* ── Merge file list ─────────────────────────────────────────────────────── */

.pdf-file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.pdf-file-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--color-bg);
  font-size: 0.875rem;
}

.pdf-file-list-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}

.pdf-file-list-item-size {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

.pdf-file-list-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--color-text-muted);
  line-height: 1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  font-family: inherit;
}

.pdf-file-list-remove:hover {
  color: #dc2626;
}

/* ── Page range row (split) ──────────────────────────────────────────────── */

.pdf-range-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.pdf-range-row .pdf-field {
  flex: 1;
}

/* ── Angle buttons (rotate) ──────────────────────────────────────────────── */

.pdf-angle-group {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.pdf-angle-btn {
  flex: 1;
  padding: 9px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}

.pdf-angle-btn.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */

.pdf-progress {
  margin-bottom: 12px;
}

.pdf-progress-bar-wrap {
  height: 6px;
  background: var(--color-border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pdf-progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 99px;
  width: 0%;
  transition: width 0.2s;
}

.pdf-progress-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ── Field spacing ───────────────────────────────────────────────────────── */

.pdf-field {
  margin-bottom: 16px;
}

.pdf-panel-desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}


.qr-type-card[data-soon="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  position: relative;
}

.qr-type-card[data-soon="true"] .qr-type-name::after {
  content: ' (soon)';
  font-size: 0.6rem;
  opacity: 0.8;
}

/* ── Drag and drop (merge) ───────────────────────────────────────────────── */

.pdf-drag-handle {
  color: var(--color-text-muted);
  opacity: 0.4;
  cursor: grab;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.pdf-drag-handle:active {
  cursor: grabbing;
}

.pdf-file-list-item {
  cursor: default;
  transition: background 0.1s, opacity 0.1s;
}

.pdf-file-list-item.is-dragging {
  opacity: 0.4;
}

.pdf-file-list-item.drag-over {
  border-color: var(--color-primary);
  background: rgba(7, 126, 89, 0.04);
}

.pdf-drag-hint {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin: -8px 0 12px;
  opacity: 0.7;
}

/* ── Page tiles (reorder) ────────────────────────────────────────────────── */

.pdf-page-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pdf-page-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  cursor: grab;
  width: 90px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
  user-select: none;
}

.pdf-page-tile-preview {
  width: 70px;
  height: 90px;
  background: #f8f8f8;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-page-tile-preview canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.pdf-page-tile:active {
  cursor: grabbing;
}

.pdf-page-tile.is-dragging {
  opacity: 0.35;
}

.pdf-page-tile.drag-over {
  border-color: var(--color-primary);
  background: rgba(7, 126, 89, 0.05);
}

.pdf-page-tile-handle {
  color: var(--color-text-muted);
  opacity: 0.35;
}

.pdf-page-tile-num {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

@media (hover: none) and (pointer: coarse) {
  .pdf-page-tile-handle,
  .pdf-drag-handle {
    opacity: 0.7;
  }

  .pdf-page-tile,
  .pdf-file-list-item {
    touch-action: none;
  }
}

/* ── Rotate tile selection ───────────────────────────────────────────────── */

.pdf-rotate-tile {
  cursor: pointer;
  position: relative;
}

.pdf-rotate-tile.is-selected {
  border-color: var(--color-primary);
  background: rgba(7, 126, 89, 0.05);
}

.pdf-rotate-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 4px;
}

.pdf-rotate-tile-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pdf-rotate-tile.is-selected .pdf-rotate-tile-check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.pdf-rotate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pdf-rotate-select-row {
  display: flex;
  gap: 6px;
}

.pdf-select-btn {
  font-size: 0.8125rem;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.pdf-select-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ── Delete tile marking ─────────────────────────────────────────────────── */

.pdf-delete-tile {
  cursor: pointer;
}

.pdf-delete-tile.is-marked {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.05);
}

.pdf-delete-tile-x {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pdf-delete-tile.is-marked .pdf-delete-tile-x {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}/* ── Delete tile marking ─────────────────────────────────────────────────── */

.pdf-delete-tile {
  cursor: pointer;
}

.pdf-delete-tile.is-marked {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.05);
}

.pdf-delete-tile-x {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pdf-delete-tile.is-marked .pdf-delete-tile-x {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}

/* ── Delete summary bar ──────────────────────────────────────────────────── */

.pdf-delete-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(225, 29, 72, 0.06);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: var(--radius);
  margin-top: 8px;
  gap: 10px;
}

.pdf-delete-summary-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e11d48;
}

.pdf-delete-clear-sel {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.3);
  white-space: nowrap;
}

.pdf-delete-clear-sel:hover {
  border-color: #e11d48;
  color: #e11d48;
}



/* SEO content section */
.seo-content-section {
  border-top: 1px solid var(--color-border, #e4e4e7);
  background: #fff;
}

.seo-content-inner {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: start;
}

@media (max-width: 768px) {
  .seo-content-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.seo-content-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #18181b);
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.seo-content-main h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text, #18181b);
  margin-top: 32px;
  margin-bottom: 12px;
}

.seo-content-main p {
  font-size: 15px;
  line-height: 1.75;
  color: #3f3f46;
  margin-bottom: 16px;
}

.seo-content-main a {
  color: var(--color-primary, #077e59);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.seo-content-main code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 4px;
  padding: 2px 6px;
  color: #18181b;
}

.seo-content-side {
  position: sticky;
  top: 80px;
}

.seo-side-card {
  background: #f4f4f5;
  border-radius: 12px;
  padding: 24px;
}

.seo-side-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #18181b;
  margin-bottom: 16px;
}

.seo-side-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seo-side-list li {
  font-size: 14px;
  color: #3f3f46;
  padding-left: 20px;
  position: relative;
}

.seo-side-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-primary, #077e59);
  font-weight: 700;
}