* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f7fa;
  color: #111827;
}

/* =========================
   HEADER
========================= */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #0f172a;
  z-index: 1000;
}

header.topbar { padding: 0 !important; }

.join-controls {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.header-spacer {
  height: 56px;
}

/* =========================
   VIDEO STRIP (SMALL + SCROLLABLE)
========================= */

.video-strip {
  position: sticky;
  top: 56px;                 /* below top bar */
  z-index: 900;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 10px;
}

/* Horizontal scrolling row */
.video-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  padding-bottom: 4px;
}

/* Hide scrollbar (optional, clean look) */
.video-row::-webkit-scrollbar {
  height: 6px;
}
.video-row::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* Thumbnail size */
.local-tile video,
.remote-row video,
.video-row video {
  width: 120px;
  height: 90px;
  flex: 0 0 auto;            /* prevent shrinking */
  border-radius: 6px;
  background: #000;
  object-fit: cover;
}

.video-row video:hover {
  outline: 2px solid #2563eb;
  cursor: pointer;
}

/* =========================
   STAGE (RESPONSIVE, FRAMED)
========================= */

.stage-area {
  background: #0b1020;
  padding: 16px;
  display: flex;
  justify-content: flex-start;   /* LEFT align */
}

/* Frame that controls size */
.stage-frame {
  width: 100%;
  max-width: 960px;              /* default stage size */
}

/* Video container */
.stage-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Actual video element */
.stage-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* =========================
   ZOOM-STYLE CAPTIONS
========================= */
.stage-captions {
  background: rgba(11,16,32,0.95);
  color: #e5e7eb;
  padding: 10px 16px 14px;
  border-top: 1px solid #1f2937;
}

.stage-caption-speaker {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 6px;
}

.stage-caption-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-caption-line {
  font-size: 16px;
  line-height: 1.4;
}

.stage-caption-lang {
  opacity: 0.7;
  font-size: 13px;
}

/* =========================
   CAPTION CONTROLS (VISIBLE)
========================= */
.captions-grid {
  margin-top: 16px;
}

.capBlock {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.capControls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.capControls select {
  min-width: 140px;
}

.capControls input[type="checkbox"] {
  transform: scale(1.1);
}

/* =========================
   STAGE CAPTION TIGHTENING
========================= */

/* Tighten caption control rows */
.capBlock {
  margin-bottom: 0px;   /* was likely ~16px */
}

.capControls {
  gap: 6px;             /* tighten horizontal spacing */
  margin-bottom: 0px;
}

/* Reduce vertical padding inside controls */
.capControls select,
.capControls input[type="checkbox"] {
  margin: 0;
}

/* Optional: tighten label text */
.capControls strong {
  line-height: 1.1;
}


.asr-status {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.8;
}

/* =========================
   ZOOM-STYLE CHAT PANEL
========================= */

.chat-panel {
  position: fixed;
  top: 56px; /* below top bar */
  right: 0;
  width: 320px;
  height: calc(100vh - 56px);

  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  z-index: 1200;

  display: flex;
  flex-direction: column;
}

.chat-panel.hidden {
  display: none;
}

/* Push main content when chat is open */
body.chat-open main {
  margin-right: 320px;
}

/* Header */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;

  font-weight: 600;
}

/* Messages */
.chat-messages {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  font-size: 14px;
}

/* Individual message */
.chat-message {
  margin-bottom: 8px;
}

.chat-message strong {
  display: block;
  font-size: 12px;
  color: #374151;
}

/* Input */
.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #e5e7eb;
}

.chat-input input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

.chat-input button {
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}
/* =========================
   CHAT TIMESTAMPS
========================= */

.chat-message {
  margin-bottom: 10px;
}

.chat-message strong {
  display: block;
  font-size: 12px;
  color: #374151;
}

.chat-message .chat-time {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 4px;
}

.chat-self {
  opacity: 0.95;
}
/* =========================
   LOG PANEL
========================= */

.log-panel-content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  font-size: 12px;
  background: #0b1020;
  color: #e5e7eb;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
