/* Design switch + logo stanga + panou comparatie */

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55em;
  flex-shrink: 0;
  z-index: 50;
}

.theme-toggle,
.design-switch {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4em;
  height: 2.4em;
  color: inherit;
  opacity: 0.8;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
  background: var(--surface-muted);
  font-family: "Inter", sans-serif;
  cursor: pointer;
  line-height: 0;
  text-transform: none;
  letter-spacing: normal;
  min-width: 0;
  margin: 0;
  box-shadow: none;
}

.theme-toggle .icon-theme,
.design-switch svg {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.theme-toggle:hover,
.design-switch:hover {
  opacity: 1;
  background-color: var(--header-hover-bg);
  transform: none;
  box-shadow: none;
}

.design-switch {
  position: static;
}

footer .links {
  margin: 0 0 0.4em;
  font-size: 0.9em;
  line-height: 1.8;
}

@media all and (min-width: 64rem) {
  footer .links {
    font-size: 1em;
  }
}

footer .links a {
  color: inherit;
}

header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  text-align: left;
}

.logo-wrap {
  display: inline-block;
  margin: 0;
}

.logo-wrap a {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.site-logo {
  display: block;
  height: 3.4em;
  width: auto;
  max-width: min(100%, 22em);
}

@media all and (min-width: 64rem) {
  .site-logo {
    height: 3.6em;
  }
}

.site-logo-light {
  display: none;
}

[data-theme="light"] .site-logo-dark {
  display: none;
}

[data-theme="light"] .site-logo-light {
  display: block;
}

.comparison {
  width: var(--layout-content-width);
  margin: 2.5em auto 1em;
  padding: 1.35em 1.25em 1.45em;
  border-radius: 1.1em;
  background: var(--surface-panel-strong);
  border: 1px solid var(--border-subtle);
  box-sizing: border-box;
  text-align: left;
  container-type: inline-size;
  container-name: comparison;
}

.comparison.hidden { display: none; }

.comparison-title {
  margin: 0;
  font-size: 1.15em;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}

.comparison-lead {
  margin: 0.45em 0 1.15em;
  text-align: center;
  font-size: 0.82em;
  line-height: 1.45;
  opacity: 0.72;
}

.cmp-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  max-width: none;
  margin: 0;
}

.cmp-item {
  position: relative;
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 5.75rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid var(--border-subtle);
  background: var(--cmp-row-bg, transparent);
}

.cmp-badge {
  position: absolute;
  top: 0;
  left: 0.65rem;
  transform: translateY(-50%);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--theme-green, #5cf9fd);
  background: var(--surface-panel-strong);
  border: 1px solid var(--border-accent);
  line-height: 1.35;
  white-space: nowrap;
  z-index: 1;
}

.cmp-brand {
  min-width: 0;
}

.cmp-brand img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 2rem;
  object-fit: contain;
  object-position: left center;
  border-radius: 0.35rem;
}

.cmp-meter {
  min-width: 0;
}

.cmp-track {
  height: 0.55rem;
  background: var(--surface-track);
  border-radius: 999px;
  overflow: hidden;
}

.cmp-fill {
  height: 100%;
  min-width: 0.35rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a9fd6, #35c9a0);
  transition: width 0.75s ease;
}

