/* Nerfies-style project page CSS */
body {
  font-family: 'Noto Sans', sans-serif;
}

.footer .icon-link {
  font-size: 25px;
  color: #000;
}

.link-block a {
  margin-top: 5px;
  margin-bottom: 5px;
}

.publication-title {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
}

.publication-venue {
  color: #555;
  font-weight: bold;
  font-family: 'Google Sans', sans-serif;
}

.publication-awards {
  color: #ff3860;
  font-weight: bolder;
  font-family: 'Google Sans', sans-serif;
}

.publication-links {
  margin-top: 10px;
}

.hero-body .container {
  max-width: 960px;
}

.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 3rem;
}

.teaser-video .hero-body {
  padding-top: 0;
  padding-bottom: 0;
}

.results-carousel {
  overflow: hidden;
}

.results-carousel .item {
  margin: 5px;
  overflow: hidden;
  padding: 20px;
  font-size: 0;
}

.results-carousel video {
  margin: 0;
}

#overlay {
  font-size: 1.0rem;
  margin: 0;
  padding: 5px;
}

/* Custom table styling */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.results-table th,
.results-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

.results-table th {
  background-color: #f5f5f5;
  font-weight: 600;
  border-bottom: 2px solid #333;
}

.results-table td:first-child,
.results-table th:first-child {
  text-align: left;
}

.results-table tr:hover {
  background-color: #fafafa;
}

.results-table .best {
  font-weight: 700;
}

.results-table .ours-row {
  background-color: #fff8e1;
}

.results-table .header-group {
  border-bottom: 1px solid #999;
}

/* Color-coded task rows for real robot table */
.task-handover {
  background-color: rgba(242, 215, 199, 0.5);
}

.task-drop {
  background-color: rgba(196, 208, 224, 0.5);
}

.task-flick {
  background-color: rgba(212, 190, 211, 0.5);
}

.task-pour {
  background-color: rgba(199, 224, 205, 0.5);
}

