/* TechSwap — Global Stylesheet */

/* ===== CSS Custom Properties ===== */
:root {
  --bg: #0b0f1a;
  --bg-surface: #131929;
  --bg-elevated: #1a2236;
  --border: #1e2d47;
  --border-light: #253552;
  --text: #e2e8f0;
  --text-muted: #8899b4;
  --text-dim: #4a6080;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-dim: #1e3a5f;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --max-width: 900px;
  --max-width-wide: 1200px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== Typography ===== */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--text); margin-bottom: 1rem; }
h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); color: var(--text); margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; color: var(--text); margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; color: var(--text); }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }
code, kbd { font-family: var(--font-mono); font-size: 0.875em; background: var(--bg-elevated); padding: 0.15em 0.4em; border-radius: 4px; color: var(--accent-hover); }
pre { background: var(--bg-elevated); padding: 1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1rem; }
pre code { background: none; padding: 0; }
blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1rem 0; color: var(--text-muted); font-style: italic; }
strong { color: var(--text); font-weight: 600; }

/* ===== Layout ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.container--wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 1.25rem; }
main { flex: 1; padding: 2rem 0 4rem; }

/* ===== Header & Nav ===== */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-logo:hover { color: var(--accent); text-decoration: none; }
.site-logo .logo-accent { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 0.25rem; }
.site-nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--bg-elevated); text-decoration: none; }
.nav-cta {
  background: var(--accent-dim);
  color: var(--accent) !important;
  border: 1px solid var(--accent);
}
.nav-cta:hover { background: var(--accent) !important; color: #fff !important; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
}
.menu-toggle:hover { color: var(--text); background: var(--bg-elevated); }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); text-decoration: none; }
.breadcrumbs .sep { color: var(--text-dim); }

/* ===== Page Header ===== */
.page-header { margin-bottom: 2rem; }
.page-header .meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}
.page-header p.lead { font-size: 1.0625rem; color: var(--text-muted); max-width: 65ch; }

/* ===== Ad Slots ===== */
.ad-slot {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 2rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Verdict Box ===== */
.verdict-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.verdict-box h2 { margin-top: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-size: 0.8125rem; }
.verdict-box p { margin-bottom: 0; color: var(--text-muted); }

/* ===== Comparison Table ===== */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead { background: var(--bg-elevated); }
th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
tr:nth-child(even) td { background: var(--bg-surface); }
tr:hover td { background: var(--bg-elevated); }
.check { color: var(--green); }
.cross { color: var(--red); }
.partial { color: var(--yellow); }
td strong { color: var(--text); }

/* ===== Alternative Cards ===== */
.alt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s;
}
.alt-card:hover { border-color: var(--border-light); }
.alt-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.alt-card-title { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.alt-card-title a { color: inherit; }
.alt-card-title a:hover { color: var(--accent); text-decoration: none; }
.pricing-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}
.alt-card-desc { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 0.9375rem; }
.alt-card ul { color: var(--text-muted); font-size: 0.9rem; }
.alt-card .best-for { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.75rem; }
.alt-card .best-for strong { color: var(--text); }
.alt-card .verdict { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--text-muted); }
.alt-card .verdict strong { color: var(--accent); }

/* ===== FAQ ===== */
.faq-section { margin: 2.5rem 0; }
details {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
details[open] { border-color: var(--border-light); }
summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--accent); font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
details[open] summary::after { content: '−'; }
summary:hover { background: var(--bg-elevated); }
.faq-answer { padding: 0 1.25rem 1rem; color: var(--text-muted); font-size: 0.9375rem; }
.faq-answer p { margin-bottom: 0; }

/* ===== Internal Links ===== */
.related-links {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0;
}
.related-links h3 { margin-top: 0; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 1rem; }
.related-links ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.related-links li { margin: 0; }
.related-links a {
  display: inline-block;
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.related-links a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); text-decoration: none; }

/* ===== Homepage ===== */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 1rem; }
.hero .tagline { font-size: 1.125rem; color: var(--text-muted); max-width: 50ch; margin: 0 auto 2rem; }
.search-bar {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}
.search-bar input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}
.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
}
.category-card:hover { border-color: var(--accent); background: var(--bg-elevated); transform: translateY(-2px); }
.category-card a { color: var(--text); text-decoration: none; display: block; }
.category-card .icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.category-card .name { font-weight: 600; font-size: 0.9375rem; }
.category-card .count { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; }
.comparisons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.comparison-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all 0.15s;
}
.comparison-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.comparison-card a { color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 0.5rem; }
.comparison-card .vs-label { font-size: 0.7rem; color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.comparison-card .vs-tools { font-weight: 700; font-size: 1rem; }
.comparison-card .vs-category { font-size: 0.8125rem; color: var(--text-muted); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.5rem; }
.section-header h2 { margin: 0; }
.section-header a { font-size: 0.875rem; color: var(--accent); }
.tools-az { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.tool-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: all 0.15s;
}
.tool-link:hover { color: var(--accent); background: var(--bg-elevated); text-decoration: none; }
.tool-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
#search-results { display: none; }
#search-results.active { display: block; }

/* ===== Static Pages ===== */
.static-content { max-width: 65ch; }
.static-content h1 { margin-bottom: 0.5rem; }
.static-content .last-updated { color: var(--text-dim); font-size: 0.875rem; margin-bottom: 2rem; }

/* ===== 404 ===== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem;
  gap: 1rem;
}
.error-page .error-code { font-size: 6rem; font-weight: 800; color: var(--border-light); line-height: 1; }
.error-page h1 { margin-bottom: 0.5rem; }
.error-page p { color: var(--text-muted); max-width: 40ch; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border-light); }
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); background: var(--bg-elevated); text-decoration: none; }

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand p { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.75rem; max-width: 28ch; }
.footer-col h4 { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.75rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text-muted); font-size: 0.875rem; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); }
.footer-bottom a:hover { color: var(--text-muted); }

/* ===== Utilities ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mono { font-family: var(--font-mono); }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .site-nav { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); padding: 1rem; gap: 0.25rem; }
  .site-nav.open { display: flex; }
  .site-header { position: relative; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .comparisons-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .ad-slot, .related-links { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
