:root {
  --bg: #0b0f19; /* dark */
  --text: #f8fafc; /* near white */
  --muted: #93a4b8; /* soft gray */
  --panel: rgba(255, 255, 255, 0.06); /* glass */
  --accent: #57a1ff; /* light neon blue */
  --accent-weak: rgba(87, 161, 255, 0.18);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
}

#creditsBar { position: fixed; right: 18px; top: 12px; z-index: 2000; background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); }
#creditsBar #creditsValue { font-weight: 700; }

/* Plans overlay for trial gate */
#trialOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 3000; }
#trialOverlay .box { background: rgba(17,24,39,0.92); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 640px; text-align: center; box-shadow: var(--shadow); }
.banner-title { font-weight: 800; font-size: 22px; margin-bottom: 8px; }
.banner-sub { font-size: 16px; opacity: 0.9; margin-bottom: 16px; }
.btn-primary { background: var(--accent); color: #0b0f19; border: 1.5px solid var(--accent); }

#app { display: grid; grid-template-columns: 260px 1fr; height: 100vh; background: var(--bg); }

.sidebar { border-right: 1px solid var(--border); padding: 24px 16px; background: rgba(255,255,255,0.02); backdrop-filter: blur(10px); }
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 24px;
  font-size: 22px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 10px; }
.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
}
.tab:hover { background: var(--accent-weak); border-color: var(--accent); }
.tab.active { background: var(--accent); color: #0b0f19; border-color: var(--accent); font-weight: 700; }

.content { padding: 32px; overflow: auto; }
.content h1 { margin: 0 0 16px 0; font-weight: 700; }
.title-center { text-align: center; }
.content h2 { margin: 0 0 10px 0; font-weight: 600; font-size: 16px; }

.card { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.step { display: flex; flex-direction: column; gap: 8px; }

input[type="file"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}

button {
  appearance: none;
  background: var(--accent);
  color: #0b0f19;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
}
button[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--accent); }
.btn-outline.small-btn { min-width: 0; width: auto; font-size: 13px; padding: 6px 16px; align-self: flex-start; }
.big { font-size: 16px; padding: 12px 20px; }

.muted { color: var(--muted); }
.muted.small { font-size: 12px; }

.crunchbase-layout { display: flex; flex-wrap: nowrap; gap: 36px; align-items: flex-start; justify-content: center; padding: 0 40px; }
.crunchbase-instructions { flex: 1 1 560px; max-width: 640px; display: flex; flex-direction: column; gap: 16px; }
.crunchbase-instructions .card { margin: 0; }
.crunchbase-video { flex: 0 0 560px; max-width: 560px; display: flex; align-items: stretch; justify-content: flex-end; }
.crunchbase-video-embed { border-radius: 14px; overflow: hidden; box-shadow: 0 18px 45px rgba(15,23,42,0.28); width: 100%; }

@media (max-width: 1024px) {
  .crunchbase-layout { flex-direction: column; gap: 24px; padding: 0 18px; }
  .crunchbase-instructions, .crunchbase-video { max-width: 100%; flex: 1 1 auto; }
  .crunchbase-video { justify-content: center; }
}

.tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  transition: background 120ms ease, border-color 120ms ease;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { background: var(--accent-weak); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 999px; display: inline-flex; gap: 8px; align-items: center; }
.tag { transition: transform 120ms ease, background 120ms ease; }
.tag:active { transform: scale(0.98); }
.tag .x {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}
.tags-input textarea {
  flex: 1;
  min-width: 240px;
  min-height: 28px;
  resize: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  transition: color 120ms ease;
}

.progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--border); overflow: hidden; }
.bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.25s ease; }
.progress-row { display: flex; justify-content: space-between; margin-bottom: 8px; }
.log { margin-top: 8px; font-size: 12px; color: var(--muted); max-height: 120px; overflow: auto; }

.actions { display: flex; gap: 12px; align-items: center; }
.actions.center { justify-content: center; }
.table-wrap { overflow: auto; max-height: 50vh; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: auto; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-weight: 600; opacity: 0.85; }
thead th { position: sticky; top: 0; background: #fff; }
thead th { background: rgba(255,255,255,0.08); }

/* extra spacing between download button and table */
#resultsCard .actions { margin-bottom: 12px; }
#efResultsCard .actions { margin-bottom: 12px; }
#cdfResultsCard .actions { margin-bottom: 12px; }
#wsResultsCard .actions { margin-bottom: 12px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.map-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.map-row label { width: 160px; color: var(--muted); }

.toggle { display: inline-flex; justify-content: center; gap: 10px; width: auto; }
.toggle { position: relative; z-index: 1000 !important; }
.center .toggle { margin: 0 auto; }
.center .switch { margin: 6px auto 0; }
.seg { position: relative; z-index: 1001; background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.seg { pointer-events: auto; }
.seg.active { background: var(--accent); color: #0b0f19; border-color: var(--accent); }
.seg-input { position: absolute; left: -9999px; visibility: hidden; }
.seg-input:checked + label.seg { background: var(--accent); color: #0b0f19; border-color: var(--accent); }

.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.switch input { width: 18px; height: 18px; }

/* Pricing / Plans */
.trial-banner { text-align:center; padding: 18px 22px; }
.trial-banner .trial-head { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.trial-banner .trial-sub { font-size: 16px; opacity: 0.9; }
.pricing-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; align-items: stretch; }
.plan-card { position: relative; padding-top: 28px; width: 100%; }
.plan-card .badge { position:absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color:#0b0f19; font-weight:800; font-size:12px; padding:4px 10px; border-radius:999px; border:1px solid var(--border); box-shadow: var(--shadow); }
.plan-card.popular { border-color: var(--accent); box-shadow: 0 10px 30px rgba(87,161,255,0.25); }
.plan-name { font-weight: 900; font-size: 19px; text-align:center; }
.plan-price { font-weight: 900; font-size: 30px; margin-top: 6px; text-align:center; }
.plan-price .per { font-size: 14px; font-weight: 600; opacity: 0.85; margin-left: 2px; }
.plan-meta { margin-top: 8px; text-align:center; color: var(--muted); font-size: 13px; }
.feature-list { list-style:none; padding:0; margin:16px 0 0 0; border-top:1px solid var(--border); }
.feature-list li { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); font-size: 14px; }
.feature-list .tick { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background: var(--accent-weak); color: var(--accent); font-weight:800; }
.download-bar { margin-top: 12px; justify-content: flex-end; }

/* Center the 4th plan in the second row on wide screens */
@media (min-width: 1200px) {
  .pricing-grid { grid-template-columns: repeat(3, minmax(420px, 1fr)); justify-content: center; }
  .pricing-grid .plan-card:nth-child(4) { grid-column: 2; }
}

/* Apollo Scraper layout */
.apollo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
.apollo-col { padding: 8px; height: 100%; }
.apollo-right { border-left: none; padding-left: 0; }
.apollo-paygo { max-width: 360px; justify-self: start; }
.apollo-steps { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 24px; }
.apollo-steps li { padding: 12px 0; }
.apollo-steps .step-title { font-weight: 600; margin-bottom: 8px; }
