body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background-color: #f8f9fa;
  padding: 30px;
  color: #333;
}

.comparison-box {
  background: #ffffff;
  border-radius: 12px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  margin-top: 2.5rem;
  position: relative; /* so nav buttons can be absolutely positioned */
  overflow: hidden;   /* hide partial slides */
}

/* === Rolling window === */
.scroll-window {
  display: flex;               /* lay slides in a row */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory; /* force one-by-one snapping */
  scroll-snap-stop: always;      /* stop at each slide */
}

.slide {
  flex: 0 0 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column; /* Stack vertically */
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  padding: 0rem;
  box-sizing: border-box;
  scroll-snap-align: start;
}

.slide img {
  max-height: 600px;            /* keep height consistent */
  max-width: 100%;              /* don’t overflow horizontally */
  height: auto;
  width: auto;                  /* let image keep its natural aspect */
}

.slide video {
  border: none;
  margin-bottom: 0;
  display: block; /* removes default inline spacing */
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  justify-content: center;
}

.table-scroll > table {
  min-width: 1200px; /* or wider if your table is wider */
  margin: 0 auto;
}

/* Optional: Hide scrollbar on WebKit browsers */
.scroll-window::-webkit-scrollbar {
  display: none;
}

/* === Navigation buttons === */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s;
  z-index: 2;
}

.nav-btn:hover {
  background: #f0f0f0;
}

.left-btn {
  left: 20px; /* slightly outside the card */
}

.right-btn {
  right: 20px; /* slightly outside the card */
}

@media (max-width: 768px) {
  .left-btn,
  .right-btn {
    display: none; /* hide buttons on small screens, touch scroll instead */
  }
}

/* === Caption === */
.caption {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
}

h1 {
  font-size: 24px;
  margin-bottom: 0.5em;
}

p {
  margin: 0 0 10px;
  font-size: 15px;
  color: #555;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

th, td {
  padding: 10px 12px;
  text-align: center;
}

th {
  background-color: #e9ecef;
  color: #fff;
}

td {
  border-top: 1px solid #dee2e6;
}

tr:nth-child(even) td:not(.group-header) {
  background-color: #f1f3f5;
}

td.model {
  text-align: left;
  font-weight: 500;
}

td.model u {
  text-decoration: underline;
  text-underline-offset: 4px;
}

td.model b {
  color: #1d3557;
}

.group-header {
  background-color: #dee2e6;
  font-weight: bold;
  text-align: left;
  font-size: 15px;
  padding: 8px 10px;
  color: #212529;
}

tr:hover td {
  background-color: #e2e6ea;
}

b {
  color: #E0713F;
}

u {
  text-decoration: underline #495057;
}

caption {
  caption-side: top;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
}

.table-scroll-window {
  display: flex;
  overflow-x: hidden; /* <-- Important: disable horizontal scroll for user */
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.table-scroll-window-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
  box-sizing: border-box;
  width: fit-content !important;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch;
  margin-inline: auto;              
}

.table-scroll table {
  width: auto !important;
  min-width: unset !important;
  max-width: unset !important;
  table-layout: auto !important;
}

.table-scroll-window table,
.table-scroll-window th,
.table-scroll-window td {
  /* font-family: "Times New Roman", Times, "Nimbus Roman No9 L",
              "Liberation Serif", Georgia, serif !important; */
  /* Optional: nicer numeric alignment for metrics tables */
  /* font-variant-numeric: tabular-nums lining-nums; */
  font-size: 16px;
}

/* ---- Palette for tables ---- */
:root{
  --tbl-bg: #ffffff;
  --tbl-thead-bg: #e5e7eb;   /* header gray (darker) */
  --tbl-group-bg: #f2f4f7;   /* group header gray (lighter) */
  --tbl-border: #dfe3e6;
}

/* Base */
.table-scroll-window table { background: var(--tbl-bg); border-collapse: collapse; }
.table-scroll-window th,
.table-scroll-window td {
  background: var(--tbl-bg);              /* reset to white */
  border-top: 1px solid var(--tbl-border);
  text-align: center !important;
}

/* Keep the first column (method names) left-aligned in the BODY */
.table-scroll-window table tbody td:first-child {
  text-align: left !important;
}

/* Header row */
.table-scroll-window thead th{
  background: var(--tbl-thead-bg);
  color: #111;               /* better contrast than white on light gray */
  font-weight: 600;
}

/* --- Remove zebra and hover backgrounds (override earlier rules) --- */
/* keep rows white but DO NOT override the group headers */
/* .table-scroll-window tbody tr:nth-child(even) td:not(.group-header) {
  background: var(--tbl-bg) !important;
} */

.table-scroll-window tbody tr:hover td:not(.group-header) {
  background: var(--tbl-bg) !important;
}

.table-scroll-window td.group-header{
  background: var(--tbl-group-bg) !important;
  color: #111;
  font-weight: bold;          /* not bold */
  text-align: left;
}

/* ---- Center the group titles over their 3 sub-columns ---- */
.table-scroll-window thead tr:first-child th[colspan="3"]{
  text-align: center !important;   /* override Bulma's left align */
  vertical-align: bottom;          /* sit closer to the metric row */
  padding-bottom: .35rem;          /* a bit of spacing above the PSNR row */
}

/* Keep the second header row centered as well (PSNR / SSIM / LPIPS) */
.table-scroll-window thead tr:nth-child(2) th{
  text-align: center !important;
}

/* Center the two-row headers ("Method" and "Time (s)") */
.table-scroll-window thead th[rowspan="2"]{
  text-align: left !important;
  vertical-align: middle !important;/* vertical centering across the two rows */
}

.table-scroll-window thead th:last-child[rowspan="2"]{
  text-align: center !important;
  vertical-align: middle !important;/* vertical centering across the two rows */
}

.table-scroll-window td.our-method { color:#E0713F; font-weight:700; }
.table-scroll-window td.our-method b { color:inherit; }

/* .table-scroll-window tbody tr td:last-child u{
  text-decoration: none !important;
  border-bottom: 0 !important;
} */