/* ══════════════════════════════════════════
   DataHarvest — Global Styles
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
  --bg:          #0a0b14;
  --bg-2:        #0f1120;
  --surface:     rgba(255,255,255,0.04);
  --surface-h:   rgba(255,255,255,0.07);
  --border:      rgba(255,255,255,0.08);
  --border-h:    rgba(129,140,248,0.4);

  --violet:      #818cf8;
  --purple:      #c084fc;
  --cyan:        #67e8f9;
  --green:       #4ade80;
  --red:         #f87171;
  --amber:       #fbbf24;

  --text-1:      #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --shadow-glow: 0 0 40px rgba(129,140,248,0.15);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-h); border-radius: 99px; }

/* ── Background Particles ── */
.bg-particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: float 12s ease-in-out infinite alternate;
}
.p1 { width: 500px; height: 500px; background: radial-gradient(circle, #818cf8, transparent 70%);  top: -200px; left: -150px; animation-duration: 14s; }
.p2 { width: 400px; height: 400px; background: radial-gradient(circle, #c084fc, transparent 70%);  top: 40%;   right: -150px; animation-duration: 18s; animation-delay: -5s; }
.p3 { width: 300px; height: 300px; background: radial-gradient(circle, #67e8f9, transparent 70%);  bottom: 10%; left: 20%; animation-duration: 16s; animation-delay: -8s; }
.p4 { width: 250px; height: 250px; background: radial-gradient(circle, #a78bfa, transparent 70%);  top: 30%;   left: 40%; animation-duration: 20s; animation-delay: -3s; }
.p5 { width: 200px; height: 200px; background: radial-gradient(circle, #34d399, transparent 70%);  bottom: 20%; right: 20%; animation-duration: 22s; animation-delay: -10s; }
@keyframes float {
  0%   { transform: translate(0px, 0px) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ── Glass Utility ── */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ══════════════════════════════════════════
   Header
   ══════════════════════════════════════════ */
.header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,11,20,0.7);
  backdrop-filter: blur(16px);
}
.logo {
  display: flex; align-items: center; gap: 12px;
}
.logo-anim {
  position: relative;
  width: 40px; height: 40px;
  flex-shrink: 0;
}
.logo-icon {
  width: 40px; height: 40px;
  display: block;
}
/* Radar sweep arm rotates continuously */
.sweep-arm {
  transform-origin: 20px 20px;
  animation: radarSweep 2.5s linear infinite;
}
@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* Pulse glow on the logo */
.logo-anim::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129,140,248,0.25), transparent 70%);
  animation: logoPulse 2.5s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50%       { opacity: 1;   transform: scale(1.1); }
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 1px;
}
.logo-forte {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-2);
  text-transform: uppercase;
}
.logo-harvest {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--violet), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════
   Main / Hero
   ══════════════════════════════════════════ */
.main {
  position: relative; z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}
.hero { text-align: center; margin-bottom: 48px; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--violet) 0%, var(--purple) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════
   Search Card
   ══════════════════════════════════════════ */
.search-section { margin-bottom: 40px; }
.search-card {
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transition: box-shadow var(--transition);
}
.search-card:focus-within {
  box-shadow: var(--shadow-card), 0 0 60px rgba(129,140,248,0.25);
  border-color: var(--border-h);
}

.input-wrapper {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 18px;
  transition: border-color var(--transition);
}
.input-wrapper:focus-within { border-color: var(--violet); }
.input-icon { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-1);
  caret-color: var(--violet);
}
.search-input::placeholder { color: var(--text-3); }

.search-btn {
  background: linear-gradient(135deg, var(--violet), var(--purple));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 28px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; gap: 8px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.search-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition);
}
.search-btn:hover::before { opacity: 1; }
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(129,140,248,0.4); }
.search-btn:active { transform: translateY(0); }
.search-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress ── */
.progress-wrap { margin-top: 24px; }
.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--purple), var(--cyan));
  border-radius: 99px;
  transition: width 0.6s ease;
}
.progress-stages {
  display: flex; gap: 0; justify-content: space-between;
}
.stage {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-3); font-weight: 500;
  flex: 1; text-align: center;
  transition: color var(--transition);
}
.stage-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--text-3);
  transition: all var(--transition);
}
.stage.active .stage-dot {
  background: var(--violet);
  border-color: var(--violet);
  box-shadow: 0 0 10px rgba(129,140,248,0.7);
}
.stage.active { color: var(--violet); }
.stage.done .stage-dot {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 10px rgba(74,222,128,0.5);
}
.stage.done { color: var(--green); }

