/* ==========================================================================
 * jquery.chartscroll.css
 * ========================================================================== */

.chartscroll {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
}

.chartscroll__viewport {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.chartscroll__canvas {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
}

.chartscroll__scrollbar {
  position: relative;
  width: 100%;
  flex: 0 0 18px;
  height: 18px;
  padding: 5px 0;
  box-sizing: border-box;
  outline: none;
  user-select: none;
}

.chartscroll__track {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--color-surface-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.chartscroll__thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 20%;
  min-width: 18px;
  height: 100%;
  background: var(--color-scrollbar-thumb);
  border-radius: var(--radius-pill);
  cursor: grab;
}

.chartscroll__thumb:hover {
  background: var(--color-scrollbar-thumb-hover);
}

.chartscroll__thumb:active {
  cursor: grabbing;
  background: var(--color-secondary-hover);
}


/* Selection
 * -------------------------------------------------------------------------- */

.chartscroll__selection-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;

  display: flex;
  gap: 6px;
}

.chartscroll__selection-actions button {
  min-height: 26px;
  padding: 3px 10px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);

  background: var(--color-surface);
  color: var(--color-text);

  font: inherit;
  font-size: var(--font-size-small);

  cursor: pointer;
}

.chartscroll__selection-actions button:hover {
  background: var(--color-surface-hover);
}


/* Crosshair only when selection is enabled by JS container usage.
 * Remove this rule if you prefer the normal pointer.
 * -------------------------------------------------------------------------- */

.chartscroll__canvas {
  cursor: crosshair;
}


/* Duration links */
.chartscroll__ranges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px 12px;
  width: 100%;
  padding: 4px 0 6px;
  box-sizing: border-box;
  font-size: var(--font-size-small);
}
.chartscroll__ranges a {
  color: var(--color-link);
  text-decoration: none;
  opacity: .6;
}
.chartscroll__ranges a:hover,
.chartscroll__ranges a:focus-visible {
  color: var(--color-link-hover);
  text-decoration: underline;
  opacity: 1;
}
.chartscroll__ranges a.active {
  opacity: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
