/* pdf-diff-checker.css */

.pdf-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}
@media (max-width: 680px) {
  .pdf-upload-grid { grid-template-columns: 1fr; }
}

.pdf-upload-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdf-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.pdf-upload-zone:hover,
.pdf-upload-zone.drag-over {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.04);
}

.pdf-upload-zone.file-loaded {
  border-color: #16a34a;
  background: rgba(34, 197, 94, 0.05);
}

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

.pdf-upload-icon { font-size: 2rem; margin-bottom: 0.35rem; }

.pdf-upload-zone p {
  margin: 0.15rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pdf-hint {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}

.pdf-file-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

/* Stats */
.diff-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.diff-stat {
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-added    { background: rgba(34, 197, 94, 0.15); color: #16a34a; border: 1px solid rgba(34, 197, 94, 0.3); }
.stat-removed  { background: rgba(239, 68, 68, 0.15); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.stat-unchanged { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border-color); }

/* Legend */
.pdf-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.legend-dot.added     { background: rgba(34, 197, 94, 0.5); }
.legend-dot.removed   { background: rgba(239, 68, 68, 0.5); }
.legend-dot.unchanged { background: var(--border-color); }

/* View toggle */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.view-btn {
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* Diff output */
.diff-output {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.diff-line {
  display: flex;
  align-items: flex-start;
}

.diff-line-num {
  min-width: 44px;
  padding: 0.25rem 0.5rem;
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
}

.diff-line-content {
  padding: 0.25rem 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.diff-line.added   { background: rgba(34, 197, 94, 0.12); }
.diff-line.removed { background: rgba(239, 68, 68, 0.12); }

.diff-line.added   .diff-line-num { background: rgba(34, 197, 94, 0.2); }
.diff-line.removed .diff-line-num { background: rgba(239, 68, 68, 0.2); }

.diff-line.removed .diff-line-content { text-decoration: line-through; opacity: 0.7; }

.diff-prefix { font-weight: 700; margin-right: 0.35rem; }
.diff-line.added   .diff-prefix { color: #16a34a; }
.diff-line.removed .diff-prefix { color: #dc2626; }
.diff-line.unchanged .diff-prefix { color: var(--text-muted); }

/* Side-by-side */
.diff-output.side-by-side { display: block; }

.sbs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border-color);
}

.sbs-cell {
  display: flex;
  align-items: stretch;
  min-height: 2rem;
  border-right: 1px solid var(--border-color);
}

.sbs-cell:last-child { border-right: none; }
.sbs-cell .diff-line-num { min-width: 48px; }
.sbs-cell .diff-line-content { padding: 0.3rem 0.65rem; }
.sbs-cell.added   { background: rgba(34, 197, 94, 0.12); }
.sbs-cell.removed { background: rgba(239, 68, 68, 0.12); }
.sbs-cell.changed { background: rgba(250, 204, 21, 0.1); }
.sbs-cell.empty .diff-line-content { color: var(--text-muted); opacity: 0.6; font-style: italic; }

@media (max-width: 820px) {
  .sbs-row { grid-template-columns: 1fr; }
  .sbs-cell { border-right: none; border-bottom: 1px solid var(--border-color); }
  .sbs-cell:last-child { border-bottom: none; }
}
