/* ScrubShot — Private Photo Cleaner
   Mobile-first, dark, trustworthy. No external fonts or assets. */

:root {
  --bg: #0b1220;
  --bg-2: #121c2e;
  --card: #172236;
  --card-2: #1d2b43;
  --ink: #eaf1fb;
  --muted: #93a4bf;
  --accent: #00e0b8;
  --accent-2: #12b3ff;
  --danger: #ff5a6e;
  --danger-bg: #2a1620;
  --safe: #35e08a;
  --line: #24344f;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100%;
}

body { padding-bottom: 120px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-top));
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-tag { color: var(--muted); font-size: 0.8rem; }

/* ---------- Landing ---------- */
.landing {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  transition: background 0.2s;
}
.landing.dragging { background: var(--bg-2); }
.drop-inner { text-align: center; max-width: 460px; width: 100%; }
.hero-shield {
  font-size: 4.2rem;
  filter: drop-shadow(0 8px 24px rgba(0, 224, 184, 0.35));
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.landing h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 18px 0 8px;
  letter-spacing: -0.02em;
}
.sub { color: var(--muted); margin: 0 auto 26px; max-width: 380px; }

.cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121f;
  font-weight: 800;
  font-size: 1.1rem;
  border: none;
  border-radius: 999px;
  padding: 16px 40px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 224, 184, 0.3);
  transition: transform 0.12s, box-shadow 0.12s;
}
.cta:active { transform: translateY(2px) scale(0.98); }
.drop-hint { color: var(--muted); font-size: 0.85rem; margin: 14px 0 0; }

.privacy-banner {
  margin-top: 34px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.privacy-banner strong { color: var(--ink); }

/* ---------- Inspector ---------- */
.inspector { padding: 16px 16px 0; max-width: 720px; margin: 0 auto; }

.preview-wrap {
  background: #05090f;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.preview-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}
.preview-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75));
  color: #dfe8f5;
  font-size: 0.78rem;
  text-align: center;
  padding: 20px 10px 8px;
  pointer-events: none;
}

.panel { margin-top: 16px; }

/* Location reveal card */
.location-card {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.location-card.danger {
  background: var(--danger-bg);
  border-color: rgba(255, 90, 110, 0.5);
  animation: pulseDanger 2s ease-in-out 1;
}
@keyframes pulseDanger { 0%{box-shadow:0 0 0 0 rgba(255,90,110,0.4)} 100%{box-shadow:0 0 0 14px rgba(255,90,110,0)} }
.location-card.safe { background: var(--card); border-color: rgba(53,224,138,0.35); }
.loc-head { font-weight: 700; font-size: 1.02rem; margin-bottom: 6px; }
.location-card.danger .loc-head { color: var(--danger); }
.location-card.safe .loc-head { color: var(--safe); }
.loc-coords {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  margin: 4px 0;
}
.loc-sub { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.loc-map-btn {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
}

/* Risk breakdown */
.risk-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 14px; }
.risk-block h2 { font-size: 0.95rem; color: var(--muted); font-weight: 600; margin: 14px 0 10px; }
.risk-list { display: flex; flex-direction: column; gap: 2px; }
.risk-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.risk-row:first-child { border-top: none; }
.risk-icon { font-size: 1.1rem; }
.risk-label { font-size: 0.92rem; }
.risk-val {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.risk-empty { color: var(--muted); font-size: 0.88rem; padding: 8px 0 12px; }

/* Toggles */
.toggles { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
}
.toggle-text { display: flex; flex-direction: column; }
.toggle-text small { color: var(--muted); font-size: 0.78rem; }
.toggle input { display: none; }
.switch {
  width: 48px; height: 28px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .switch { background: rgba(0,224,184,0.25); border-color: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(20px); background: var(--accent); }

.minor-actions { display: flex; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.ghost-btn {
  flex: 1;
  min-width: 140px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 0.88rem;
  cursor: pointer;
}
.ghost-btn:active { background: var(--card); }

/* ---------- Export bar ---------- */
.export-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11,18,32,0), var(--bg) 30%);
  z-index: 30;
}
.export-btn {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121f;
  font-weight: 800;
  font-size: 1.1rem;
  border: none;
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 -2px 30px rgba(0,0,0,0.5), 0 8px 24px rgba(0,224,184,0.28);
}
.export-btn:active { transform: translateY(1px); }
.export-btn:disabled { opacity: 0.6; }

/* ---------- Success flash ---------- */
.success-flash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(6, 12, 22, 0.85);
  backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.35s;
  font-size: 1.2rem;
  font-weight: 700;
}
.success-flash.show { opacity: 1; }
.success-flash .check { font-size: 3.5rem; animation: pop 0.4s ease; }
@keyframes pop { 0%{transform:scale(0.3);opacity:0} 60%{transform:scale(1.15)} 100%{transform:scale(1);opacity:1} }

@media (min-width: 640px) {
  .landing h1 { font-size: 2rem; }
}
