/* URBot Compare — Side-by-side bot comparison */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f; --surface: #12121a; --surface2: #1a1a28; --surface3: #20202e;
  --border: #1e1e2e; --text: #e2e2e8; --muted: #888898;
  --accent: #6366f1; --accent-dim: rgba(99,102,241,0.15);
  --green: #10b981; --gold: #f59e0b; --red: #ef4444; --purple: #8b5cf6;
  --radius: 10px; --radius-sm: 6px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Header ─────────────────────────────────────────────────────────────── */
.compare-header { text-align: center; padding: 48px 24px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.compare-header .logo { font-size: 1.1rem; font-weight: 800; color: var(--accent); display: block; margin-bottom: 16px; }
.compare-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.compare-header p { color: var(--muted); max-width: 540px; margin: 0 auto; }

/* ─── Main ───────────────────────────────────────────────────────────────── */
.compare-main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }

/* ─── Selector ───────────────────────────────────────────────────────────── */
.selector-section { position: relative; margin-bottom: 24px; }
.selector-search {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; transition: border-color 0.2s;
}
.selector-search:focus-within { border-color: var(--accent); }
.selector-search input { flex: 1; min-width: 200px; background: none; border: none; color: var(--text); font-size: 1rem; outline: none; }
.selector-search input::placeholder { color: var(--muted); }
.selector-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.chip-remove { cursor: pointer; opacity: 0.7; font-size: 1.1rem; line-height: 1; }
.chip-remove:hover { opacity: 1; }
.selector-hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

.selector-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); max-height: 320px; overflow-y: auto; z-index: 50;
  display: none; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.selector-dropdown.show { display: block; }
.dropdown-item { padding: 10px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: background 0.15s; }
.dropdown-item:hover { background: var(--accent-dim); }
.dropdown-item .bot-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.dropdown-item .bot-info { flex: 1; }
.dropdown-item .bot-name { font-weight: 600; font-size: 0.95rem; }
.dropdown-item .bot-cat { font-size: 0.78rem; color: var(--muted); }
.dropdown-item.in-list { opacity: 0.4; pointer-events: none; }

/* ─── Loading / Error ────────────────────────────────────────────────────── */
.loading-state, .error-state { text-align: center; padding: 60px 24px; color: var(--muted); }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { color: var(--red); }

/* ─── Best Overall Banner ────────────────────────────────────────────────── */
.best-overall-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(99,102,241,0.12));
  border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 16px 24px; margin-bottom: 24px;
}
.best-overall-banner .trophy { font-size: 1.5rem; }
#best-overall-text { font-weight: 700; font-size: 1rem; flex: 1; }
.best-overall-cta { background: var(--gold); color: #0a0a0f; padding: 8px 18px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; white-space: nowrap; text-decoration: none; }
.best-overall-cta:hover { opacity: 0.9; text-decoration: none; }

/* ─── Quick Match Bar ─────────────────────────────────────────────────────── */
.quick-match-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 28px;
}
.quick-match-bar label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; }
.quick-match-input { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-match-input input { flex: 1; min-width: 200px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 9px 14px; border-radius: var(--radius-sm); font-size: 0.95rem; outline: none; transition: border-color 0.2s; }
.quick-match-input input:focus { border-color: var(--accent); }
.btn-accent { background: var(--accent); color: #fff; }
.quick-match-result { margin-top: 12px; padding: 12px 16px; background: var(--surface2); border-radius: var(--radius-sm); border-left: 3px solid var(--green); font-size: 0.9rem; }
.quick-match-result.low { border-left-color: var(--gold); }
.quick-match-winner { font-weight: 700; color: var(--green); }

/* ─── Comparison Table ───────────────────────────────────────────────────── */
.comparison-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--border); }
.comparison-table { width: 100%; border-collapse: collapse; min-width: 580px; }
.comparison-table th, .comparison-table td { padding: 13px 16px; text-align: center; border-bottom: 1px solid var(--border); vertical-align: top; }
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table thead th { background: var(--surface); position: sticky; top: 0; z-index: 5; }
.comparison-table tbody tr:hover td { background: rgba(99,102,241,0.04); }
.label-col { text-align: left !important; font-weight: 600; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; width: 150px; min-width: 130px; }

