/* ═══════════════════════════════════════════════
   Malzime — AI Stalker Aesthetic
   ═══════════════════════════════════════════════ */

:root {
  --bg:       #0a0c10;
  --surface:  #111318;
  --card:     #161921;
  --border:   #1e222d;
  --text:     #c8cdd8;
  --text-hi:  #e8ecf4;
  --muted:    #6b7280;
  --accent:   #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.10);
  --warn:     #f87171;
  --warn-dim: rgba(248, 113, 113, 0.10);
  --boost:    #a78bfa;
  --boost-dim: rgba(167, 139, 250, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-font-smoothing: antialiased; }

body {
  font-family: "Inter", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

/* ── Scan-Line Overlay ── */

.scan-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(56, 189, 248, 0.012) 2px,
      rgba(56, 189, 248, 0.012) 4px
    );
}

/* ── Container ── */

.container {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ── Hero ── */

.hero { margin-bottom: 32px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 10px;
  background: var(--accent-dim);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 100px;
  margin-bottom: 18px;
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.badge-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
}

h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.2;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ── Upload ── */

.upload-section { margin-bottom: 20px; }

.file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  padding: 32px 20px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.file-drop input { display: none; }

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.drop-icon {
  width: 28px; height: 28px;
  color: var(--muted);
  margin-bottom: 2px;
}

.file-drop:hover .drop-icon { color: var(--accent); }

.drop-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-hi);
}

.drop-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.image-preview {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
}

.image-preview:empty { display: none; }

.image-preview img {
  width: 50%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
  margin: 0 auto;
}

/* ── Bias Toggle ── */

.bias-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.bias-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.bias-opt {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.2s;
  user-select: none;
}

.bias-opt.boost {
  color: var(--muted);
}

/* Active states based on checkbox */
#biasSwitch:not(:checked) ~ .bias-toggle .bias-opt[data-mode="normal"],
.bias-toggle:has(#biasSwitch:not(:checked)) .bias-opt[data-mode="normal"] {
  color: var(--accent);
}

.bias-toggle:has(#biasSwitch:checked) .bias-opt[data-mode="boost"] {
  color: var(--boost);
}

.toggle-switch {
  position: relative;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.25);
  position: relative;
  transition: background 0.25s, border-color 0.25s;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.25s, background 0.25s;
}

#biasSwitch:checked + .toggle-track {
  background: var(--boost-dim);
  border-color: rgba(167, 139, 250, 0.35);
}

#biasSwitch:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
  background: var(--boost);
}

/* ── Scan-Animation ── */

.scan-anim {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 20px;
  margin-bottom: 24px;
}

.scan-anim.active { display: flex; }

.scan-eye {
  width: 64px;
  height: 64px;
  color: var(--accent);
  animation: eyePulse 2.5s ease-in-out infinite;
}

.scan-eye svg { width: 100%; height: 100%; }

@keyframes eyePulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

.scan-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-align: center;
  min-height: 1.2em;
  animation: textFade 1.8s ease-in-out infinite;
}

@keyframes textFade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.scan-bar {
  width: 200px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.scan-fill {
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 2px;
  animation: scanSlide 1.5s ease-in-out infinite;
}

@keyframes scanSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ── Status ── */

.status {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: 18px;
  display: none;
}

.status.visible { display: block; }

/* ── Narrative ── */

.narrative {
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 500;
  color: var(--text-hi);
  padding: 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  margin-bottom: 24px;
  animation: fadeUp 0.4s ease;
}

.narrative:empty { display: none; }

/* ── Kategorie-Karten (einspaltig) ── */

.facts-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.facts-grid:empty { display: none; }

.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  animation: fadeUp 0.35s ease both;
  transition: border-color 0.2s;
}

.cat-card:hover { border-color: rgba(56, 189, 248, 0.25); }

.cat-card:nth-child(1)  { animation-delay: 0.03s; }
.cat-card:nth-child(2)  { animation-delay: 0.06s; }
.cat-card:nth-child(3)  { animation-delay: 0.09s; }
.cat-card:nth-child(4)  { animation-delay: 0.12s; }
.cat-card:nth-child(5)  { animation-delay: 0.15s; }
.cat-card:nth-child(6)  { animation-delay: 0.18s; }
.cat-card:nth-child(7)  { animation-delay: 0.21s; }
.cat-card:nth-child(8)  { animation-delay: 0.24s; }
.cat-card:nth-child(9)  { animation-delay: 0.27s; }
.cat-card:nth-child(10) { animation-delay: 0.30s; }
.cat-card:nth-child(11) { animation-delay: 0.33s; }

.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.cat-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.cat-conf {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 6px;
}

.cat-conf.high { background: var(--warn-dim); color: var(--warn); }
.cat-conf.med  { background: rgba(251, 191, 36, 0.10); color: #fbbf24; }
.cat-conf.low  { background: rgba(107, 114, 128, 0.12); color: var(--muted); }

.cat-value {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 8px;
}

.conf-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
  overflow: hidden;
}

.conf-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.conf-bar.high { background: var(--warn); }
.conf-bar.med  { background: #fbbf24; }
.conf-bar.low  { background: var(--muted); }

/* ── Privacy / EXIF (einspaltig) ── */

.privacy-grid { margin-bottom: 16px; }
.privacy-grid:empty { display: none; }

.privacy-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.meta-card h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.meta-card.warn { border-color: rgba(248, 113, 113, 0.2); }
.meta-card.warn h3 { color: var(--warn); }

.meta-card ul {
  padding-left: 16px;
  color: var(--warn);
  font-size: 0.88rem;
  line-height: 1.6;
}

.meta-table {
  width: 100%;
  font-size: 0.85rem;
  border-collapse: collapse;
}

.meta-table td {
  padding: 3px 0;
  color: var(--text);
}

.meta-table td:first-child {
  color: var(--muted);
  padding-right: 12px;
  white-space: nowrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
}

/* ── GPS-Karte ── */

.gps-map { margin-bottom: 16px; }
.gps-map:empty { display: none; }

.map-wrapper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.map-wrapper h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warn);
  margin-bottom: 12px;
}

.gps-address {
  font-size: 0.9rem;
  color: var(--warn);
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--warn-dim);
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.15);
  line-height: 1.5;
}

#gpsMapLeaflet {
  height: 240px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Targeting (einspaltig) ── */

.targeting-grid { margin-bottom: 16px; }
.targeting-grid:empty { display: none; }

.target-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.5s ease;
}

.target-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.target-card h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}

.target-card.warn h3 { color: var(--warn); }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.trigger-list {
  padding-left: 16px;
  font-size: 0.88rem;
  color: var(--warn);
  line-height: 1.6;
}

.trigger-list li { margin-bottom: 4px; }

/* ── Profil-Verdict ── */

.simulation { margin-bottom: 20px; }
.simulation:empty { display: none; }

.verdict {
  background: linear-gradient(135deg, #16111c 0%, #12101a 100%);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 14px;
  padding: 22px;
  animation: fadeUp 0.5s ease;
}

.verdict-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.verdict-icon {
  width: 18px; height: 18px;
  color: var(--warn);
  flex-shrink: 0;
}

.verdict-head h3 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warn);
}

.verdict-text {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-hi);
}

/* ── Disclaimer ── */

.disclaimer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.disclaimer p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Animationen ── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .container { padding: 24px 16px 48px; }
  h1 { font-size: 1.4rem; }
  .file-drop { padding: 24px 16px; }
  .narrative { padding: 14px; font-size: 0.92rem; }
  .verdict { padding: 16px; }
  .bias-toggle { padding: 6px 14px; gap: 10px; }
}
