/**
 * Video player — shell, scrubber, transport bar
 * Linked only from studies/show to avoid loading on every page.
 * Depends on design tokens defined in application.css (:root).
 */

.as-video-shell {
  background: #000;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.as-video-shell video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.as-video-timecode {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: .75rem;
  color: rgba(255, 255, 255, .85);
  background: rgba(0, 0, 0, .45);
  padding: 2px 6px;
  border-radius: .25rem;
  pointer-events: none;
}

/* Fixed width for the seek input that swaps in over the timecode readout */
.as-timecode-seek { width: 5rem; }

/* Scrubber — sits between the video shell and the transport bar */
.as-scrubber-track {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, .12);
}

.as-scrubber-buffer {
  position: absolute;
  inset: 0;
  width: 0;
  background: rgba(255, 255, 255, .2);
  pointer-events: none;
}

.as-scrubber-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  appearance: none;
  background: transparent;
}

.as-scrubber-track:hover {
  height: 6px;
}

.as-scrubber-range::-webkit-slider-runnable-track {
  background: transparent;
  height: 100%;
}

.as-scrubber-range::-moz-range-track    { background: transparent; }
.as-scrubber-range::-moz-range-progress { background: var(--accent); height: 100%; }

.as-scrubber-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -3px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .4);
}

.as-scrubber-range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .4);
}

/* Transport bar shell */
.as-transport {
  background: var(--nav-bg);
  border-radius: 0 0 .375rem .375rem;
}

/* Dark ghost buttons for the transport bar */
.as-transport .btn {
  --bs-btn-color:              #cfd6e0;
  --bs-btn-border-color:       rgba(255, 255, 255, .35);
  --bs-btn-bg:                 rgba(255, 255, 255, .06);
  --bs-btn-hover-color:        #fff;
  --bs-btn-hover-bg:           rgba(255, 255, 255, .15);
  --bs-btn-hover-border-color: rgba(255, 255, 255, .55);
  --bs-btn-active-color:       #fff;
  --bs-btn-active-bg:          rgba(255, 255, 255, .2);
  --bs-btn-active-border-color:rgba(255, 255, 255, .6);
  font-size: .8rem;
  padding: 2px 8px;
}

/* Active-state variants toggled by Stimulus */
.as-transport .btn.btn-primary,
.as-transport .btn.btn-warning,
.as-transport .btn.btn-secondary,
.as-transport .btn.btn-danger {
  background:   var(--accent);
  border-color: var(--accent);
  color:        var(--nav-bg);
  font-weight:  700;
}

.as-transport .btn.btn-primary:hover,
.as-transport .btn.btn-warning:hover,
.as-transport .btn.btn-secondary:hover,
.as-transport .btn.btn-danger:hover {
  background:   var(--accent-dark);
  border-color: var(--accent-dark);
  color:        var(--nav-bg);
}

/* Inactive outline variants — reset to ghost style */
.as-transport .btn.btn-outline-primary,
.as-transport .btn.btn-outline-warning,
.as-transport .btn.btn-outline-secondary,
.as-transport .btn.btn-outline-danger {
  background:   rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .35);
  color:        #cfd6e0;
  font-weight:  400;
}

/* Hairline separator above the secondary row; padding handled by pt-1 utility */
.as-transport-secondary {
  border-top: 1px solid rgba(255, 255, 255, .08);
}

/* Divider dot between button groups */
.as-transport-divider {
  font-size: .7rem;
  color: var(--nav-meta-color);
  user-select: none;
}

/* Speed select */
.as-speed-select {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #cfd6e0;
  border-radius: .25rem;
  font-size: .8rem;
  padding: 2px 4px;
  cursor: pointer;
}

.as-speed-select:focus {
  outline: none;
  border-color: var(--accent);
  color: #fff;
}

.as-speed-select option {
  background: var(--nav-bg);
  color: #fff;
}