/* ── Live Counter ── */
.live-counter {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--violet);
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.2px;
  animation: pulse-text 2s ease-in-out infinite;
}
@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Error ── */
.error-msg {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 0.88rem;
}

/* ══════════════════════════════════════════
   Results
   ══════════════════════════════════════════ */
.results-section { animation: fadeUp 0.5s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stats Bar */
.stats-bar {
  display: flex; align-items: center; gap: 24px;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.stat-item { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.stat-num {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--violet), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label { font-size: 0.72rem; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.stat-divider { width: 1px; height: 32px; background: var(--border); flex-shrink: 0; }
.stat-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; }

/* Filter Chips */
.filter-chips { display: flex; gap: 6px; }
.chip {
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.chip:hover { border-color: var(--violet); color: var(--violet); }
.chip.active {
  background: linear-gradient(135deg, var(--violet), var(--purple));
  border-color: transparent;
  color: #fff;
}

/* Export Button */
.export-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.3);
  color: var(--green);
  font-size: 0.85rem; font-weight: 600;
  transition: all var(--transition);
}
.export-btn svg { width: 15px; height: 15px; }
.export-btn:hover {
  background: rgba(74,222,128,0.2);
  border-color: var(--green);
  transform: translateY(-1px);
}

/* Table */
.table-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.results-table {
  width: 100%;
  border-collapse: collapse;
}
.results-table thead tr {
  background: rgba(129,140,248,0.08);
  border-bottom: 1px solid var(--border);
}
.results-table th {
  padding: 13px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  text-align: left;
}
.results-table td {
  padding: 13px 18px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-1);
  vertical-align: middle;
}
.results-table tbody tr {
  transition: background var(--transition);
}
.results-table tbody tr:hover {
  background: var(--surface-h);
}
.results-table tbody tr:last-child td { border-bottom: none; }

/* Type Badge */
.type-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.type-badge.email {
  background: rgba(129,140,248,0.15);
  color: var(--violet);
  border: 1px solid rgba(129,140,248,0.25);
}
.type-badge.phone {
  background: rgba(103,232,249,0.12);
  color: var(--cyan);
  border: 1px solid rgba(103,232,249,0.2);
}

/* Value Cell */
.value-cell { font-weight: 500; font-feature-settings: "tnum"; }

/* Source Cell */
.source-cell {
  color: var(--text-3);
  font-size: 0.78rem;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-link { color: var(--violet); opacity: 0.8; transition: opacity var(--transition); }
.source-link:hover { opacity: 1; text-decoration: underline; }

/* Copy Button */
.copy-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--violet); border-color: var(--violet); background: rgba(129,140,248,0.1); }
.copy-btn.copied { color: var(--green); border-color: var(--green); background: rgba(74,222,128,0.1); }

/* Empty State */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-3);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* No Results */
.no-results {
  text-align: center; padding: 48px 24px;
  border-radius: var(--radius-xl);
  animation: fadeUp 0.4s ease both;
}
.no-results-icon { font-size: 2.5rem; margin-bottom: 12px; }
.no-results h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.no-results p { color: var(--text-2); font-size: 0.9rem; }

/* ══════════════════════════════════════════
   Footer
   ══════════════════════════════════════════ */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 24px;
  color: var(--text-3);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  background: rgba(10,11,20,0.6);
}

/* ══════════════════════════════════════════
   Toast
   ══════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 32px; right: 32px;
  background: rgba(30,32,48,0.95);
  border: 1px solid var(--border-h);
  color: var(--text-1);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
  pointer-events: none;
  z-index: 999;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ══════════════════════════════════════════
   Utilities
   ══════════════════════════════════════════ */
.hidden { display: none !important; }

@media (max-width: 640px) {
  .header { padding: 16px 20px; }
  .main { padding: 40px 16px 60px; }
  .stats-bar { flex-direction: column; align-items: flex-start; }
  .stat-divider { display: none; }
  .stat-actions { width: 100%; justify-content: space-between; }
  .input-wrapper { flex-wrap: wrap; padding: 10px 14px; }
  .search-btn { width: 100%; justify-content: center; }
}
