/* =============================================================
   panes.css — Transcript and Translation pane styles
   + VirtualScroller sentinels and segment rendering
   ============================================================= */

/* ── Pane base ──────────────────────────────────────────────── */
.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: transparent;   /* let app-layout atmospheric gradient show through */
}

/* Transcript pane fills remaining height when solo */
.pane--transcript {
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

/* Translation pane — hidden until activated */
.pane--translation {
  flex: 0 0 0;
  min-height: 0;
  overflow: hidden;
  transition: flex-basis 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1.5px solid var(--color-border);
}

.pane--translation.pane--collapsed {
  flex-basis: 0;
  display: none;
}

/* When dual mode is active (set on content-area), both panes share height */
.content-area--dual .pane--transcript {
  flex: 1 1 50%;
  min-height: 80px;
}

.content-area--dual .pane--translation {
  flex: 1 1 50%;
  min-height: 80px;
}

/* ── Pane header ────────────────────────────────────────────── */
.pane__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.45);     /* glass — matches Manna's rgba(0,0,0,0.3) */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex-shrink: 0;
  z-index: 2;
}

.pane__header--translation {
  background: rgba(21,101,192,0.18);   /* subtle blue tint for translation pane */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pane__header-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.pane__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.pane__lang-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.pane__lang-label:empty {
  display: none;
}

.pane__lang-label--target {
  color: #90CAF9;
  background: rgba(33,150,243,0.18);
}

.pane__close {
  margin-left: auto;
  color: var(--color-text-secondary);
  padding: 5px;
}

.pane__close:hover {
  color: var(--color-text);
  background: var(--color-border);
}

/* ── Pane body (scrollable region) ─────────────────────────── */
.pane__body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  position: relative;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Empty state ────────────────────────────────────────────── */
.pane__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 32px;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.pane__empty-icon {
  width: 72px;
  height: 72px;
  opacity: 0.7;
  flex-shrink: 0;
}

.pane__empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0;
}

.pane__empty-sub {
  font-size: 13px;
  color: var(--color-text-disabled);
  margin: 0;
  line-height: 1.6;
}

/* ── VirtualScroller components ─────────────────────────────── */

/* Spacers simulate the height of off-screen items */
.vs-spacer {
  flex-shrink: 0;
  transition: height 0.1s ease;
}

/* Sentinel divs watched by IntersectionObserver */
.vs-sentinel {
  height: 1px;
  pointer-events: none;
  visibility: hidden;
}

/* Inner list — children are rendered segment cards */
.virtual-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Transcript Segment ──────────────────────────────────────── */
.segment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.03);   /* very subtle card on black */
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: 60px;
  animation: segment-in 0.2s ease;
}

@keyframes segment-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.segment:last-child {
  border-bottom: none;
}

/* Language badge */
.segment__badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
  margin-top: 2px;
  background: rgba(33,150,243,0.20);
  color: #90CAF9;
}

/* Translated badge — blue tint matching Manna accent */
.segment__badge--translated {
  background: rgba(33,150,243,0.15);
  color: #64B5F6;
}

/* Segment body */
.segment__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Segment text */
.segment__text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-text);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Timestamp */
.segment__time {
  font-size: 11px;
  color: var(--color-text-disabled);
}

/* Translating placeholder */
.segment__text--translating {
  color: var(--color-text-disabled);
  font-style: italic;
}

/* ── Interim bar (live preview) ─────────────────────────────── */
.interim-bar {
  display: none;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-interim);
  font-style: italic;
  background: rgba(0,0,0,0.40);
  border-top: 1px dashed rgba(255,255,255,0.12);
  line-height: 1.55;
  word-wrap: break-word;
  min-height: 44px;
}

.interim-bar--visible {
  display: block;
}

/* ── Translation loading indicator ──────────────────────────── */
.translation-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.translation-loading--hidden {
  display: none;
}

/* ── Hidden utility ─────────────────────────────────────────── */
.pane__empty--hidden {
  display: none !important;
}
