/* -------------------------------------------------------
   GPU Benchmark Comparator - Styles
   ------------------------------------------------------- */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2e3345;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #6c63ff;
  --accent-hover: #8078ff;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 8px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* -------------------------------------------------------
   Layout
   ------------------------------------------------------- */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
}

nav a {
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
nav a:hover,
nav a:focus {
  background: var(--border);
  color: var(--text);
  text-decoration: none;
}

section {
  padding: 2.5rem 0;
}

section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.25rem;
}

section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* -------------------------------------------------------
   Ad Slots
   ------------------------------------------------------- */

.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 2rem 0;
}

/* -------------------------------------------------------
   Controls
   ------------------------------------------------------- */

select,
input[type="number"] {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239aa0b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--accent);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.controls-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* -------------------------------------------------------
   Comparison Grid
   ------------------------------------------------------- */

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.comparison-header,
.comparison-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.comparison-header {
  background: var(--surface);
  font-weight: 600;
}

.comparison-header > div,
.comparison-row > div {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.comp-label {
  color: var(--text-muted);
  font-weight: 500;
}

.comp-gpu-name {
  text-align: center;
  color: var(--accent);
}

.comp-value {
  text-align: center;
}

.comp-value.winner {
  color: var(--green);
  font-weight: 600;
}

.comp-value.loser {
  color: var(--text-muted);
}

.highlight-row > div {
  background: rgba(108, 99, 255, 0.08);
  font-weight: 600;
}

.affiliate-links-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.affiliate-links {
  text-align: center;
  font-size: 0.8rem;
}

.affiliate-links a {
  margin: 0 0.25rem;
  padding: 0.2rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
}
.affiliate-links a:hover {
  background: var(--border);
  text-decoration: none;
}

.affiliate-label {
  color: var(--text-muted);
}

/* -------------------------------------------------------
   "Can it run?" badges
   ------------------------------------------------------- */

.model-requirements {
  margin-bottom: 1rem;
}

.model-requirements h4 {
  margin-bottom: 0.5rem;
}

.req-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-fp16 {
  background: rgba(108, 99, 255, 0.2);
  color: var(--accent);
}
.badge-int8 {
  background: rgba(251, 191, 36, 0.2);
  color: var(--yellow);
}
.badge-int4 {
  background: rgba(52, 211, 153, 0.2);
  color: var(--green);
}

.status-yes {
  color: var(--green);
  font-weight: 600;
}
.status-no {
  color: var(--red);
  font-weight: 600;
}

/* -------------------------------------------------------
   Data Tables
   ------------------------------------------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table thead th {
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  position: sticky;
  top: 0;
}

.data-table tbody tr:hover {
  background: rgba(108, 99, 255, 0.05);
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Type badges */
.type-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.type-consumer {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}
.type-datacenter {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
}
.type-apple {
  background: rgba(251, 191, 36, 0.15);
  color: var(--yellow);
}

/* -------------------------------------------------------
   Bar chart in rankings
   ------------------------------------------------------- */

.bar-cell {
  width: 100%;
  min-width: 120px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  height: 18px;
}

.bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* -------------------------------------------------------
   SEO content section
   ------------------------------------------------------- */

.seo-content {
  color: var(--text-muted);
  line-height: 1.8;
}

.seo-content h2 {
  color: var(--text);
}

.seo-content h3 {
  color: var(--text);
  margin-top: 1.25rem;
}

.seo-content p {
  margin-bottom: 0.75rem;
}

.seo-content ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.seo-content li {
  margin-bottom: 0.35rem;
}

/* -------------------------------------------------------
   Empty state
   ------------------------------------------------------- */

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* -------------------------------------------------------
   Responsive
   ------------------------------------------------------- */

@media (max-width: 700px) {
  header h1 {
    font-size: 1.25rem;
  }

  .comparison-header > div,
  .comparison-row > div {
    padding: 0.45rem 0.4rem;
    font-size: 0.8rem;
  }

  .affiliate-links-row {
    grid-template-columns: 1fr;
  }

  .data-table th,
  .data-table td {
    padding: 0.4rem 0.45rem;
    font-size: 0.78rem;
  }

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

  .controls-row label {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls-row select,
  .controls-row input {
    width: 100%;
  }
}
