/* === MARKET SCOUT — DISCOVERY PAGE === */
:root {
  --bg: #0B1120;
  --surface: #111827;
  --surface-2: #1a2332;
  --fg: #F5F2EE;
  --fg-muted: #9CA3AF;
  --accent: #00D4AA;
  --accent-dim: rgba(0, 212, 170, 0.12);
  --accent-border: rgba(0, 212, 170, 0.25);
  --danger: #F87171;
  --warning: #FBBF24;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --font-head: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  background: rgba(11,17,32,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.nav-logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
}
.nav-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding-left: 20px;
  border-left: 1px solid var(--border);
}
.nav-links {
  margin-left: auto;
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--fg);
}

/* PAGE */
.page { padding-top: 64px; min-height: 100vh; }

/* HERO BAND */
.hero-band {
  padding: 56px 48px 40px;
  position: relative;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,170,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,170,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 30%, transparent 100%);
  pointer-events: none;
}
.hero-band-inner { max-width: 1200px; margin: 0 auto; position: relative; }
.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.hero-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  max-width: 480px;
}

/* FILTERS BAR */
.filters-bar {
  padding: 0 48px 24px;
}
.filters-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.filter-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.filter-select, .filter-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:hover, .filter-input:hover { border-color: var(--accent-border); }
.filter-select:focus, .filter-input:focus { border-color: var(--accent); }

.commission-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.range-sep { color: var(--fg-muted); font-size: 0.8rem; }
.filter-input { width: 70px; }

.btn-filter {
  background: var(--accent);
  color: #0B1120;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.2s;
}
.btn-filter:hover { opacity: 0.85; }

.product-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--fg-muted);
  padding-top: 20px;
}

/* PRODUCT GRID */
.grid-section { padding: 0 48px 80px; }
.grid-inner { max-width: 1200px; margin: 0 auto; }
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* PRODUCT CARD */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: 0.75rem;
  overflow: hidden;
  position: relative;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.card-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--fg);
}
.card-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
  flex: 1;
}
.card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}
.rating-stars {
  display: flex;
  gap: 2px;
  align-items: center;
}
.star { color: #FBBF24; font-size: 0.85rem; }
.star.empty { color: #374151; }
.rating-num { font-size: 0.8rem; color: var(--fg-muted); margin-left: 4px; }
.card-price {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
}
.commission-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.btn-affiliate {
  margin-top: 12px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-affiliate:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* LINK MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 440px;
  width: 90%;
}
.modal-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.modal-sub { font-size: 0.85rem; color: var(--fg-muted); margin-bottom: 20px; }
.modal-url-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  word-break: break-all;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  color: var(--accent);
  margin-bottom: 16px;
}
.modal-actions { display: flex; gap: 8px; }
.btn-copy {
  flex: 1;
  background: var(--accent);
  color: #0B1120;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
}
.btn-copy.copied { background: #059669; }
.btn-close {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 8px;
  padding: 10px;
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
}
.modal-commission {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--fg); }

/* LOADING */
.loading-row {
  display: flex;
  justify-content: center;
  padding: 40px;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
}
.footer a { color: var(--accent); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .hero-band, .filters-bar, .grid-section { padding-left: 20px; padding-right: 20px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
/* Search input */
.filter-search-group { flex: 1 1 220px; }
.filter-search { width: 100%; min-width: 180px; }

/* Brand tag on product cards */
.card-brand {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 4px;
}

/* Pending affiliate button (disabled state) */
.btn-pending {
  background: transparent \!important;
  border: 1px solid var(--border) \!important;
  color: var(--fg-muted) \!important;
  cursor: not-allowed \!important;
  opacity: 0.6;
}
