﻿
.euro-sireline {
  position: relative;
  /*min-height:800px;*/

  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
}

#tooltip {
  position: fixed;
  background: rgba(255, 255, 255, 0.97);
  color: #222;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  pointer-events: none;
  display: none;
  max-width: 260px;
  line-height: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#tooltip strong {
  font-size: 14px;
  color: #111;
}

/* --- Legend panel -------------------------------------------------------
   Godolphin blue (var(--bs-primary), from godolphin-bootstrap.css) is the
   one accent spent deliberately here: the header rule, the active tab, the
   range-slider fill, and focus rings. Everything else stays quiet neutrals
   so that one thread of colour reads as intentional rather than decorative. */

#legend {
  /*position: fixed;*/
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--bs-gray-700, #495057);
  font-size: 12px;
  /* No backdrop-filter: this panel sits over a live d3 sunburst that repaints continuously
     during season transitions, and blur forces the browser to keep resampling everything
     behind it every frame — a solid-ish surface gets the same "elevated card" read for free. */
  background: rgba(255, 255, 255, 0.97);
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--bs-gray-200, #e9ecef);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.08);
  width: 160px;
}

#legend h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--bs-gray-900, #212529);
  margin-bottom: 10px;
}

/* A short rule in the brand accent stands in for an icon — a structural
   marker (this is the panel's identity colour), not decoration. */
#legend h3::before {
  content: "";
  display: block;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--bs-primary, #0037b2);
  flex-shrink: 0;
}

#legend-toggle {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--bs-gray-500, #adb5bd);
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

#legend-toggle:hover {
  color: var(--bs-primary, #0037b2);
  background: var(--bs-gray-100, #f8f9fa);
}

#legend-body {
  /* min() with a viewport-relative bound (accounting for #legend's fixed top offset plus its
     own header/padding) so the panel scrolls internally on short viewports instead of just
     running off the bottom of the screen — a fixed cap alone assumed a tall-enough window.
     900px because every page that loads this stylesheet has a legend taller than the 600px
     this used to allow: the two sireline pages carry a rotate slider on top of the original
     controls, and the two by-season pages a pair of Browse/Focus tabs. All four carried the
     same override of their own, which is to say the shared value was never the one in use. */
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: min(900px, calc(100vh - 90px));
  opacity: 1;
  padding-right: 8px; /* gap between content and the scrollbar track */
  margin-right: -8px;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--bs-gray-400, #ced4da) transparent;
}

#legend-body::-webkit-scrollbar {
  width: 6px;
}

#legend-body::-webkit-scrollbar-track {
  background: transparent;
}

#legend-body::-webkit-scrollbar-thumb {
  background: var(--bs-gray-400, #ced4da);
  border-radius: 3px;
}

#legend-body::-webkit-scrollbar-thumb:hover {
  background: var(--bs-gray-500, #adb5bd);
}

#legend-body.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.leg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Legend controls ------------------------------------------------- */

.legend-section {
  margin-top: 14px;
}

.legend-section--divided {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bs-gray-200, #e9ecef);
}

.legend-label {
  display: block;
  color: var(--bs-gray-600, #6c757d);
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 6px;
}

.legend-hint {
  font-size: 11px;
  line-height: 1.6;
  color: var(--bs-gray-600, #6c757d);
}

.legend-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--bs-gray-500, #adb5bd);
}

.legend-value {
  font-size: 10px;
  color: var(--bs-gray-600, #6c757d);
  margin-top: 4px;
}

#legend select,
#legend input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 11px;
  padding: 6px 8px;
  color: var(--bs-gray-900, #212529);
  background: #fff;
  border: 1px solid var(--bs-gray-300, #dee2e6);
  border-radius: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#legend select:hover,
#legend input[type="text"]:hover {
  border-color: var(--bs-gray-400, #ced4da);
}

#legend select:focus-visible,
#legend input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--bs-primary, #0037b2);
  box-shadow: 0 0 0 3px rgba(0, 55, 178, 0.14);
}

#legend #sireSelect {
  background: var(--bs-gray-100, #f8f9fa);
  min-height:126px;
}

#legend #focusList {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--bs-gray-300, #dee2e6);
  border-radius: 6px;
  background: var(--bs-gray-100, #f8f9fa);
  padding: 6px 8px;
}

#legend button {
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--bs-gray-700, #495057);
  background: #fff;
  border: 1px solid var(--bs-gray-300, #dee2e6);
  border-radius: 6px;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

#legend button:hover {
  border-color: var(--bs-gray-400, #ced4da);
  background: var(--bs-gray-100, #f8f9fa);
}

#legend button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 55, 178, 0.14);
}

#legend .legend-btn-block {
  width: 100%;
}

#legend .legend-btn-block + .legend-btn-block {
  margin-top: 8px;
}

/* Play/pause: the one filled button in the panel, in the accent colour. */
#legend #playBtn {
  font-size: 13px;
  padding: 6px 12px;
  color: #fff;
  background: var(--bs-primary, #0037b2);
  border-color: var(--bs-primary, #0037b2);
}

#legend #playBtn:hover {
  background: var(--bs-link-hover-color, #002c8e);
  border-color: var(--bs-link-hover-color, #002c8e);
}

#legend .legend-season {
  font-size: 20px;
  font-weight: 600;
  color: var(--bs-gray-900, #212529);
  font-variant-numeric: tabular-nums;
}

/* Browse/Focus tabs — a segmented control, active state carries the accent. */
#legend .legend-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bs-gray-100, #f8f9fa);
  border-radius: 7px;
}

#legend .legend-tabs button {
  flex: 1;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--bs-gray-600, #6c757d);
}

#legend .legend-tabs button:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--bs-gray-900, #212529);
}

#legend .legend-tabs button.is-active {
  background: #fff;
  color: var(--bs-gray-900, #212529);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

/* Range sliders — thin filled track in the accent colour, no native chrome. */
#legend input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bs-gray-200, #e9ecef);
  cursor: pointer;
}

#legend input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bs-primary, #0037b2);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.3);
  margin-top: -5px;
}

#legend input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bs-primary, #0037b2);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.3);
}

#legend input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--bs-gray-200, #e9ecef);
}

#legend input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--bs-gray-200, #e9ecef);
}

#legend input[type="range"]:focus-visible {
  outline: none;
}

#legend input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(0, 55, 178, 0.25);
}
