/* ═══════════════════════════════════════════════════════════════
   Zone centrale : ligne de temps, forme d'onde, barre de défilement
   ═══════════════════════════════════════════════════════════════ */

/* Zone principale */
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 200px;
}

/* ─── Ligne de temps ─── */
.timeline {
  height: 20px;
  background: linear-gradient(180deg, var(--tl-bg1) 0%, var(--tl-bg2) 100%);
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
}
.timeline canvas { width: 100%; height: 100%; display: block; }

/* ─── Noms de marqueurs ─── */
.marker-names {
  height: 28px;
  background: var(--bg1);
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
}

.mk-label {
  position: absolute;
  top: 2px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  color: #fff;
  white-space: nowrap;
  transform: translateX(-50%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.mk-label::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--mk-color);
}

/* ─── Piste des boucles ─── */
.loop-names {
  height: 36px;
  background: var(--bg1);
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.lp-label {
  position: absolute;
  top: 3px;
  height: 30px;
  font-size: 12px;
  font-weight: 600;
  line-height: 30px;
  padding: 0 8px;
  border-radius: 0;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  text-align: center;
}

/* ─── Forme d'onde ─── */
.waveform {
  flex: 1;
  position: relative;
  cursor: crosshair;
  background: linear-gradient(180deg, var(--wf-bg1) 0%, var(--wf-bg2) 100%);
  min-height: 80px;
  overflow: hidden;
}
.waveform::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .015), rgba(0, 0, 0, .08));
  pointer-events: none;
  z-index: 1;
}
.waveform canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 0;
}

/* Zones atténuées (hors sélection) */
.wf-dim {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(5, 7, 10, .4) 0%,
    rgba(5, 7, 10, .3) 50%,
    rgba(5, 7, 10, .4) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Sélection */
.wf-sel {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(110, 168, 204, .3) 0%,
    rgba(110, 168, 204, .16) 50%,
    rgba(110, 168, 204, .3) 100%);
  border-left: 2px solid rgba(154, 208, 241, .85);
  border-right: 2px solid rgba(154, 208, 241, .85);
  box-shadow:
    inset 0 0 0 1px rgba(154, 208, 241, .08),
    0 0 18px rgba(110, 168, 204, .16);
  cursor: move;
  z-index: 3;
}
.wf-sel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, .05), transparent 12%, transparent 88%, rgba(255, 255, 255, .05));
  pointer-events: none;
}

/* Poignées de redimensionnement de la sélection */
.wf-sel-handle {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 4;
  pointer-events: auto;
}
.wf-sel-handle:hover,
.wf-sel-handle.active {
  background: rgba(154, 208, 241, .25);
}
.wf-sel-handle.left { left: 0; transform: translateX(-4px); }
.wf-sel-handle.right { right: 0; transform: translateX(4px); }

/* Tête de lecture */
.wf-head {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, .96),
    rgba(209, 240, 255, .92));
  pointer-events: none;
  z-index: 5;
  box-shadow:
    0 0 10px rgba(255, 255, 255, .45),
    0 0 24px rgba(110, 168, 204, .22);
}

/* ─── Barre de défilement horizontale ─── */
.hscroll {
  height: 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

.hscroll-track {
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  height: 8px;
  background: var(--bg0);
  border-radius: 4px;
}

.hscroll-thumb {
  position: absolute;
  top: 4px;
  height: 8px;
  background: var(--bg4);
  border-radius: 4px;
  cursor: grab;
  min-width: 30px;
  transition: background .15s;
}
.hscroll-thumb:hover { background: var(--acc); }
.hscroll-thumb:active { background: var(--acc); }
