/* ============================================
   CallBrazi — Premium Design System
   ============================================ */

/* ── CSS Custom Properties ───────────────── */
:root {
  /* Colors — Dark Theme */
  --bg-primary: #0a0e27;
  --bg-secondary: #111638;
  --bg-card: rgba(17, 22, 56, 0.85);
  --bg-glass: rgba(17, 22, 56, 0.6);
  --bg-overlay: rgba(0, 0, 0, 0.85);

  --text-primary: #f0f2ff;
  --text-secondary: #8b92c5;
  --text-muted: #5a6199;

  --accent-primary: #6c63ff;
  --accent-secondary: #00d4aa;
  --accent-danger: #ff4757;
  --accent-warning: #ffa502;
  --accent-gold: #FFD700;

  --gradient-primary: linear-gradient(135deg, #6c63ff 0%, #3b82f6 50%, #00d4aa 100%);
  --gradient-card: linear-gradient(145deg, rgba(108,99,255,0.1), rgba(0,212,170,0.05));
  --gradient-glow: linear-gradient(135deg, #6c63ff, #00d4aa);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --fs-xs: 0.7rem;
  --fs-sm: 0.8rem;
  --fs-md: 0.95rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.8rem;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Borders & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 50%;
  --border-subtle: 1px solid rgba(108, 99, 255, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ── Reset & Base ────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}
.hidden { display: none !important; }

/* ── Utility: Scrollbar ──────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.3); border-radius: 4px; }

/* ════════════════════════════════════════════
   JOIN PANEL
   ════════════════════════════════════════════ */
.join-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0,212,170,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(59,130,246,0.05) 0%, transparent 50%);
}

.join-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: cardAppear 0.6s ease-out;
}
@keyframes cardAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Brand */
.join-brand { text-align: center; margin-bottom: var(--space-xl); }
.join-logo { font-size: 2.2rem; display: flex; align-items: center; justify-content: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.logo-bridge { color: var(--accent-primary); font-size: 1.4rem; animation: bridgePulse 2s ease-in-out infinite; }
@keyframes bridgePulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
.join-title {
  font-size: var(--fs-3xl);
  font-weight: 800;
  background: var(--gradient-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.join-subtitle { color: var(--text-secondary); font-size: var(--fs-md); margin-top: var(--space-xs); }

/* Form Elements */
.form-group { margin-bottom: var(--space-lg); }
.form-label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--space-sm); }
.form-input {
  width: 100%;
  padding: var(--space-md);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--fs-md);
  transition: var(--transition-base);
  outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }

/* Language Selector */
.language-selector { display: flex; gap: var(--space-sm); }
.lang-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(108,99,255,0.15);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--fs-md);
  font-weight: 500;
  transition: var(--transition-base);
}
.lang-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.lang-btn.active {
  border-color: var(--accent-primary);
  background: rgba(108,99,255,0.15);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(108,99,255,0.2);
}
.lang-flag { font-size: 1.4rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  outline: none;
}
.btn-icon { width: 18px; height: 18px; }
.btn-primary {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-md) var(--space-xl);
  font-size: var(--fs-lg);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-glow { animation: glowPulse 3s ease-in-out infinite; }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 10px rgba(108,99,255,0.3); }
  50% { box-shadow: 0 0 25px rgba(108,99,255,0.5); }
}
.btn-secondary {
  background: rgba(108,99,255,0.2);
  color: var(--accent-primary);
  border: 1px solid rgba(108,99,255,0.3);
  white-space: nowrap;
}
.btn-secondary:hover { background: rgba(108,99,255,0.3); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: var(--fs-sm);
  margin-top: var(--space-sm);
}
.btn-ghost:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.25); }

/* Room Actions */
.room-actions { display: flex; flex-direction: column; gap: var(--space-md); }
.room-divider { text-align: center; color: var(--text-muted); font-size: var(--fs-sm); position: relative; }
.room-divider::before, .room-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px;
  background: rgba(255,255,255,0.08);
}
.room-divider::before { left: 0; }
.room-divider::after { right: 0; }
.room-join-group { display: flex; gap: var(--space-sm); }
.room-input { flex: 1; text-transform: uppercase; letter-spacing: 3px; text-align: center; font-weight: 700; font-size: var(--fs-lg) !important; }

/* Status & Room Display */
.join-status {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  text-align: center;
}
.join-status.error { background: rgba(255,71,87,0.15); color: #ff6b7a; border: 1px solid rgba(255,71,87,0.2); }
.join-status.success { background: rgba(0,212,170,0.15); color: var(--accent-secondary); border: 1px solid rgba(0,212,170,0.2); }

.room-id-display { text-align: center; margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid rgba(255,255,255,0.06); }
.room-id-label { color: var(--text-secondary); font-size: var(--fs-sm); margin-bottom: var(--space-sm); }
.room-id-value {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent-secondary);
  background: rgba(0,212,170,0.1);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(0,212,170,0.3);
  font-variant-numeric: tabular-nums;
}
.room-id-waiting { color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--space-md); display: flex; align-items: center; justify-content: center; gap: var(--space-sm); }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

