body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 18px;
}


.footer a {
    /*font-size: 25px;*/
    color: #000;
}

.large-font {
    font-size: 25px;
}

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

.dnerf {
  font-variant: small-caps;
}


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

.teaser {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}


.publication-title {
}

.publication-banner {
  max-height: parent;

}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: fit;
}

.publication-header .hero-body {
}

.publication-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.publication-authors {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.publication-venue {
    color: #555;
    width: fit-content;
    font-weight: bold;
}

.publication-awards {
    color: #ff3860;
    width: fit-content;
    font-weight: bolder;
}

.publication-authors {
}

.publication-authors a {
   color: hsl(204, 86%, 53%) !important;
}

.publication-authors a:hover {
    text-decoration: underline;
}

.author-block {
  display: inline-block;
}

.publication-banner img {
}

.publication-authors {
  /*color: #4286f4;*/
}

.publication-video {
    position: relative;
    width: 95%;
    height: 0;
    padding-bottom: 53%;
    margin: auto;
    overflow: hidden;
    border: 2px solid #bbb;
    border-radius: 10px !important;
}

.publication-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.publication-body img {
}

.results-carousel {
  overflow: hidden;
}

.results-carousel .item {
  margin: 5px;
  overflow: hidden;
  border: 1px solid #bbb;
  border-radius: 10px;
  padding: 0;
  font-size: 0;
}

.results-carousel video {
  margin: 0;
}


.interpolation-panel {
  background: #f5f5f5;
  border-radius: 10px;
  padding-top: 25px;
  padding-bottom: 25px;
  padding-left: 15px;
  padding-right: 15px;
}

.interpolation-panel .interpolation-image {
  width: 100%;
  border-radius: 5px;
}

.interpolation-video-column {
}

.interpolation-panel .slider {
  margin: 0 !important;
}

.interpolation-panel .slider {
  margin: 0 !important;
}

#interpolation-image-wrapper {
  width: 100%;
}
#interpolation-image-wrapper img {
  border-radius: 5px;
}

.bottom_buttons[disabled] {
  opacity: .4;
}

.brmod {
  display: block;
  margin-top: 0.5em;
}

/* Base Height Control Video Showcase */
.video-showcase {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.video-showcase h4 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.4em;
  font-weight: 600;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.video-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.video-item {
  background: white;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.video-item h5 {
  color: #34495e;
  margin-bottom: 10px;
  font-size: 1.1em;
  font-weight: 500;
  text-align: center;
}

.video-container {
  position: relative;
  width: 100%;
  border-radius: 6px;
  border: 1px solid #ddd;
  overflow: hidden;
}

.video-cover {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  cursor: pointer;
  overflow: hidden;
}

.formula-cover {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.8) 0%, rgba(233, 236, 239, 0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #dee2e6;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}

.formula-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: 0;
}

.formula-cover .video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  z-index: 0;
}

.formula-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1em;
  font-weight: 400;
  color: #495057;
  text-align: center;
  padding: 20px;
  line-height: 1.4;
  position: absolute;
  z-index: 1;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  max-width: 90%;
}

.formula-text .height-value {
  color: #dc3545;
  font-weight: bold;
}

.cover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  z-index: 2;
}

.video-cover:hover .cover-overlay {
  background: rgba(0, 0, 0, 0.5);
}

