/* ===== Thumbnail Strip Styles ===== */

#main-content {
  min-width: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 5%;
  padding-right: 5%;
  box-sizing: border-box;
}

/* SVG connector between chart x-axis and thumbnail strip */
#thumbnail-connector-svg {
  display: none;
  position: relative;
  z-index: 10;
  /* Extend into main-content padding, leaving 3px each side */
  width: calc(100% + 10%);
  margin-left: calc(-5% + 3px);
  height: 30px;
  margin-top: -15px;
  margin-bottom: 0;
  pointer-events: none;
  overflow: visible;
}

/* Outer container for thumbnail strip */
#thumbnail-strip-container {
  display: none;
  position: relative;
  width: calc(100% + 15%);
  margin-left: calc(-7%);
  margin-right: 0;
  margin-top: 0;
  margin-bottom: 5px;
  box-sizing: border-box;
  padding: 0;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 5px 5px;
  overflow: hidden;
  box-shadow: -2px 0 4px rgba(0,0,0,0.1), 2px 0 4px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.1);
}

/* Inner flex strip: holds all thumbnail items in a row, no gaps */
#thumbnail-strip {
  display: flex;
  align-items: center;
  width: 100%;
}

/* Individual thumbnail item: canvas only, no label */
.thumbnail-item {
  flex: 1 1 0;
  min-width: 0;
  cursor: pointer;
  text-align: center;
  outline: 0.5px solid #ccc;
  outline-offset: -0.5px;
  transition: outline-color 0.15s ease, background-color 0.15s ease;
}

.thumbnail-item:hover {
  background-color: #e9ecef;
  outline: 1.5px solid #adb5bd;
  outline-offset: -1.5px;
}

/* Active/selected thumbnail */
.thumbnail-item.active {
  outline: 1.5px solid #FF5722;
  outline-offset: -1.5px;
  background-color: #fff3e0;
}

/* The small canvas inside each thumbnail */
.thumbnail-item canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
  border-radius: 2px;
  background-color: #ffffff;
}

/* Optimal mode: 6 thumbnails at half size, centered */
#thumbnail-strip-container.optimal-mode {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
}

/* Optimal thumbnail with label and value */
.optimal-thumbnail-item {
  padding: 4px 0;
}

/* Loss value displayed above canvas */
.thumbnail-value {
  font-size: 10px;
  line-height: 1.2;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 2px 0;
}

/* Loss type name displayed below canvas */
.thumbnail-label {
  font-size: 10px;
  line-height: 1.2;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px 1px;
}

/* Left-side header column in optimal mode */
.thumbnail-header {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 4px 8px 4px 4px;
}

.thumbnail-header-line {
  font-size: 11px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  line-height: 1.4;
}
