/* ============================================================
   Coverage Browser — split-pane layout, genome browser pane,
   inline search wizard panel, multi-artifact chips
   ============================================================ */

/* ── Split-pane layout inside .mv-table-area ─────────────────── */

/* The table area is already flex-column; we add a browser pane
   and resize handle before the legend/table section. */

.mv-cov-browser-pane {
  position: relative;
  flex: 0 0 280px;
  min-height: 80px;
  overflow: hidden;
  background: var(--mv-surface);
  border-bottom: 1px solid var(--mv-border);
  /* Height is managed by JS resize handle */
}

/* PixiJS canvas fills the pane */
.mv-cov-browser-pane canvas {
  display: block;
  width: 100% !important;
}

/* Empty state overlay (before any search) */
.mv-browser-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--mv-surface);
  color: var(--mv-text-muted);
  pointer-events: none;
  z-index: 2;
}

/* Zoom / region label bar overlay (top-right of browser pane) */
.mv-browser-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--mv-border);
  border-radius: var(--mv-radius);
  padding: 2px 6px;
  backdrop-filter: blur(4px);
}

.mv-browser-region-label {
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
  color: var(--mv-text-muted);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Track count badge — bottom-left of browser pane */
.mv-browser-track-badge {
  position: absolute;
  bottom: 5px;
  left: 6px;
  font-size: .62rem;
  color: var(--mv-text-muted);
  background: rgba(255,255,255,.82);
  border: 1px solid var(--mv-border);
  border-radius: var(--mv-radius);
  padding: 1px 6px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 5;
}

/* ── Resize handle ───────────────────────────────────────────── */

#covResizeHandle {
  height: 5px;
  flex-shrink: 0;
  cursor: ns-resize;
  background: var(--mv-border);
  position: relative;
  z-index: 10;
  transition: background .12s;
  user-select: none;
}

#covResizeHandle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 1px;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--mv-border-strong);
  transition: background .12s;
}

#covResizeHandle:hover,
#covResizeHandle.dragging {
  background: var(--mv-primary-light);
}

#covResizeHandle:hover::after,
#covResizeHandle.dragging::after {
  background: var(--mv-primary);
}

/* ── Inline search wizard panel ──────────────────────────────── */

.mv-cov-search-panel {
  flex-shrink: 0;
  background: var(--mv-surface);
  border-bottom: 1px solid var(--mv-border);
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s cubic-bezier(0.4, 0, 0.2, 1);
  /* No padding when collapsed — prevents layout jump */
}

.mv-cov-search-panel.open {
  max-height: 520px;
}

.mv-cov-search-panel-inner {
  padding: 12px 16px 14px;
}

/* Panel header (tabs + close button) */
.mv-search-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.mv-search-panel-tab {
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--mv-border);
  background: none;
  color: var(--mv-text-muted);
  border-radius: var(--mv-radius);
  padding: .2rem .65rem;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}

.mv-search-panel-tab:hover {
  border-color: var(--mv-primary);
  color: var(--mv-primary);
}

.mv-search-panel-tab.active {
  background: var(--mv-primary-light);
  border-color: var(--mv-primary);
  color: var(--mv-primary);
}

/* ── Wizard steps ─────────────────────────────────────────────── */

.mv-wizard-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.mv-wizard-step {
  border: 1px solid var(--mv-border);
  border-radius: var(--mv-radius);
  overflow: hidden;
  opacity: .35;
  pointer-events: none;
  transition: opacity .22s, border-color .22s;
}

.mv-wizard-step.active {
  opacity: 1;
  pointer-events: auto;
  border-color: var(--mv-primary);
}

.mv-wizard-step.done {
  opacity: .7;
  pointer-events: none;
  border-color: #86efac; /* green-300 */
}

/* Activation glow pulse */
@keyframes mv-wizard-glow {
  0%   { box-shadow: 0 0 0 0 rgba(109,40,217,.45); }
  55%  { box-shadow: 0 0 0 5px rgba(109,40,217,.15), 0 0 14px rgba(109,40,217,.12); }
  100% { box-shadow: 0 0 0 2px rgba(109,40,217,.2); }
}