/* Video cover play button - use specific selector to avoid conflicts with timeline play button */
.video-cover .play-button {
  width: 60px;
  height: 60px;
  background: rgba(0, 123, 255, 0.9) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.video-cover .play-button i {
  font-size: 24px;
  color: white;
  margin-left: 4px;
}

.video-cover:hover .play-button {
  transform: scale(1.1);
  background: rgba(0, 123, 255, 1) !important;
}

.video-container video {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

.video-item .reward-formula {
  margin-top: 10px;
  text-align: center;
  font-size: 0.9em;
  color: #2c3e50;
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
  width: 100%;
  box-sizing: border-box;
}

.video-item .reward-formula * {
  white-space: nowrap !important;
}

.video-item .reward-formula .MathJax,
.video-item .reward-formula .MathJax_Display,
.video-item .reward-formula .katex,
.video-item .reward-formula .katex-display {
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
  width: 100%;
  min-width: fit-content;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .video-grid-2x2 {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 15px;
  }
  
  /* Gallery responsive styles for narrow screens */
  #goal-reaching .container,
  #motion-tracking .container,
  #reward-optimization .container {
    max-width: 95% !important;
    width: 95% !important;
    padding: 20px 10px !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure all formula containers allow horizontal scrolling on mobile */
  .reward-formula,
  .formula,
  .video-item .reward-formula,
  .inference-card-content .formula {
    overflow-x: auto !important;
    overflow-y: visible !important;
    white-space: nowrap !important;
    width: 100% !important;
    min-width: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .reward-formula *,
  .formula *,
  .video-item .reward-formula *,
  .inference-card-content .formula * {
    white-space: nowrap !important;
  }
  
  .reward-formula .MathJax,
  .reward-formula .MathJax_Display,
  .formula .MathJax,
  .formula .MathJax_Display,
  .video-item .reward-formula .MathJax,
  .video-item .reward-formula .MathJax_Display,
  .inference-card-content .formula .MathJax,
  .inference-card-content .formula .MathJax_Display {
    overflow-x: auto !important;
    overflow-y: visible !important;
    white-space: nowrap !important;
    width: 100% !important;
    min-width: fit-content !important;
  }
  
  /* Support for pre and code tags on mobile */
  pre, code {
    overflow-x: auto !important;
    overflow-y: visible !important;
    white-space: pre !important;
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  pre code {
    white-space: pre !important;
  }
  
  .video-gallery {
    overflow-x: auto; /* Enable horizontal scrolling on mobile */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-snap-type: x mandatory; /* Snap to items when scrolling */
    scroll-behavior: smooth;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 1rem 0 !important;
    box-sizing: border-box !important;
  }
  
  .gallery-container {
    scroll-snap-type: none; /* Disable snap on container, use on items */
  }
  
  .gallery-item {
    scroll-snap-align: start; /* Snap each item when scrolling */
  }
  
  .gallery-container {
    gap: 0.5rem !important;
    width: auto !important; /* Allow container to expand */
    min-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  .gallery-item {
    width: calc(100vw - 140px) !important;
    max-width: calc(100% - 1rem) !important;
    min-width: 180px !important;
    flex-shrink: 0;
    box-sizing: border-box;
  }
  
  .gallery-item video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    box-sizing: border-box;
  }
  
  /* Hide arrow buttons on mobile - use swipe instead */
  .gallery-arrow {
    display: none !important;
  }
}

/* Extra narrow screens */
@media (max-width: 480px) {
  #goal-reaching .container,
  #motion-tracking .container,
  #reward-optimization .container {
    max-width: 95% !important;
    width: 95% !important;
    padding: 10px 5px !important;
    box-sizing: border-box !important;
  }
  
  .video-gallery {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important; /* Enable horizontal scrolling on mobile */
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important; /* Smooth scrolling on iOS */
    scroll-snap-type: x mandatory !important; /* Snap to items when scrolling */
    scroll-behavior: smooth !important;
    margin: 0.5rem 0 !important;
    box-sizing: border-box !important;
  }
  
  .gallery-item {
    scroll-snap-align: start !important; /* Snap each item when scrolling */
  }
  
  .gallery-container {
    width: auto !important; /* Allow container to expand */
    min-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  
  .gallery-item {
    width: calc(100vw - 100px) !important;
    max-width: calc(100% - 0.5rem) !important;
    min-width: 140px !important;
    box-sizing: border-box;
  }
  
  /* Hide arrow buttons on mobile - use swipe instead */
  .gallery-arrow {
    display: none !important;
  }
  
  .gallery-item .video-info {
    padding: 8px !important;
  }
  
  .gallery-item h4 {
    font-size: 0.8rem !important;
  }
  
  .gallery-item p {
    font-size: 0.7rem !important;
  }
}

/* Arm Control Interactive System */

.arm-control-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px 0;
  padding: 20px;
  gap: 40px;
}

.inference-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.inference-control h4 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1.2em;
  font-weight: bold;
  color: #495057;
  margin: 0;
  text-align: center;
}

.wrist-controls {
  display: flex;
  gap: 30px;
}

.wrist-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.wrist-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.wrist-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1em;
  font-weight: bold;
  color: #495057;
}

.button-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px;
  align-items: center;
}

