/* Gear Plus — design system
   Tokens sourced from onboarding landing page CSS.
   Dark theme, Space Grotesk headings, DM Sans body. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark:      #0a0a0f;
  --bg-card:      #111118;
  --bg-input:     #16161f;
  --accent:       #00e5a0;
  --accent-dim:   rgba(0, 229, 160, 0.12);
  --accent-glow:  rgba(0, 229, 160, 0.3);
  --text-primary: #e8e8ed;
  --text-secondary: #8888a0;
  --text-muted:   #55556a;
  --border:       #1e1e2a;
  --border-focus: rgba(0, 229, 160, 0.5);
  --orange:       #ff6b35;
  --blue:         #4da6ff;
  --red:          #ff4d6d;
  --radius:       12px;
  --radius-sm:    8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 { font-family: 'Space Grotesk', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── NAV ─────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.85);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 1.2rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-primary);
}
.logo-dot {
  width: 8px; height: 8px;
  background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-tag {
  font-size: 0.72rem; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.nav-link {
  font-size: 0.9rem; color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-link:hover { color: var(--accent); }

/* ── HERO ─────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,229,160,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent-dim); border: 1px solid rgba(0,229,160,0.2);
  border-radius: 100px; padding: 0.35rem 1rem;
  font-size: 0.78rem; color: var(--accent); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 540px; margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* ── SEARCH BAR ───────────────────────────────────────── */
.search-container {
  width: 100%; max-width: 640px;
  margin: 0 auto 1rem;
}
.search-form {
  display: flex; gap: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-form:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,229,160,0.1);
}
.search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-primary); font-size: 1rem; font-family: inherit;
  padding: 0.9rem 1.2rem;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  background: var(--accent); border: none;
  color: #0a0a0f; font-weight: 600; font-size: 0.9rem;
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 0.4rem;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.98); }
.search-hint {
  font-size: 0.8rem; color: var(--text-muted);
  text-align: center;
}

/* ── CATEGORY CHIPS ──────────────────────────────────── */
.category-chips {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center; margin: 1.5rem auto;
  max-width: 680px;
}
.chip {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 100px; padding: 0.35rem 0.9rem;
  font-size: 0.82rem; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}

/* ── FEATURES SECTION ────────────────────────────────── */
.features {
  padding: 5rem 1.5rem;
  max-width: 1100px; margin: 0 auto;
}
.section-heading {
  text-align: center; margin-bottom: 3rem;
}
.section-heading h2 { font-size: 2rem; margin-bottom: 0.6rem; }
.section-heading p { color: var(--text-secondary); font-size: 0.95rem; }
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.8rem;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: rgba(0,229,160,0.3); }
.feature-icon { font-size: 1.8rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* ── RESULTS PAGE ─────────────────────────────────────── */
.app-shell { padding-top: 5rem; min-height: 100vh; }
.results-header {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
}
.results-search-bar { max-width: 700px; margin: 0 auto; }
.results-body {
  max-width: 1200px; margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { opacity: 0.4; }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
}
.stat-label {
  font-size: 0.75rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.7rem; font-weight: 700;
  color: var(--text-primary);
}
.stat-value.accent { color: var(--accent); }
.stat-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* Trend badge */
.trend-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-radius: 100px; padding: 0.3rem 0.8rem;
  font-size: 0.8rem; font-weight: 600;
}
.trend-rising  { background: rgba(0,229,160,0.12); color: var(--accent); }
.trend-falling { background: rgba(255,77,109,0.12); color: var(--red); }
.trend-stable  { background: rgba(77,166,255,0.12); color: var(--blue); }
.trend-unknown { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); }

/* Two-column layout */
.results-cols {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem; align-items: start;
}
@media (max-width: 900px) { .results-cols { grid-template-columns: 1fr; } }

/* Section headers */
.section-title {
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 0.8rem;
}

/* Sold listings table */
.listings-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.listings-table {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
}
.listings-table th {
  background: rgba(255,255,255,0.03); padding: 0.8rem 1rem;
  text-align: left; font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em; border-bottom: 1px solid var(--border);
}
.listings-table td {
  padding: 0.85rem 1rem; border-bottom: 1px solid rgba(30,30,42,0.5);
  color: var(--text-secondary); vertical-align: middle;
}
.listings-table tr:last-child td { border-bottom: none; }
.listings-table tr:hover td { background: rgba(255,255,255,0.02); }
.listing-title {
  color: var(--text-primary); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-title a:hover { color: var(--accent); }
.listing-price { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.condition-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 0.15rem 0.55rem; border-radius: 100px; white-space: nowrap;
}
.cond-new    { background: rgba(0,229,160,0.15); color: var(--accent); }
.cond-used   { background: rgba(77,166,255,0.12); color: var(--blue); }
.cond-parts  { background: rgba(255,107,53,0.12); color: var(--orange); }
.cond-refurb { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.cond-default{ background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* Price chart */
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1rem;
}
.chart-bars {
  display: flex; align-items: flex-end; gap: 6px;
  height: 100px; margin-top: 0.8rem;
}
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar {
  width: 100%; background: var(--accent-dim);
  border-radius: 3px 3px 0 0; border-top: 2px solid var(--accent);
  min-height: 4px; transition: background 0.2s;
}
.chart-bar:hover { background: rgba(0,229,160,0.25); }
.chart-label { font-size: 0.65rem; color: var(--text-muted); text-align: center; }

/* Condition breakdown */
.cond-list { list-style: none; }
.cond-item {
  display: grid; grid-template-columns: 90px 1fr auto auto;
  align-items: center; gap: 0.6rem;
  padding: 0.55rem 0; border-bottom: 1px solid rgba(30,30,42,0.5);
}
.cond-item:last-child { border-bottom: none; }
.cond-bar-wrap { height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; }
.cond-bar { height: 4px; background: var(--accent); border-radius: 2px; min-width: 4px; }
.cond-name { font-size: 0.84rem; color: var(--text-secondary); }
.cond-count { font-size: 0.8rem; color: var(--text-muted); }
.cond-avg { font-size: 0.82rem; color: var(--text-primary); font-weight: 600; }

/* Catalog matches */
.catalog-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1rem;
}
.catalog-item {
  padding: 0.55rem 0; border-bottom: 1px solid rgba(30,30,42,0.4);
  cursor: pointer;
}
.catalog-item:last-child { border-bottom: none; }
.catalog-item:hover .catalog-name { color: var(--accent); }
.catalog-name { color: var(--text-primary); font-weight: 500; font-size: 0.88rem; }
.catalog-cat {
  font-size: 0.72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.1rem;
}

/* No results / empty */
.no-results { text-align: center; padding: 4rem 2rem; color: var(--text-secondary); }
.no-results h3 { font-size: 1.2rem; margin-bottom: 0.6rem; color: var(--text-primary); }
.no-results p { font-size: 0.9rem; line-height: 1.6; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

/* API notice */
.api-notice {
  background: rgba(255,107,53,0.08); border: 1px solid rgba(255,107,53,0.2);
  border-radius: var(--radius-sm); padding: 0.8rem 1rem;
  font-size: 0.85rem; color: var(--orange); margin-bottom: 1.5rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem; text-align: center;
  font-size: 0.82rem; color: var(--text-muted); margin-top: 4rem;
}

/* Responsive */
@media (max-width: 600px) {
  .nav { padding: 1rem; }
  .hero h1 { font-size: 2rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .listings-table th:nth-child(4),
  .listings-table td:nth-child(4) { display: none; }
  .results-body { padding: 1.5rem 1rem; }
}