.mv-wizard-step.just-activated {
  animation: mv-wizard-glow .5s ease forwards;
}

.mv-wizard-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--mv-bg);
  border-bottom: 1px solid var(--mv-border);
  font-size: .78rem;
  font-weight: 600;
  color: var(--mv-text-muted);
  min-height: 32px;
}

.mv-wizard-step.active .mv-wizard-step-header {
  background: var(--mv-primary-light);
  color: var(--mv-primary-dark);
  border-color: transparent;
}

.mv-wizard-step.done .mv-wizard-step-header {
  background: #f0fdf4;
  color: #166534;
  border-color: transparent;
}

.mv-wizard-number {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mv-border-strong);
  color: var(--mv-text-muted);
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}

.mv-wizard-step.active .mv-wizard-number {
  background: var(--mv-primary);
  color: #fff;
}

.mv-wizard-step.done .mv-wizard-number {
  background: #bbf7d0;
  color: #166534;
}

.mv-wizard-step-body {
  padding: 8px 10px;
}

/* Search button pulse when ready */
@keyframes mv-search-ready-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(109,40,217,.55); }
  70%  { box-shadow: 0 0 0 6px rgba(109,40,217,0); }
  100% { box-shadow: 0 0 0 0 rgba(109,40,217,0); }
}

.mv-search-ready-pulse {
  animation: mv-search-ready-pulse .65s ease forwards;
}

/* ── Multi-artifact chips ─────────────────────────────────────── */

.mv-cov-artifact-chip {
  margin: 5px;
  padding: 8px 10px;
  border: 1px solid var(--mv-border);
  border-radius: 8px;
  background: var(--mv-surface);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  position: relative;
  user-select: none;
}

.mv-cov-artifact-chip:hover {
  border-color: var(--mv-primary);
  background: var(--mv-bg);
}

.mv-cov-artifact-chip:hover .mv-chip-actions {
  opacity: 1;
  pointer-events: auto;
}

.mv-cov-artifact-chip.active {
  border-color: var(--mv-primary);
  background: var(--mv-primary-light);
  box-shadow: inset 3px 0 0 var(--mv-primary);
}

.mv-cov-artifact-chip.searching {
  border-color: var(--mv-border-strong);
  background: var(--mv-bg);
}

.mv-cov-artifact-chip.error {
  border-color: #fca5a5;
  background: #fff1f2;
}

.mv-chip-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mv-chip-label {
  flex: 1;
  font-size: .75rem;
  font-weight: 600;
  color: var(--mv-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 130px;
}

.mv-cov-artifact-chip.active .mv-chip-label {
  color: var(--mv-primary-dark);
}

.mv-chip-meta {
  font-size: .65rem;
  color: var(--mv-text-muted);
  margin-top: 3px;
  padding-left: 1.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action buttons shown on hover */
.mv-chip-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}

.mv-chip-action-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mv-surface);
  border: 1px solid var(--mv-border);
  border-radius: 4px;
  color: var(--mv-text-muted);
  cursor: pointer;
  font-size: .65rem;
  transition: color .1s, background .1s, border-color .1s;
  padding: 0;
  line-height: 1;
}

.mv-chip-action-btn:hover {
  color: var(--mv-primary);
  border-color: var(--mv-primary);
  background: var(--mv-primary-light);
}

.mv-chip-action-btn.danger:hover {
  color: var(--mv-danger);
  border-color: #fca5a5;
  background: #fff1f2;
}

/* Overlay indicator badge on chip */
.mv-chip-overlay-badge {
  font-size: .58rem;
  background: #f3e8ff;
  color: var(--mv-primary-dark);
  border: 1px solid #d8b4fe;
  border-radius: 3px;
  padding: 0 3px;
  white-space: nowrap;
}

/* ── Page drop overlay ───────────────────────────────────────── */
/* (Already defined in malva.css — keeping here for reference) */