.reward-button {
  padding: 12px 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1em;
  font-weight: bold;
  color: white;
  background: #6c757d;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 80px;
}

.reward-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.reward-button.active {
  background: #007bff;
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.video-display {
  width: 300px;
  height: auto;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.continuous-play-btn {
  margin-top: 15px;
  padding: 10px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1em;
  font-weight: bold;
  color: white;
  background: #007bff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.continuous-play-btn:hover {
  background: #0056b3;
  transform: scale(1.02);
}

.video-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  max-width: 80%;
  max-height: 80%;
  background: white;
  border-radius: 8px;
  padding: 20px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  z-index: 1001;
}

.close-btn:hover {
  color: #000;
}

/* Skill Gallery Styles */
.skill-gallery {
  margin: 30px 0;
  overflow: hidden;
}

.gallery-grid {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 20px 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #007bff #f1f1f1;
}

.gallery-grid::-webkit-scrollbar {
  height: 8px;
}

.gallery-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb {
  background: #007bff;
  border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
  background: #0056b3;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
  width: 300px;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.gallery-video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.play-icon {
  width: 60px;
  height: 60px;
  background: rgba(0, 123, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.gallery-item:hover .play-icon {
  transform: scale(1.1);
  background: rgba(0, 123, 255, 1);
}

.video-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 0.8em;
  font-weight: bold;
  z-index: 10;
}

/* Behavior Diversity Styles */
.diversity-content {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-top: 20px;
}

.diversity-text {
  flex: 2;
}

.diversity-video {
  flex: 1;
  max-width: 300px;
}

.diversity-video video {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  display: block;
}

/* Superscript styles for author contributions */
.superscript {
  font-size: 0.7em;
  vertical-align: super;
  font-weight: bold;
}

/* Full Video Button Styles */
.full-video-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s;
}

.full-video-btn:hover {
  background-color: #c82333;
}

/* Flip Card Styles */
.flip-card {
  background-color: transparent;
  width: 100%;
  height: auto;
  perspective: 1000px;
  display: inline-block;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: auto;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  top: 0;
  left: 0;
  min-height: fit-content;
}

.flip-card-front {
  background-color: #f8f9fa;
}

.flip-card-back {
  background-color: #ffffff;
  transform: rotateY(180deg);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 0.9em;
  line-height: 1.6;
}

.flip-card-front img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* First column card scaling */
.columns .column.is-one-third:first-child .flip-card {
  transform: scale(1.1);
  transform-origin: center;
}

/* Last column card scaling */
.columns .column.is-one-third:last-child .flip-card {
  transform: scale(0.8);
  transform-origin: center;
}

/* Reduce spacing in last column */
.columns .column.is-one-third:last-child .columns {
  margin-bottom: 0;
  gap: 0.5rem;
}

.columns .column.is-one-third:last-child .column {
  padding-bottom: 0.25rem;
  padding-top: 0.25rem;
}

/* Ensure columns are aligned */
.columns.is-centered {
  align-items: flex-start;
}

/* Center content in last column */
.columns .column.is-one-third:last-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Ensure flip effects work */
.columns .column.is-one-third:first-child .flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.columns .column.is-one-third:last-child .flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Flip cards container layout */
.flip-cards-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  min-height: 300px;
  transform: scale(1.1);
  transform-origin: center;
  width: 100%;
  max-width: 800px;
}

/* Left single card */
.flip-card-left {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-right: 0;
}

.flip-card-left .flip-card {
  width: 100%;
  max-width: 250px;
  transform: scale(1.25);
  transform-origin: center;
}

.flip-card-left .flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

/* Right two cards */
.flip-cards-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  padding-left: 0;
}

