/* The Rack's miniature overview and the panels it stands for: the sample
   on an audio track and the empty track. Split out of css/rack.css. */
/* ---------- Overview ---------- */

.rack-mini {
  position: relative;
  display: flex;
  align-items: center;
  width: 250px;
  height: calc(var(--rack-bar) - 4px);
  padding: 2px 3px;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 1;
  min-width: 0;
}

/* Filling the frame exactly is what lets the window over it be a plain
   proportional mapping of the scroll offset. */
.rack-mini-inner {
  width: 100%;
}

.rack-mini-inner--steps,
.rack-mini-inner--notes {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.rack-mini-row,
.rack-mini-lane {
  position: relative;
  display: flex;
  gap: 1px;
  flex: 1;
  min-height: 1px;
}

.rack-mini-row i {
  flex: 1 1 0;
  min-width: 1px;
  border-radius: 1px;
  background: rgba(0, 165, 159, 0.28);
}

.rack-mini-row i.is-on {
  background: #00a59f;
}

/* The roll's miniature keeps the pitch order, so its shape is the melody. */
.rack-mini-lane i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 1px;
  background: var(--c);
}

.rack-mini-inner--chain {
  display: flex;
  flex-direction: row;
  gap: 1px;
  height: 100%;
}

.rack-mini-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  padding: 0 4px;
  background: #3a3a3a;
  border-radius: 2px;
  font-family: var(--font-text);
  font-size: 9px;
  color: #e0e0e0;
  white-space: nowrap;
}

.rack-mini-seg.is-empty {
  background: none;
  border: 1px dashed #5a5a5a;
}

/* Which slice of the chain or the pattern the editor is showing. */
.rack-mini-window {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 3px;
  pointer-events: none;
}

/* A bare glyph, like the mode tabs beside it: the bar draws no boxes around its
   icons, only the filled disc that marks the mode you are in. */
.rack-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 5px;
  color: #8a8a8a;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.1s;
}

.rack-icon .material-symbols-outlined {
  font-size: 16px;
}

.rack-icon:hover {
  color: #ffffff;
}

.rack-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.rack-zoom .material-symbols-outlined {
  font-size: 15px;
  color: #c0c0c0;
}

.rack-zoom-track {
  position: relative;
  width: 90px;
  height: 2px;
  border-radius: 2px;
  background: #5a5a5a;
}

.rack-zoom-knob {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d8d8d8;
  transform: translate(-50%, -50%);
}

.rack-zoom-val {
  font-family: var(--font-ui);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: #c0c0c0;
}

/* ---------- The sample on an audio track ---------- */

.rack-audio {
  overflow-y: hidden;
}

.au-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 100%;
  min-height: 100%;
  background-image:
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 640px),
    repeating-linear-gradient(to right, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 160px);
}

.au-ruler {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 22px;
  flex-shrink: 0;
  background: #161616;
}

/* Every bar line is capped with a short bar, which is what the ruler over a
   waveform reads as. */
.au-tick {
  position: absolute;
  top: 0;
  bottom: -100vh;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.au-tick::before {
  content: '';
  position: absolute;
  top: 0;
  left: -3px;
  width: 7px;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.au-tick i {
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #f0f0f0;
}

.au-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
}

/* The waveform is the track's colour, so an audio track reads as itself here as
   well as in the Arranger. */
.au-svg {
  display: block;
  width: 100%;
  height: 62%;
  fill: var(--c);
}

.au-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  border-left: 1px dashed rgba(255, 255, 255, 0.55);
}

/* ---------- A track with nothing on it ---------- */

.rack-empty {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px dashed #3f3f3f;
  border-radius: var(--sh-radius);
  color: var(--text-secondary);
  font-family: var(--font-text);
  font-size: 12px;
}

.rack-empty .material-symbols-outlined {
  font-size: 24px;
  opacity: 0.6;
}

.rack-empty-title {
  font-size: 12.5px;
  color: #c8c8c8;
}

.rack-empty-note {
  font-size: 11px;
  color: var(--text-muted);
}

/* The whole panel is where a plugin can be dropped, so it is the whole panel
   that says so while one is in the air. */
.rack-view.is-drop-target {
  outline: 1.5px dashed #00a59f;
  outline-offset: -3px;
  background: #17211f;
}

/* ---------- Overview: the sample, and an empty track ---------- */

.rack-mini-inner--wave {
  display: flex;
  align-items: center;
  height: 100%;
}

.rack-mini-inner--wave .au-svg {
  height: 100%;
}

.rack-mini-inner--empty {
  height: 100%;
}