/* Bot column header */
.bot-col-header { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bot-col-avatar { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.3rem; flex-shrink: 0; }
.bot-col-name { font-weight: 700; font-size: 1rem; }
.bot-col-cat { font-size: 0.75rem; color: var(--muted); }
.best-badge { display: inline-block; background: var(--gold); color: #0a0a0f; font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 10px; margin-top: 4px; }

/* Capability bars */
.cap-cell { }
.cap-bar-wrap { display: flex; align-items: center; gap: 8px; justify-content: center; }
.cap-bar { width: 60px; height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.cap-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.cap-high .cap-bar-fill { background: var(--green); }
.cap-mid .cap-bar-fill { background: var(--gold); }
.cap-low .cap-bar-fill { background: var(--red); }
.cap-score { font-size: 0.8rem; color: var(--muted); min-width: 28px; text-align: left; }
.winner-badge { display: inline-block; background: rgba(16,185,129,0.12); color: var(--green); font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; white-space: nowrap; }

/* Price cell */
.price-cell { }
.price-range { font-size: 1rem; font-weight: 700; color: var(--green); display: block; }
.tier-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.tier-item { font-size: 0.78rem; color: var(--muted); }
.tier-item strong { color: var(--text); }

/* Rating cell */
.stars { color: var(--gold); font-size: 1rem; display: block; }
.review-count { font-size: 0.78rem; color: var(--muted); }

/* Tags cell */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; padding: 2px 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; }
.tag-green { background: rgba(16,185,129,0.12); color: var(--green); }
.tag-red { background: rgba(239,68,68,0.1); color: var(--red); }

/* Response style */
.style-pill { display: inline-block; background: var(--surface2); padding: 3px 10px; border-radius: 12px; font-size: 0.8rem; color: var(--muted); }

/* Sample Q&A */
.qa-list { text-align: left; }
.qa-item { margin-bottom: 10px; }
.qa-q { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-bottom: 2px; cursor: pointer; }
.qa-a { font-size: 0.78rem; color: var(--muted); line-height: 1.5; display: none; }
.qa-a.open { display: block; }
.qa-toggle { font-size: 0.7rem; color: var(--muted); margin-left: 4px; }

/* Add to cart button */
.add-btn { display: inline-block; background: var(--accent); color: #fff; border: none; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: opacity 0.15s, transform 0.1s; text-decoration: none; white-space: nowrap; margin-top: 8px; }
.add-btn:hover { opacity: 0.9; transform: translateY(-1px); text-decoration: none; }
.add-btn.added { background: var(--green); }

/* ─── Synergies ──────────────────────────────────────────────────────────── */
.synergy-section { margin-top: 24px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.synergy-section h3 { margin-bottom: 12px; font-size: 1rem; }
.synergy-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(16,185,129,0.1); color: var(--green); padding: 6px 14px; border-radius: 8px; margin: 4px; font-weight: 600; font-size: 0.85rem; border: 1px solid rgba(16,185,129,0.2); }

/* ─── Actions ────────────────────────────────────────────────────────────── */
.compare-actions { margin-top: 28px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 11px 24px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; transition: transform 0.15s, opacity 0.15s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); opacity: 0.9; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: none; color: var(--muted); border: 1px solid var(--border); }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 24px; }
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 24px; }
.quick-picks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 640px; margin: 0 auto; }
.quick-pick { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 0.88rem; transition: border-color 0.2s, background 0.2s; }
.quick-pick:hover { border-color: var(--accent); background: var(--surface2); }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.compare-footer { text-align: center; padding: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .compare-header { padding: 32px 16px 24px; }
  .compare-header h1 { font-size: 1.5rem; }
  .comparison-table th, .comparison-table td { padding: 9px 10px; font-size: 0.82rem; }
  .label-col { width: 100px !important; min-width: 100px !important; font-size: 0.75rem; }
  .bot-col-avatar { width: 40px; height: 40px; font-size: 1rem; }
  .best-overall-banner { flex-direction: column; text-align: center; }
  .quick-match-input { flex-direction: column; }
}

/* ─── Accessibility ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; opacity: 0.6; }
  .cap-bar-fill { transition: none; }
}