.flip-cards-right .flip-card-item {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.flip-cards-right .flip-card-item .flip-card {
  width: 100%;
  max-width: 200px;
}

/* Ensure images and fonts don't scale */
.flip-card-front img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transform: scale(1);
  transform-origin: center;
}

.flip-card-back {
  background-color: #ffffff;
  transform: rotateY(180deg);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 0.9em;
  line-height: 1.6;
  font-size: clamp(0.8em, 1vw, 1em);
}

/* Responsive design */
@media (max-width: 768px) {
  .flip-cards-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .flip-card-left .flip-card {
    max-width: 200px;
    transform: scale(1.1);
  }
  
  .flip-cards-right .flip-card-item .flip-card {
    max-width: 150px;
  }
}

/* Video Timeline Styles */
.video-timeline-container {
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  overflow: visible;
  position: relative;
  min-height: 0px;
}

/* Center Goal Reaching main video */
#frameVideo {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Center Motion Tracking highlight video */
#motion-tracking .container video[controls] {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Center Space Interpolation videos */
#space-interpolation video {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Center Disturbance Rejection videos */
#disturbance-rejection video {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.timeline-slider {
  width: 96%;
  height: 8px;
  background: #ccc;
  border-radius: 4px;
  outline: none;
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  margin: 70px 0 0 0;
  -webkit-appearance: none;
  appearance: none;
}

.timeline-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: #ccc;
  border-radius: 4px;
  -webkit-appearance: none;
  /* Dynamic styles will override this */
}

.timeline-slider::-moz-range-track {
  width: 100%;
  height: 8px;
  background: #ccc;
  border-radius: 4px;
  -moz-appearance: none;
  /* Dynamic styles will override this */
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #5a8a2a;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  margin-top: -6px; /* Center the thumb on the track (track height 8px, thumb height 20px, so offset by (20-8)/2 = 6px) */
}