/* Inline signal name highlights */
.sig-mot { color: #f26722; font-weight: 700; }
.sig-act { color: #2a5bd8; font-weight: 700; }

/* Two-column task grid */
.task-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.task-grid figure { margin: 0; }

.task-grid img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.task-grid figcaption {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.4rem;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .task-grid { grid-template-columns: 1fr; }
}

/* Section spacing */
.section {
  padding: 3rem 1.5rem;
}

/* ===== Side-by-side comparison videos (Baseline vs Ours) ===== */
.video-compare {
  margin: 1.25rem 0 0.5rem 0;
}

.video-compare .column {
  padding: 0.6rem;
}

.vid-label {
  text-align: center;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.vid-label-wrap {
  text-align: center;
}

.vid-label-baseline {
  color: #b33636;
  background: rgba(231, 76, 60, 0.10);
}

.vid-label-ours {
  color: #1f7a3d;
  background: rgba(46, 160, 67, 0.12);
}

.video-wrap {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  background: #000;
}

.video-wrap video {
  display: block;
  width: 100%;
}

.compare-caption {
  font-size: 1rem;
  color: #363636;
  text-align: left;
  margin: 0.75rem 0 0 0;
  line-height: 1.5;
}

/* Video placeholder styling */
.video-placeholder {
  background: #f0f0f0;
  border: 3px dashed #ccc;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  color: #888;
  margin: 1rem 0;
}

/* Smaller placeholder used inside comparison columns */
.video-wrap.placeholder {
  background: #f4f4f4;
  border: 2px dashed #ccc;
  box-shadow: none;
  color: #999;
  text-align: center;
  padding: 48px 16px;
}

.video-wrap.placeholder i {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.5rem;
  color: #bbb;
}

.video-wrap.placeholder .fname {
  font-family: monospace;
  font-size: 0.8rem;
  color: #aaa;
  word-break: break-all;
}

.video-placeholder i {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  color: #bbb;
}

.video-placeholder p {
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

/* Interpolation panel for side-by-side content */
.interpolation-panel {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
}

/* Improvement badge */
.improvement {
  color: #e74c3c;
  font-weight: 700;
}

/* Method figure */
.method-figure img {
  border-radius: 4px;
}

/* Abstract text */
.abstract-text {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Real robot experiment cards */
.experiment-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.experiment-card img {
  width: 100%;
  display: block;
}

/* BibTeX code block */
#BibTeX pre {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
}

/* Sidebar navigation */
.sidebar-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
  font-family: 'Google Sans', sans-serif;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  max-width: 170px;
}

.sidebar-nav .sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  padding: 0 10px 6px 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 6px;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav li {
  margin: 2px 0;
}

.sidebar-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: #777;
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: #222;
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-nav a.active {
  color: #2a5bd8;
  font-weight: 600;
  border-left-color: #2a5bd8;
  background: rgba(42, 91, 216, 0.07);
}

/* Nested sub-section links */
.sidebar-nav .nav-group > a { font-weight: 600; color: #555; }
.sidebar-nav .nav-sub { list-style: none; margin: 1px 0 4px 0; padding: 0; }
.sidebar-nav .nav-sub a { padding: 4px 10px 4px 22px; font-size: 0.78rem; color: #9a9a9a; }

/* Hide sidebar on smaller screens */
@media screen and (max-width: 1280px) {
  .sidebar-nav {
    display: none;
  }
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .results-table {
    font-size: 0.8rem;
  }

  .results-table th,
  .results-table td {
    padding: 6px 8px;
  }
}

/* ===== Interactive failure-mode stacked bar chart ===== */
.fmbar {
  max-width: 720px;
  margin: 1.25rem auto 0 auto;
}

.fmbar-row {
  display: flex;
  align-items: center;
  margin: 10px 0;
}

.fmbar-label {
  flex: none;
  width: 78px;
  text-align: right;
  padding-right: 12px;
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.fmbar-row.ours .fmbar-label {
  color: #1f7a3d;
}

.fmbar-track {
  display: flex;
  flex: 1;
  height: 34px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.fmbar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: default;
  transition: filter 0.12s ease;
  overflow: hidden;
}

.fmbar-seg.light {
  color: #333;
}

.fmbar-seg:hover {
  filter: brightness(1.08) saturate(1.1);
}

.fmbar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: #555;
}

.fmbar-legend .key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fmbar-legend i {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  display: inline-block;
}

.fmbar-tooltip {
  position: fixed;
  pointer-events: none;
  background: #222;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -115%);
  transition: opacity 0.1s ease;
  white-space: normal;
  max-width: 240px;
  width: max-content;
  z-index: 2000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ===== Cross-reference tags linking webpage blocks to the paper ===== */
.paper-ref {
  font-size: 0.8rem;
  color: #9a9a9a;
  font-style: italic;
  margin-top: 0.4rem;
  text-align: center;
}

/* ===== Vertical failure-mode breakdown bar (beside rollout videos) ===== */
.fmbar-vcol {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 2px;
}
.fmbar-vlabel {
  font-family: 'Google Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: #333;
  margin-bottom: 6px;
}
.fmbar-vcol.ours .fmbar-vlabel { color: #1f7a3d; }
.fmbar-vtrack {
  display: flex;
  flex-direction: column-reverse;   /* success (first child) sits at the bottom */
  width: 46px;
  flex: 1 1 auto;
  min-height: 90px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.fmbar-vtrack .fmbar-seg { width: 100%; font-size: 0.78rem; }

/* Inline success-rate note under each rollout video */
.vid-success { text-align: center; font-size: 0.9rem; color: #666; margin-top: 6px; }
.vid-success b { font-size: 1.1rem; font-weight: 800; }
.vid-success.ours b { color: #2E8B57; }
.vid-success.base b { color: #C0392B; }
