/* Common styles for JanusMesh supplementary viewers (from ECCV supplementary) */

html, body {
  background-color: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
}

.section {
  font-size: 40px;
  font-weight: bold;
  text-align: center;
  margin-top: 10px;
}

.subsubsection {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  padding: 10px 20px;
  background: #f5f5f5;
  border-radius: 25px;
  text-decoration: none;
  color: #666;
  font-size: 14px;
  transition: all 0.25s ease;
}

.back-link:hover {
  background: #333;
  color: white;
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.gif-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 30px;
  background: #fafafa;
  border-radius: 20px;
  overflow-anchor: none;
}

.gif-title {
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.gif-wrapper {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  overflow-anchor: none;
}

.gif-wrapper img,
.gif-wrapper video {
  width: 100%;
  display: block;
  vertical-align: middle;
}

.gif-wrapper img {
  transition: transform 0.3s ease;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  margin-top: 25px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: #555;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  font-size: 18px;
}

.nav-btn:hover {
  background: #333;
  transform: scale(1.05);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.counter {
  font-size: 18px;
  min-width: 100px;
}

.counter .current {
  font-weight: bold;
  font-size: 24px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin-top: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #555;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.thumbnail-section {
  margin-top: 20px;
}

.thumbnail-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 10px 5px;
  max-height: 220px;
  overflow-y: auto;
}

.thumbnail-strip::-webkit-scrollbar {
  width: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.thumbnail-strip::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.thumbnail-strip::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.thumbnail-item {
  padding: 8px 14px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s ease;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumbnail-item:hover {
  border-color: #999;
  color: #333;
}

.thumbnail-item.active {
  border-color: #333;
  color: #000;
  background: #f5f5f5;
  font-weight: bold;
}

.keyboard-hint {
  margin-top: 15px;
  color: #999;
  font-size: 13px;
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  margin: 0 3px;
}

/* -------------------------------------------------------------------------- */
/* 2-object 5-up comparison (pages/2-object-clip, 2-object-fix)                 */
/* (Merged here so a single CSS request always includes layout; was compare-viewer) */
/* -------------------------------------------------------------------------- */

.compare-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 0.75rem 2rem;
}

.compare-main-title {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0.5rem auto 1.25rem;
  line-height: 1.4;
  max-width: 52rem;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem 0.5rem;
  align-items: start;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .compare-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

.compare-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.compare-method-header {
  border-radius: 10px;
  padding: 0.45rem 0.4rem 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  background: #ededed;
  color: #222;
  border: 1px solid #d8d8d8;
}

.compare-method-header strong {
  display: block;
  font-size: 0.74rem;
  margin-bottom: 0.2rem;
}

.compare-method-header .runtime {
  display: block;
  font-size: 0.72rem;
  color: #666;
  font-weight: 500;
}

.compare-method-header--ours {
  background: #3a3a3a;
  color: #fff;
  border-color: #2a2a2a;
}

.compare-method-header--ours .runtime {
  color: #ccc;
}

.compare-video-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.4rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.compare-video-card video {
  width: 100%;
  display: block;
  border-radius: 6px;
  background: #fafafa;
  max-height: 36vh;
  object-fit: contain;
}

body .gif-container.compare-gif-container {
  max-width: 1560px;
}

body.compare-page .thumbnail-strip {
  max-height: 200px;
}
