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

body {
  background: #1b1b1b;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

/* Country navigation */
.country-nav {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
}

.country-link {
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s, filter 0.2s;
  filter: grayscale(80%);
  display: flex;
  align-items: center;
}

.country-link img {
  display: block;
}

.country-link:hover {
  opacity: 1;
  filter: grayscale(0%);
}

.country-link.active {
  opacity: 1;
  filter: grayscale(0%);
}

.region-label {
  color: #888;
  font-size: 12px;
  margin-right: 4px;
  align-self: center;
}

.region-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #ccc;
  z-index: 1000;
}

.region-banner a {
  color: #4ade80;
  text-decoration: none;
  font-weight: 500;
}

.region-banner a:hover {
  text-decoration: underline;
}

.region-banner-close {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.region-banner-close:hover {
  color: #fff;
}

h1 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #fff;
}

/* Logo styling */
.logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.logo-gpu {
  color: #4ade80;
}

.logo-dojo {
  color: #fff;
  position: relative;
}

.logo-dojo::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 2px;
}

.tagline {
  color: #aaa;
  margin-bottom: 8px;
  font-size: 14px;
}

.explainer {
  color: #888;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* Pick cards - curated GPU recommendations */
.pick-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.pick-card {
  background: #252525;
  border: 2px solid #333;
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 2px 16px;
  text-align: left;
}

.pick-card:hover {
  background: #2a2a2a;
}

/* Badge - category label (top left) */
.pick-badge {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Model name (below badge) */
.pick-model {
  grid-column: 1;
  grid-row: 2;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

/* Spec - VRAM (below model) */
.pick-spec {
  grid-column: 1;
  grid-row: 3;
  font-size: 12px;
  color: #777;
}

/* Price (top right) */
.pick-price {
  grid-column: 2;
  grid-row: 1;
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}

/* Note (below price, spans remaining rows) */
.pick-note {
  grid-column: 2;
  grid-row: 2 / 4;
  font-size: 11px;
  color: #777;
  line-height: 1.4;
  text-align: right;
  align-self: center;
}

/* Budget pick - green theme */
.pick-budget { border-color: #2d5a3d; }
.pick-budget:hover { border-color: #4ade80; }
.pick-budget.active { border-color: #4ade80; background: #1a2f1a; }
.pick-budget .pick-badge { color: #4ade80; }
.pick-budget .pick-price { color: #4ade80; }

/* Mid-range pick - blue theme */
.pick-mid { border-color: #2d4a6a; }
.pick-mid:hover { border-color: #60a5fa; }
.pick-mid.active { border-color: #60a5fa; background: #1a2535; }
.pick-mid .pick-badge { color: #60a5fa; }
.pick-mid .pick-price { color: #60a5fa; }

/* Power pick - orange theme */
.pick-power { border-color: #5a4a2d; }
.pick-power:hover { border-color: #f59e0b; }
.pick-power.active { border-color: #f59e0b; background: #2a2215; }
.pick-power .pick-badge { color: #f59e0b; }
.pick-power .pick-price { color: #f59e0b; }

@media (max-width: 1000px) {
  .pick-cards {
    grid-template-columns: 1fr;
  }
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: #252525;
  border: 1px solid #333;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  padding: 6px 10px;
  background: #1b1b1b;
  border: 1px solid #444;
  color: #eee;
  border-radius: 4px;
  font-size: 13px;
  min-width: 140px;
}

.filter-group select:focus {
  outline: none;
  border-color: #6cb6ff;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn-primary, .btn-secondary {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: #4ade80;
  color: #000;
}

.btn-primary:hover {
  background: #22c55e;
}

.btn-secondary {
  background: #444;
  color: #eee;
}

.btn-secondary:hover {
  background: #555;
}

.results-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.results-count {
  font-size: 13px;
  color: #888;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a2a;
  white-space: nowrap;
}

th {
  background: #252525;
  color: #ccc;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 20px;
}

th.sortable:hover {
  color: #fff;
  background: #303030;
}

th.sortable::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  opacity: 0.3;
}

th.sortable:hover::after {
  border-top-color: #888;
  margin-top: 2px;
}

th.sort-asc::after {
  border-bottom-color: #4ade80;
  border-top-color: transparent;
  margin-top: -2px;
  opacity: 1;
}

th.sort-desc::after {
  border-top-color: #4ade80;
  border-bottom-color: transparent;
  margin-top: 2px;
  opacity: 1;
}

tr:hover {
  background: #252525;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 1%;
}

.col-sm {
  width: 1%;
}

.value {
  font-weight: bold;
  color: #fff;
}

.best {
  color: #4ade80;
  font-weight: bold;
}

.gd {
  color: #fbbf24;
  font-weight: 500;
}

.speed-score {
  color: #22d3ee;
  font-weight: 500;
}

.link a {
  text-decoration: none;
}

.link a:hover {
  text-decoration: underline;
}

/* Model name links */
td a:not(.source-amazon):not(.source-ebay):not(.source-newegg):not(.buy-btn) {
  color: #6cb6ff;
  text-decoration: none;
}

td a:not(.source-amazon):not(.source-ebay):not(.source-newegg):not(.buy-btn):hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* GPU-specific: Architecture colors (muted) */
.arch {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* NVIDIA - subtle greens/blues */
.arch-pascal { color: #888; }
.arch-maxwell { color: #888; }
.arch-volta { color: #9a8fbc; }
.arch-turing { color: #7da3c4; }
.arch-ampere { color: #7eb89a; }
.arch-ada { color: #a39bc9; }
.arch-hopper { color: #c9a86c; }
.arch-blackwell { color: #6eb8c4; }
.arch-kepler { color: #888; }

/* AMD - subtle reds/oranges */
.arch-rdna2 { color: #c48a7d; }
.arch-rdna3 { color: #c99a6e; }
.arch-vega { color: #b88a9e; }
.arch-cdna { color: #b87d7d; }
.arch-cdna2 { color: #c4896a; }
.arch-cdna3 { color: #c9a06a; }

/* Intel - subtle blue */
.arch-xe { color: #7a9ec4; }

/* VRAM Tier badges (muted) */
.tier {
  font-size: 12px;
  font-weight: 500;
}

.tier-78b { color: #b88a8a; }
.tier-14b { color: #b8a87a; }
.tier-1430b { color: #9ab87a; }
.tier-30b { color: #7ab893; }
.tier-70b { color: #7ab0b8; }

/* Condition indicators */
.condition {
  font-size: 12px;
}

.cond-new {
  color: #22c55e;
}

.cond-used {
  color: #aaa;
}

/* Source/Link styling */
a.source-amazon {
  color: #fb923c;
}

a.source-ebay {
  color: #60a5fa;
}

a.source-newegg {
  color: #aaa;
}

/* GPU-specific: Specs styling */
.cores, .bw, .tdp, .speed {
  color: #aaa;
  font-size: 13px;
}

footer {
  border-top: 1px solid #333;
  padding-top: 16px;
  color: #888;
  font-size: 13px;
}

footer a {
  color: #6cb6ff;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

footer p {
  margin: 0 0 8px;
}

footer .note {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.loading {
  color: #888;
  padding: 40px 0;
}

.error {
  color: #f87171;
  padding: 40px 0;
}

/* Main layout with sidebar */
.main-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.content {
  flex: 1;
  min-width: 0;
}

.info-panels {
  flex-shrink: 0;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-panel {
  background: #252525;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 13px;
}

.info-panel h3 {
  font-size: 13px;
  color: #fff;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-panel p {
  color: #aaa;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.info-panel p:last-child {
  margin-bottom: 0;
}

.info-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-panel li {
  color: #aaa;
  margin: 4px 0;
  line-height: 1.4;
}

.info-panel strong {
  color: #ccc;
}

.info-panel a {
  color: #6cb6ff;
  text-decoration: none;
}

.info-panel a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .info-panels {
    display: none;
  }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
    font-size: 13px;
  }

  th, td {
    padding: 8px 6px;
  }

  h1 {
    font-size: 20px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group select {
    min-width: 100%;
  }

  .filter-actions {
    margin-left: 0;
    margin-top: 8px;
  }
}