.timeline-slider::-moz-range-thumb {
  -moz-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #5a8a2a;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Fix deprecation warning for slider-vertical */
input[type="range"].slider[orient="vertical"],
input[type="range"].slider.slider-vertical {
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="range"].slider[orient="vertical"]::-webkit-slider-thumb,
input[type="range"].slider.slider-vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"].slider[orient="vertical"]::-moz-range-thumb,
input[type="range"].slider.slider-vertical::-moz-range-thumb {
  -moz-appearance: none;
  appearance: none;
}

.timeline-marks {
  position: relative;
  height: 120px;
  margin-top: 10px;
  margin-bottom: 20px;
  overflow: visible;
  background: transparent;
}

/* Ensure timeline colors are not overridden */
.video-timeline-container .timeline-slider {
  background: #5a8a2a !important;
}

.video-timeline-container .timeline-slider::-webkit-slider-thumb {
  background: #5a8a2a !important;
  margin-top: -6px !important;
}

.video-timeline-container .timeline-slider::-moz-range-thumb {
  background: #5a8a2a !important;
}

.timeline-marks .timeline-slider {
  background: #5a8a2a !important;
}

.timeline-current-time {
  text-align: center;
  margin-top: 30px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  color: #333;
}

/* Play button styles */
/* Goal Reaching timeline play button - use specific selector to avoid conflicts */
.video-timeline-container .play-button {
  position: absolute;
  top: 175px;
  left: 10px;
  width: 40px;
  height: 40px;
  background: #3a6902 !important;
  border: none !important;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 20;
}

.video-timeline-container .play-button:hover {
  background: #2d4f02 !important;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.video-timeline-container .play-button.paused::before {
  content: '▶';
}

.video-timeline-container .play-button.playing::before {
  content: '⏸';
}

/* Inference Cards Styles */
.inference-cards {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.inference-card {
  width: 300px;
  height: 140px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
  background: transparent;
}

.inference-card:nth-child(1) {
  border: 3px solid #3a6902;
}

.inference-card:nth-child(2) {
  border: 3px solid #b63620;
}

.inference-card:nth-child(3) {
  border: 3px solid #004bb3;
}

.inference-card:hover {
  transform: scale(1.2);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  z-index: 10;
}

.inference-card-title {
  color: #333;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  transition: opacity 0.3s ease;
}

.inference-card:nth-child(1) .inference-card-title {
  color: #3a6902;
}

.inference-card:nth-child(2) .inference-card-title {
  color: #b63620;
}

.inference-card:nth-child(3) .inference-card-title {
  color: #004bb3;
}

.inference-card:hover .inference-card-title {
  opacity: 0;
}

.inference-card-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
  background: rgba(255,255,255,0.95);
  color: #333;
  font-size: 0.7rem;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.inference-card:hover .inference-card-content {
  opacity: 1;
}

.inference-card-content h4 {
  margin-bottom: 8px;
  font-size: 1.0rem;
}

.inference-card:nth-child(1) .inference-card-content h4 {
  color: #ff8c42;
}

.inference-card:nth-child(2) .inference-card-content h4 {
  color: #42c78a;
}

.inference-card:nth-child(3) .inference-card-content h4 {
  color: #4285c7;
}

.inference-card-content p {
  margin: 5px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

.inference-card-content .formula {
  background: #f8f9fa;
  padding: 8px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 0.8rem;
  margin-top: 8px;
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
  width: 100%;
  box-sizing: border-box;
}

.inference-card-content .formula * {
  white-space: nowrap !important;
}

/* Prevent MathJax/KaTeX formulas from wrapping in .formula containers */
.inference-card-content .formula .MathJax,
.inference-card-content .formula .MathJax_Display,
.inference-card-content .formula .katex,
.inference-card-content .formula .katex-display {
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
  width: 100%;
  min-width: fit-content;
}

.inference-card-content .formula .MathJax *,
.inference-card-content .formula .MathJax_Display *,
.inference-card-content .formula .katex *,
.inference-card-content .formula .katex-display * {
  white-space: nowrap !important;
}

.inference-card:nth-child(1) .inference-card-content .formula {
  border-left: 3px solid #3a6902;
}

.inference-card:nth-child(2) .inference-card-content .formula {
  border-left: 3px solid #b63620;
}

.inference-card:nth-child(3) .inference-card-content .formula {
  border-left: 3px solid #004bb3;
}

/* Tabs Styles */
.tabs-container {
  max-width: 90%;
  margin: 2rem auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.tabs-header {
  display: flex;
  background: linear-gradient(135deg, #004bb3 0%, #4285c7 100%);
  border-bottom: 2px solid #004bb3;
}

.tab-button {
  flex: 1;
  padding: 15px 10px;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  text-align: center;
}

.tab-button:hover {
  background: rgba(255,255,255,0.1);
}

.tab-button.active {
  background: white;
  color: #004bb3;
}

.tab-content {
  padding: 30px;
  min-height: 400px;
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  color: #004bb3;
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.tab-content p {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 0.95em;
}

/* Sub-tabs Styles */
.sub-tabs-container {
  margin: 20px 0;
  background: #f8f9fa;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  width: 100%;
  box-sizing: border-box;
}

.sub-tabs-header {
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #666 0%, #888 100%);
  border-bottom: 1px solid #666;
  width: 200px;
  min-width: 180px;
  max-width: 300px;
  flex-shrink: 0;
}

.sub-tab-button {
  width: 100%;
  padding: 8px 15px;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sub-tab-button:last-child {
  border-bottom: none;
}

.sub-tab-button:hover {
  background: rgba(255,255,255,0.1);
}

.sub-tab-button.active {
  background: rgba(255,255,255,0.2);
  border-bottom: 2px solid #fff;
}

.sub-tab-content {
  display: none;
  padding: 20px;
  background: white;
  flex: 1;
  min-height: 200px;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

.sub-tab-content video {
  max-width: 100%;
  height: auto;
  display: block;
}

.sub-tab-content.active {
  display: block;
}

.sub-tab-content h4 {
  color: #004bb3;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1.1em;
}

.sub-tab-content p {
  margin-bottom: 15px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  font-size: 0.9em;
}

.sub-tab-content .reward-formula {
  background: #f0f2f8;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  border-left: 4px solid #004bb3;
  max-width: 100%;
  width: 100%;
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
  box-sizing: border-box;
  min-width: 0;
}

.sub-tab-content .reward-formula * {
  white-space: nowrap !important;
}

.sub-tab-content .reward-formula .MathJax,
.sub-tab-content .reward-formula .MathJax_Display {
  max-width: 100% !important;
  width: 100% !important;
  min-width: fit-content !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
}

.sub-tab-content .reward-formula .MathJax *,
.sub-tab-content .reward-formula .MathJax_Display * {
  white-space: nowrap !important;
}

/* Video optimization styles */
.sub-tab-content video {
  transition: opacity 0.2s ease;
  display: block;
}

.sub-tab-content video::-webkit-media-controls {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sub-tab-content video:hover::-webkit-media-controls {
  opacity: 1;
}

.sub-tab-content video::-webkit-media-controls-panel {
  background: rgba(0,0,0,0.7);
}

.sub-tab-content video::-webkit-media-controls-play-button,
.sub-tab-content video::-webkit-media-controls-timeline,
.sub-tab-content video::-webkit-media-controls-current-time-display,
.sub-tab-content video::-webkit-media-controls-time-remaining-display {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sub-tab-content video:hover::-webkit-media-controls-play-button,
.sub-tab-content video:hover::-webkit-media-controls-timeline,
.sub-tab-content video:hover::-webkit-media-controls-current-time-display,
.sub-tab-content video:hover::-webkit-media-controls-time-remaining-display {
  opacity: 1;
}

/* Video Gallery Styles */
.video-gallery {
  margin: 2rem 0;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.gallery-container {
  display: flex;
  transition: transform 0.5s ease;
  gap: 1rem;
  width: auto; /* Allow container to expand to fit all items */
  min-width: 100%; /* At least as wide as parent */
  box-sizing: border-box;
}

.gallery-item {
  position: relative;
  flex: 0 0 auto;
  width: 300px;
  min-width: 0; /* Allow flex item to shrink below content size */
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.gallery-item video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  display: block;
  min-height: 200px;
}

.gallery-item .video-info {
  padding: 15px;
}

.gallery-item h4 {
  color: #b63620;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

/* Motion Tracking Gallery specific styles */
#galleryContainer .gallery-item .video-info {
  padding: 8px;
}

#galleryContainer .gallery-item h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

/* Goal Reaching gallery green theme */
#goalGalleryContainer .gallery-item h4 {
  color: #3a6902;
}

#goalGalleryContainer .gallery-item:hover {
  box-shadow: 0 8px 20px rgba(58, 105, 2, 0.2);
}

#goalGalleryDots .gallery-dot.active {
  background: #3a6902;
}

#goalGalleryDots .gallery-dot:hover {
  background: #5a8a2a;
}

.gallery-item p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
}

.gallery-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-nav button {
  background: #b63620;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.gallery-nav button:hover {
  background: #9a2d1a;
  transform: scale(1.05);
}

.gallery-nav button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: background 0.3s ease;
}

.gallery-dot.active {
  background: #b63620;
}

/* Gallery arrow button styles */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(182, 54, 32, 0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  transition: all 0.3s ease;
  z-index: 10;
}

.gallery-arrow:hover {
  background: rgba(182, 54, 32, 1);
  transform: translateY(-50%) scale(1.1);
}

.gallery-arrow-left {
  left: 20px;
}

.gallery-arrow-right {
  right: 20px;
}

.gallery-arrow::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
}

.gallery-arrow-left::before {
  border-width: 8px 12px 8px 0;
  border-color: transparent white transparent transparent;
  margin-right: 2px;
}

.gallery-arrow-right::before {
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent white;
  margin-left: 2px;
}

/* Goal Reaching gallery arrow green theme */
.video-gallery:has(#goalGalleryContainer) .gallery-arrow {
  background: rgba(58, 105, 2, 0.8);
}

.video-gallery:has(#goalGalleryContainer) .gallery-arrow:hover {
  background: rgba(58, 105, 2, 1);
}

.video-container-arm {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.video-container-arm video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f8f9fa;
}

.placeholder-text {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 1em;
  color: #6c757d;
  text-align: center;
}

