/* PurifyDocs — static frontend styles */

:root {
  --green: #2E8B57;
  --green-dark: #1a5c3a;
  --green-light: #e8f5ee;
  --red: #b71c1c;
  --red-light: #ffebee;
  --yellow: #f9a825;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--text);
}
nav { display: flex; gap: 24px; }
nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s;
}
nav a:hover { color: var(--green); }

/* Hero */
.hero {
  text-align: center;
  padding: 64px 0 48px;
}
.hero h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.3;
  max-width: 720px;
  margin: 0 auto 20px;
}
.subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 32px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--green);
  color: white;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  background: white;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-small:hover { border-color: var(--green); color: var(--green); }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 24px;
  margin-bottom: 8px;
}
.card h3 {
  font-size: 18px;
  margin: 24px 0 12px;
}
.card p { margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.feature h3 {
  color: var(--green);
  font-size: 16px;
  margin: 0 0 8px;
}
.feature p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
  margin: 24px 0;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--green);
  background: var(--green-light);
}
.drop-zone-content p { margin: 8px 0; }

/* Loading */
.scan-loading {
  text-align: center;
  padding: 48px 0;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.scan-error {
  background: var(--red-light);
  color: var(--red);
  padding: 16px 24px;
  border-radius: 8px;
  margin: 16px 0;
}

/* Results */
.result-summary {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.result-filename {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 12px;
}
.result-metrics {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.metric {
  display: flex;
  flex-direction: column;
}
.metric label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.metric .value { font-size: 20px; font-weight: 700; }
.value-ok { color: var(--green); }
.value-warn { color: var(--red); }

.banner {
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}
.banner-ok { background: var(--green-light); color: var(--green-dark); }
.banner-warn { background: var(--red-light); color: var(--red); }

.sha-box {
  font-size: 13px;
  margin-bottom: 16px;
  word-break: break-all;
}
.sha-box code { font-size: 12px; }

.download-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.issue-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.issue-item summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
}
.issue-item summary:hover { background: var(--bg); }
.issue-detail {
  padding: 0 16px 16px;
}
.issue-detail p { margin: 4px 0; font-size: 14px; }
.evidence {
  background: var(--bg);
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin-top: 8px;
}

.text-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.text-col h4 { font-size: 14px; margin-bottom: 8px; color: var(--muted); }
.text-box {
  height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font-family: monospace;
  font-size: 13px;
  white-space: pre-wrap;
  background: white;
}
.hidden-line {
  background: var(--red-light);
  color: var(--red);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}
.info-box {
  background: #e3f2fd;
  color: #1565c0;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.safe-text-area {
  width: 100%;
  height: 200px;
  font-family: monospace;
  font-size: 13px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}
.metadata-box {
  background: var(--bg);
  padding: 16px;
  border-radius: 6px;
  font-size: 13px;
  overflow-x: auto;
}

/* Detector tabs */
.detector-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.detector-table {
  width: 100%;
  border-collapse: collapse;
}
.detector-table th, .detector-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.detector-table th { background: var(--bg); }
.detector-table code { font-size: 12px; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  .hero h1 { font-size: 28px; }
  .text-compare { grid-template-columns: 1fr; }
  .result-metrics { gap: 16px; }
}