.join-footer { margin-top: var(--space-xl); color: var(--text-muted); font-size: var(--fs-xs); }

/* ════════════════════════════════════════════
   CALL SCREEN
   ════════════════════════════════════════════ */
.call-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #000;
  position: relative;
}

/* Header */
.call-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(to bottom, rgba(2,6,23,0.78) 0%, rgba(2,6,23,0.22) 58%, rgba(2,6,23,0) 100%);
  z-index: 10;
  pointer-events: none;
}
.call-header-left, .call-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  pointer-events: auto;
}
.call-header-left, .call-header-right { display: flex; align-items: center; gap: var(--space-md); }
.header-brand {
  font-weight: 900;
  font-size: 1rem;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.6);
}
.connection-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: rgba(6, 78, 59, 0.72);
  border: 1px solid rgba(52, 211, 153, 0.34);
  border-radius: 999px;
  color: #d1fae5;
  font-size: var(--fs-xs);
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-secondary); animation: pulse 2s infinite; }
.connection-badge.disconnected .badge-dot { background: var(--accent-danger); }
.call-timer,
.partner-info {
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
  font-size: var(--fs-sm);
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

/* Video Container */
.video-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  width: 100%;
}

.video-wrapper { position: relative; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.video-wrapper video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Remote video — fills container */
.video-remote {
  position: absolute;
  inset: 0;
  border-radius: 0;
  width: 100%;
  height: 100%;
}
.video-remote video { width: 100%; height: 100%; }

/* Local video — fixed PiP top-left corner (no drag, no resize, no scale) */
.video-local {
  position: absolute;
  top: 72px;          /* below the header bar */
  left: var(--space-lg);
  width: 260px;
  height: 195px;
  overflow: hidden;
  border-radius: 18px;
  border: 2px solid rgba(34, 211, 238, 0.38);
  box-shadow: 0 18px 48px rgba(0,0,0,0.42), 0 0 0 1px rgba(255,255,255,0.08) inset;
  z-index: 5;
  /* Fixed — pointer-events disabled so clicks pass through */
  pointer-events: none;
  cursor: default;
  /* No transition, no hover effect */
}

.video-label {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  padding: 5px 11px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  color: #e0f2fe;
  font-size: 0.72rem;
  font-weight: 900;
  z-index: 2;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.placeholder-avatar { font-size: 4rem; opacity: 0.4; }

/* ════════════════════════════════════════════
   TRANSCRIPT OVERLAY — Google Meet Style
   Clean floating caption bubble
   ════════════════════════════════════════════ */
.transcript-overlay {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: 85%;
  min-width: 320px;
  z-index: 8;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.5s ease;
}
.transcript-overlay.minimized { opacity: 0; pointer-events: none; }

/* Hide the scroll container chrome — only latest entry is visible */
.transcript-scroll {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow: visible;
}

/* Individual transcript entry — floating bubble */
.transcript-entry {
  width: 100%;
  padding: 14px 24px;
  background: rgba(32, 33, 36, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  border: none;
  animation: captionSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 0.6s ease;
  pointer-events: auto;
}

/* Fade-out class for auto-hide */
.transcript-entry.fading-out {
  animation: captionFadeOut 0.8s ease forwards;
}

@keyframes captionSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes captionFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

/* Original text line */
.transcript-original {
  margin-bottom: 6px;
  line-height: 1.6;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.transcript-translated {
  line-height: 1.6;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* Speaker label — small, subtle */
.transcript-speaker {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  opacity: 0.85;
}
.transcript-original .transcript-speaker { color: #8ab4f8; }
.transcript-translated .transcript-speaker { color: var(--accent-gold); }

/* Transcript text — clean, readable */
.transcript-original .transcript-text {
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}
.transcript-translated .transcript-text {
  color: var(--accent-gold);
  font-size: 0.92rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  opacity: 0.92;
}

/* Toggle button — repositioned for bubble style */
.transcript-toggle {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(32, 33, 36, 0.9);
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  z-index: 9;
  pointer-events: auto;
  opacity: 0;
}
.transcript-overlay:hover .transcript-toggle { opacity: 1; }
.transcript-toggle:hover { color: #fff; background: rgba(60, 64, 72, 0.95); }
.transcript-toggle svg { width: 14px; height: 14px; }

/* ════════════════════════════════════════════
   SCREENSHOT EFFECTS
   ════════════════════════════════════════════ */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.countdown-text {
  font-size: 15rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 0 40px rgba(0, 212, 170, 0.9);
  animation: countPop 1s ease-in-out forwards;
}
@keyframes countPop {
  0% { transform: scale(0.5); opacity: 0; }
  20% { transform: scale(1.1); opacity: 1; }
  80% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.flash-overlay {
  position: absolute;
  inset: 0;
  background: white;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
}
.flash-overlay.flash {
  animation: cameraFlash 0.5s ease-out;
}
@keyframes cameraFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ════════════════════════════════════════════
   CONTROL BAR
   ════════════════════════════════════════════ */
.control-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(8, 12, 28, 0.88));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  z-index: 40;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.control-bar:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    0 0 34px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 64px;
  height: 56px;
  padding: 6px;
  border: none;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  min-width: 0;
  font-family: var(--font-family);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
}
.control-btn:hover {
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.22), rgba(99, 102, 241, 0.14));
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(34, 211, 238, 0.22) inset;
}
.control-btn:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 3px;
}
.control-btn.active {
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.92), rgba(79, 70, 229, 0.92));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.34), 0 0 0 1px rgba(255,255,255,0.18) inset;
}
.control-btn.muted {
  background:
    linear-gradient(180deg, rgba(244, 63, 94, 0.92), rgba(190, 18, 60, 0.9));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(244, 63, 94, 0.32), 0 0 0 1px rgba(255,255,255,0.16) inset;
}
.control-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.control-label {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: currentColor;
}
.control-btn-danger {
  background:
    linear-gradient(180deg, #ff476b, #e11d48);
  color: #ffffff;
}
.control-btn-danger .control-icon {
  transform: rotate(135deg);
}
.control-btn-danger:hover {
  background:
    linear-gradient(180deg, #fb7185, #e11d48);
  box-shadow: 0 16px 36px rgba(225, 29, 72, 0.42), 0 0 0 1px rgba(255,255,255,0.2) inset;
}

/* ════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.toast {
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(7, 12, 28, 0.94);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 18px 45px rgba(0,0,0,0.38), 0 0 0 1px rgba(255,255,255,0.05) inset;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 800;
  animation: toastIn 0.3s ease-out;
  max-width: 350px;
}
.toast.info { border-left: 4px solid #38bdf8; }
.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #fb7185; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.toast.removing { animation: toastOut 0.3s ease-in forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
  .join-card { padding: var(--space-lg) var(--space-md); margin: var(--space-md); }
  .join-title { font-size: var(--fs-2xl); }
  .video-local { width: 140px; height: 105px; top: var(--space-sm); right: var(--space-sm); }
  .transcript-overlay { max-width: 95%; min-width: 260px; bottom: 10px; }
  .control-bar {
    width: calc(100% - 20px);
    bottom: 10px;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: 20px;
  }
  .control-btn {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 15px;
    padding: 8px 6px;
  }
  .control-icon { width: 21px; height: 21px; }
  .control-label { font-size: 0.66rem; }
}

/* Professional Auto-Hide UI */
body.is-idle {
  cursor: none;
}

body.is-idle .control-bar:not(:hover) {
  opacity: 0.08;
  transform: translateX(-50%) translateY(20px);
  pointer-events: none;
}

/* ========================================================
   LAYOUT MODES (PiP, Split, Reverse PiP)
   ======================================================== */

.video-wrapper {
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Split Mode */
.video-container.mode-split .video-remote,
.video-container.mode-split .video-local {
  position: relative !important;
  width: 50% !important;
  height: 100% !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  z-index: 1 !important;
}

@media (max-width: 768px) {
  .video-container.mode-split {
    flex-direction: column;
  }
  .video-container.mode-split .video-remote,
  .video-container.mode-split .video-local {
    width: 100% !important;
    height: 50% !important;
  }
}

/* Reverse PiP Mode (Local full, Remote small) */
.video-container.mode-reverse-pip .video-local {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  right: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 1 !important;
  transform: none !important;
}

.video-container.mode-reverse-pip .video-remote {
  position: absolute !important;
  top: var(--space-lg) !important;
  right: var(--space-lg) !important;
  width: 220px !important;
  height: 165px !important;
  border-radius: 18px !important;
  border: 2px solid rgba(34, 211, 238, 0.38) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,0.42), 0 0 0 1px rgba(255,255,255,0.08) inset !important;
  z-index: 5 !important;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

@media (max-width: 768px) {
  .video-container.mode-reverse-pip .video-remote {
    top: auto !important;
    bottom: 90px !important;
    right: 15px !important;
    width: 120px !important;
    height: 160px !important;
  }
}

/* ── Resize handle removed (PiP is now fixed) ── */
.resize-handle { display: none !important; }

/* ════════════════════════════════════════════
   LAYOUT MODES — only Split remains useful
   Reverse-PiP kept but simplified (no pointer-events)
   ════════════════════════════════════════════ */

.video-wrapper {
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Split Mode */
.video-container.mode-split .video-remote,
.video-container.mode-split .video-local {
  position: relative !important;
  width: 50% !important;
  height: 100% !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

@media (max-width: 768px) {
  .video-local { width: 130px; height: 98px; top: 64px; left: var(--space-sm); }
  .video-container.mode-split {
    flex-direction: column;
  }
  .video-container.mode-split .video-remote,
  .video-container.mode-split .video-local {
    width: 100% !important;
    height: 50% !important;
  }
}
