/*
 * DeckPilot Web Deck: Touch Bar strip styles.
 * Mirrors iOS TouchBarStripView — dark charcoal strip, pill buttons, inline sliders.
 * Do NOT edit deck.css or render.js; this file is standalone.
 */

/* #deckView is already `position: absolute; inset: 0` (deck.css), so it is the strip's offset parent.
   Do not set position here: a later `relative` takes it out of its absolute fill and the grid collapses. */

/* Grid reserves 64px at the bottom when strip is visible */
#deckView.has-touchbar #deckArea {
  padding-bottom: 64px;
  box-sizing: border-box;
}

/* ── Strip ─────────────────────────────────────────────────────────────── */
#touchbar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  height: 56px;
  background: #1C1C1E;
  border-radius: 22px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  z-index: 10;
  box-sizing: border-box;
  /* padding and gap set via inline style from JS (scale-dependent) */
}

/* ── Pill (base for all module containers) ─────────────────────────────── */
.tb-pill {
  background: #38383D;
  border-radius: 8px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  border: none;
  outline: none;
  cursor: pointer;
  color: white;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 200ms ease, transform 200ms ease;
}

.tb-pill.tb-pressed,
.tb-pill:active {
  opacity: 0.7;
  transform: scale(0.95);
  transition: opacity 80ms ease, transform 80ms ease;
}

/* ── Icon-only pill ────────────────────────────────────────────────────── */
.tb-icon-btn {
  padding: 0;
}

.tb-icon-btn > svg,
.tb-layout-btn > svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
  display: block;
}

/* ── Slider pill (volume / brightness) ─────────────────────────────────── */
.tb-slider-wrap {
  padding: 0 8px;
  gap: 6px;
  cursor: default;
}

/* Small icons flanking the slider */
.tb-icon-sm {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: white;
}

.tb-icon-sm > svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
  display: block;
}

.tb-icon-sm.tb-dim > svg { opacity: 0.45; }

/* Slider track container */
.tb-slider-track {
  flex: 1;
  height: 30px;
  min-width: 20px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  touch-action: none;
}

/* Unfilled track */
.tb-slider-track::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 5px;
  background: #2C2C2E;
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
  transition: height 150ms ease;
  pointer-events: none;
}

.tb-slider-track.tb-dragging::before { height: 10px; }

/* Filled portion */
.tb-slider-fill {
  position: absolute;
  left: 0;
  height: 5px;
  background: var(--deck-accent, #0A84FF);
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  transition: height 150ms ease;
  max-width: 100%;
}

.tb-slider-track.tb-dragging .tb-slider-fill { height: 10px; }

/* Thumb */
.tb-slider-thumb {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 150ms ease;
  will-change: left;
}

.tb-slider-track.tb-dragging .tb-slider-thumb { opacity: 0; }

/* ── Media playback ────────────────────────────────────────────────────── */
.tb-media-wrap,
.tb-media-compact {
  padding: 0 6px;
  gap: 2px;
  justify-content: flex-start;
}

.tb-art-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 2px;
}

.tb-art-wrap img {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.tb-art-wrap svg {
  width: 28px;
  height: 28px;
  opacity: 0.45;
  flex-shrink: 0;
}

.tb-media-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  color: white;
}

.tb-play-btn { width: 36px; height: 36px; }

.tb-media-btn > svg { width: 14px; height: 14px; pointer-events: none; display: block; }
.tb-play-btn > svg  { width: 18px; height: 18px; }

/* ── Mic button ────────────────────────────────────────────────────────── */
.tb-mic-btn > svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
  display: block;
}

.tb-mic-live  { background: rgba(52, 199, 89, 0.85) !important; }
.tb-mic-muted { background: rgba(255, 59, 48, 0.85) !important; }

/* ── Clock ─────────────────────────────────────────────────────────────── */
.tb-clock { cursor: default; }

.tb-clock-text {
  font-family: ui-monospace, 'SF Mono', Menlo, 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.01em;
}

/* ── Stats (battery / cpu / memory) ───────────────────────────────────── */
.tb-stat { gap: 4px; padding: 0 6px; cursor: default; }

.tb-stat > svg { width: 14px; height: 14px; flex-shrink: 0; display: block; }

.tb-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  user-select: none;
  -webkit-user-select: none;
}
