/* ZHH Full Site Scrapper — design system */
:root {
  --bg: #07080d;
  --bg-2: #0c0e16;
  --surface: rgba(20, 22, 32, 0.7);
  --surface-2: rgba(28, 31, 44, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f3f8;
  --text-dim: #aab0c0;
  --text-mute: #6b7185;
  --primary: #00ffa3;
  --primary-2: #00d2ff;
  --accent: #b388ff;
  --danger: #ff5d73;
  --warn: #ffb547;
  --grad: linear-gradient(135deg, #00ffa3 0%, #00d2ff 60%, #b388ff 100%);
  --glow: 0 0 40px rgba(0, 255, 163, 0.25);
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(0,210,255,0.10), transparent 60%),
              radial-gradient(900px 500px at -10% 20%, rgba(179,136,255,0.10), transparent 60%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

#particles {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.site-header, .hero, .results, .site-footer {
  position: relative; z-index: 1;
}

/* HEADER */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 32px;
  max-width: 1200px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-weight: 700; font-size: 18px; letter-spacing: 2px;
  background: var(--grad); color: #07080d;
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  box-shadow: var(--glow);
}
.brand-meta { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 600; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-mute); }

.wa-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(37, 211, 102, 0.12);
  color: #25d366; text-decoration: none; font-weight: 600; font-size: 14px;
  border: 1px solid rgba(37, 211, 102, 0.35);
  transition: all .2s ease;
}
.wa-btn:hover { background: rgba(37, 211, 102, 0.22); transform: translateY(-1px); }

/* HERO */
.hero {
  max-width: 980px; margin: 40px auto 24px;
  padding: 60px 32px 40px;
  text-align: center;
}
.eyebrow {
  display: inline-block; padding: 6px 14px;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px); font-weight: 700;
  line-height: 1.05; margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--text-dim); font-size: 17px; max-width: 640px; margin: 0 auto 36px; line-height: 1.55; }

.scrape-bar {
  display: flex; gap: 10px; align-items: stretch;
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  padding: 8px; border-radius: 18px;
  max-width: 720px; margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), var(--glow);
}
.input-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.input-icon { position: absolute; left: 14px; color: var(--text-mute); }
#url {
  width: 100%; padding: 14px 16px 14px 44px;
  background: transparent; border: none; outline: none;
  color: var(--text); font-size: 16px; font-family: var(--font-mono);
}
#url::placeholder { color: var(--text-mute); }

.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 12px;
  background: var(--grad); color: #07080d; border: none;
  font-weight: 700; font-size: 14px; letter-spacing: 1px;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  font-family: var(--font-sans);
}
.cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(0,255,163,0.25); }
.cta:disabled { opacity: .5; cursor: not-allowed; }
.cta.loading .cta-label::after {
  content: ''; display: inline-block; width: 12px; height: 12px;
  margin-left: 8px; border: 2px solid #07080d; border-top-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cta-solid { background: var(--grad); }
.ghost {
  padding: 12px 18px; border-radius: 12px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border-strong); cursor: pointer;
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
}
.ghost:hover { color: var(--text); border-color: var(--text-dim); }

.hint { margin-top: 14px; font-size: 13px; color: var(--text-mute); }
.hint code { background: var(--surface-2); padding: 2px 8px; border-radius: 6px; font-family: var(--font-mono); color: var(--primary); }

/* RESULTS */
.results {
  max-width: 1200px; margin: 20px auto 60px;
  padding: 32px;
  background: var(--surface); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 20px;
}
.results.hidden { display: none; }
.results-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 20px;
}
.results-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.results-meta { margin: 0; color: var(--text-dim); font-size: 13px; font-family: var(--font-mono); }
.results-actions { display: flex; gap: 10px; }

.progress-wrap {
  position: relative; height: 8px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden; margin-bottom: 18px;
}
.progress-bar {
  height: 100%; width: 0%; background: var(--grad);
  transition: width .25s ease; border-radius: 999px;
}
.progress-label {
  position: absolute; right: 0; top: -22px;
  font-size: 12px; color: var(--text-mute); font-family: var(--font-mono);
}

.filter-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
#filter {
  flex: 1; min-width: 220px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; outline: none;
}
#filter:focus { border-color: var(--primary); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.legend .chip {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono);
}

.file-list { display: grid; grid-template-columns: 1fr; gap: 8px; max-height: 600px; overflow-y: auto; padding-right: 6px; }
.file-list::-webkit-scrollbar { width: 8px; }
.file-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.file-row {
  display: grid; grid-template-columns: 36px 1fr auto auto auto;
  gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: all .15s ease;
}
.file-row:hover { border-color: var(--border-strong); }
.file-row.failed { opacity: .55; }
.file-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  background: rgba(0,210,255,0.12); color: var(--primary-2);
  text-transform: uppercase;
}
.file-icon.html { background: rgba(255, 93, 115, .12); color: #ff8aa0; }
.file-icon.css  { background: rgba(0, 210, 255, .12); color: #00d2ff; }
.file-icon.js   { background: rgba(255, 181, 71, .12); color: #ffb547; }
.file-icon.img  { background: rgba(0, 255, 163, .12); color: #00ffa3; }
.file-icon.font { background: rgba(179, 136, 255, .12); color: #b388ff; }
.file-icon.json { background: rgba(255, 181, 71, .12); color: #ffb547; }
.file-name {
  font-family: var(--font-mono); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-name a { color: var(--text); text-decoration: none; }
.file-name a:hover { color: var(--primary); }
.file-url {
  display: block; font-size: 11px; color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.file-size { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); min-width: 70px; text-align: right; }
.file-status { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.file-status.ok { background: rgba(0,255,163,.12); color: var(--primary); }
.file-status.fail { background: rgba(255,93,115,.12); color: var(--danger); }
.file-dl {
  background: transparent; color: var(--text-dim); border: 1px solid var(--border-strong);
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-family: var(--font-sans); font-size: 12px;
}
.file-dl:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.file-dl:disabled { opacity: .4; cursor: not-allowed; }

/* FOOTER */
.site-footer {
  max-width: 1200px; margin: 0 auto;
  padding: 28px 32px 40px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-logo {
  font-weight: 700; letter-spacing: 3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.foot-links { display: flex; gap: 18px; align-items: center; }
.foot-links a { color: var(--text-dim); text-decoration: none; }
.foot-links a:hover { color: var(--primary); }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; pointer-events: none;
  transition: all .25s ease; z-index: 100;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); color: #ffb0bd; }
.toast.success { border-color: var(--primary); color: var(--primary); }

/* MOBILE */
@media (max-width: 720px) {
  .site-header { padding: 18px; }
  .brand-meta { display: none; }
  .hero { padding: 30px 18px; }
  .scrape-bar { flex-direction: column; padding: 10px; }
  .cta { justify-content: center; }
  .results { padding: 20px; margin: 12px; }
  .file-row { grid-template-columns: 32px 1fr auto; gap: 8px; }
  .file-status, .file-size { display: none; }
  .site-footer { padding: 20px; flex-direction: column; text-align: center; }
}