.cmp-speed {
  text-align: right;
  font-size: 0.78em;
  line-height: 1.2;
  color: var(--secondary-text-color, #c8c4cc);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cmp-speed strong {
  display: inline;
  font-size: 1.15em;
  font-weight: 800;
  color: var(--primary-text-color);
  letter-spacing: -0.03em;
}

.cmp-speed span {
  font-size: 0.72em;
  font-weight: 600;
  opacity: 0.82;
  margin-left: 0.12em;
}

.cmp-item--baseline {
  --cmp-row-bg: var(--surface-muted);
  border-color: var(--border-subtle);
}

.cmp-item--baseline .cmp-fill {
  background: linear-gradient(90deg, #5b6f86, #7d8fa3);
}

.cmp-item--result {
  --cmp-row-bg: rgba(249, 168, 38, 0.1);
  border-color: rgba(249, 168, 38, 0.35);
}

.cmp-item--result .cmp-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.cmp-item--result .cmp-speed strong {
  color: var(--you-col);
}

.cmp-item--yours {
  --cmp-row-bg: var(--surface-accent);
  border-color: var(--border-accent);
  box-shadow: inset 0 0 0 1px var(--border-accent);
  margin-top: 0.55rem;
  padding-top: 0.75rem;
}

.cmp-item--yours .cmp-fill {
  background: linear-gradient(90deg, var(--chart-fill-start), var(--chart-fill-end));
}

.comparison-note {
  margin: 1.05em 0 0;
  text-align: center;
  font-size: 0.92em;
  line-height: 1.55;
  opacity: 0.88;
}

.comparison-note .cmp-note-brand {
  color: var(--theme-green, #5cf9fd);
  font-weight: 600;
}

@media all and (max-width: 32em) {
  .cmp-item {
    grid-template-columns: 5.5rem minmax(0, 1fr) 4.5rem;
    gap: 0.55rem;
    padding: 0.5rem 0.5rem;
  }

  .cmp-brand img { height: 1.75rem; }
  .cmp-speed strong { font-size: 1.05em; }
  .header-actions { gap: 0.45em; }
  .theme-toggle, .design-switch { width: 2.2em; height: 2.2em; }
  .site-logo { height: 2.8em; }
}

@media all and (min-width: 48em) {
  .comparison {
    padding: 1.5em 1.35em 1.55em;
  }

  .cmp-list {
    gap: 0.65rem;
  }

  .cmp-item {
    grid-template-columns: 8.5rem minmax(0, 1fr) 6.25rem;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
  }

  .cmp-brand img {
    height: 2.25rem;
  }

  .cmp-track {
    height: 0.62rem;
  }

  .cmp-speed {
    font-size: 0.85em;
  }

  .cmp-speed strong {
    font-size: 1.2em;
  }
}

@media all and (min-width: 64rem) {
  .cmp-item {
    grid-template-columns: 10.5rem minmax(0, 1fr) 7.25rem;
    gap: 1.2rem;
    padding: 0.8rem 1.05rem;
  }

  .cmp-brand img {
    height: 2.65rem;
  }

  .cmp-speed {
    font-size: 0.95em;
  }

  .cmp-speed strong {
    font-size: 1.4em;
  }

  .cmp-track {
    height: 0.68rem;
  }

  .comparison-title {
    font-size: 1.25em;
  }

  .comparison-lead {
    font-size: 0.9em;
  }
}

@container comparison (min-width: 40rem) {
  .cmp-speed {
    font-size: 0.95em;
  }

  .cmp-speed strong {
    font-size: 1.45em;
  }
}

.stats-report {
  width: 95%;
  max-width: 52em;
  margin: 2em auto 1em;
  padding: 1.2em 1em 1.4em;
  border-radius: 1em;
  background: var(--surface-panel);
  box-sizing: border-box;
  overflow-x: auto;
}

.stats-report h2 {
  margin: 0 0 0.8em;
  font-size: 1.15em;
  text-align: center;
}

.stats-report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82em;
}

.stats-report th,
.stats-report td {
  padding: 0.45em 0.5em;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
}

.stats-report th {
  font-weight: 700;
  color: var(--theme-green, #5cf9fd);
}

.stats-report td:first-child,
.stats-report th:first-child {
  text-align: left;
  font-weight: 600;
}

.stats-report .mob { color: var(--mob-col); font-size: 0.85em; }
.stats-report .fix { color: var(--fix-col); font-size: 0.85em; }
.stats-report .na { opacity: 0.35; }

.stats-report-note {
  margin: 0.8em 0 0;
  font-size: 0.78em;
  opacity: 0.65;
  text-align: center;
  line-height: 1.4;
}

.comparison-link {
  display: block;
  text-align: center;
  margin-top: 0.8em;
  font-size: 0.95em;
}

.comparison-link a {
  color: var(--theme-green, #5cf9fd);
  font-weight: 600;
}

/* Light mode — panou comparatie + buton share */
[data-theme="light"] .comparison {
  background: #ffffff;
  border: 1px solid rgba(26, 18, 37, 0.14);
  box-shadow:
    0 0.25rem 0.75rem rgba(26, 18, 37, 0.06),
    0 0.65rem 1.6rem rgba(14, 116, 144, 0.08);
}

[data-theme="light"] .comparison-title {
  color: #1a1225;
}

[data-theme="light"] .comparison-lead,
[data-theme="light"] .comparison-note {
  color: #5c5368;
  opacity: 1;
}

[data-theme="light"] .cmp-item--baseline {
  --cmp-row-bg: #f4f1f8;
  border-color: rgba(26, 18, 37, 0.1);
}

[data-theme="light"] .cmp-item--result {
  --cmp-row-bg: #fff7ed;
  border-color: rgba(234, 88, 12, 0.28);
}

[data-theme="light"] .cmp-item--yours {
  --cmp-row-bg: #e8f4f8;
  border-color: rgba(14, 116, 144, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(14, 116, 144, 0.15),
    0 0.15rem 0.5rem rgba(14, 116, 144, 0.08);
}

[data-theme="light"] .cmp-item--yours .cmp-fill {
  background: linear-gradient(90deg, var(--chart-fill-start), var(--chart-fill-end));
}

[data-theme="light"] .cmp-badge {
  color: var(--link-accent-color);
  background: #ffffff;
  border-color: rgba(14, 116, 144, 0.35);
}

[data-theme="light"] .cmp-track {
  background: rgba(26, 18, 37, 0.1);
}

[data-theme="light"] .comparison-note .cmp-note-brand {
  color: var(--link-accent-color);
}
