/* ==========================================================================
   PDF Monster - DSGVO Auto-Schwärzung Tool CSS
   Client-Side PDF.js Viewer + Findings Sidebar
   ========================================================================== */

/* PDF Viewer Container */
.autoredact-pdf-viewer {
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-tertiary, #f0f0f0);
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3, 12px);
}

.autoredact-pdf-page {
  position: relative;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  flex-shrink: 0;
}

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

.autoredact-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.autoredact-page-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary, #666);
  font-weight: 500;
  margin-top: 6px;
}

/* Redaction Rectangles (Vorschau über PDF) */
.autoredact-rect {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 60, 60, 0.9);
  border-radius: 2px;
  pointer-events: auto;
  cursor: help;
  transition: outline 0.15s ease;
}
.autoredact-rect.cat-name      { border-color: #ef4444; }
.autoredact-rect.cat-iban      { border-color: #f97316; }
.autoredact-rect.cat-email     { border-color: #eab308; }
.autoredact-rect.cat-phone     { border-color: #3b82f6; }
.autoredact-rect.cat-address   { border-color: #8b5cf6; }
.autoredact-rect.cat-date      { border-color: #14b8a6; }
.autoredact-rect.cat-taxid     { border-color: #ec4899; }
.autoredact-rect:hover {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* Scanning Indicator */
.autoredact-scanning {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--text-secondary, #555);
  font-size: 14px;
}

/* Bulk Actions */
.autoredact-bulk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

/* Category Filter */
.autoredact-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-tertiary, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  user-select: none;
  transition: background 0.15s ease;
}
.category-toggle:hover { background: #e2e8f0; }
.category-toggle input { margin: 0; cursor: pointer; }
.category-name input:checked + *,
.category-toggle.category-name    { border-left: 3px solid #ef4444; }
.category-toggle.category-iban    { border-left: 3px solid #f97316; }
.category-toggle.category-email   { border-left: 3px solid #eab308; }
.category-toggle.category-phone   { border-left: 3px solid #3b82f6; }
.category-toggle.category-address { border-left: 3px solid #8b5cf6; }
.category-toggle.category-date    { border-left: 3px solid #14b8a6; }
.category-toggle.category-taxid   { border-left: 3px solid #ec4899; }

/* Findings Badge im Header */
.findings-badge {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

/* Findings List */
.autoredact-findings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.autoredact-finding-card {
  border: 1px solid var(--border-color, #e2e8f0);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.autoredact-finding-card.is-rejected {
  opacity: 0.55;
  background: #f8fafc;
}
.autoredact-finding-card.cat-name    { border-left-color: #ef4444; }
.autoredact-finding-card.cat-iban    { border-left-color: #f97316; }
.autoredact-finding-card.cat-email   { border-left-color: #eab308; }
.autoredact-finding-card.cat-phone   { border-left-color: #3b82f6; }
.autoredact-finding-card.cat-address { border-left-color: #8b5cf6; }
.autoredact-finding-card.cat-date    { border-left-color: #14b8a6; }
.autoredact-finding-card.cat-taxid   { border-left-color: #ec4899; }

.finding-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.finding-num { font-weight: 600; }
.finding-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}
.cat-badge-name    { background: #ef4444; }
.cat-badge-iban    { background: #f97316; }
.cat-badge-email   { background: #eab308; color: #422006; }
.cat-badge-phone   { background: #3b82f6; }
.cat-badge-address { background: #8b5cf6; }
.cat-badge-date    { background: #14b8a6; }
.cat-badge-taxid   { background: #ec4899; }

.finding-page {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
}

.finding-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--text-primary, #1e293b);
  background: #f8fafc;
  border-radius: 4px;
  padding: 6px 8px;
  word-break: break-all;
  margin-bottom: 6px;
}

.finding-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary, #475569);
}
.finding-toggle input { margin: 0; cursor: pointer; }

/* Result Stats */
.result-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}
.stat-block strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}
.stat-block span {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Drag-Over State */
.upload-card.drag-over {
  border-color: var(--color-primary, #3b82f6);
  background: rgba(59, 130, 246, 0.06);
}

/* Mobile */
@media (max-width: 1024px) {
  .autoredact-pdf-viewer { max-height: 55vh; }
  .autoredact-findings-list { max-height: 40vh; }
  .autoredact-bulk-actions { grid-template-columns: 1fr; }
}
