/* live-call-ux-plus.css — UX/estética extra para salas voz/vídeo (2026-04-14)
   Objetivo: “filosofía VDO Ninja” (mosaico claro, estado cámara/mic visible),
   mejor en móvil/PC, sin tocar build: solo CSS.
*/

:root {
  --tbai-live-surface: rgba(15, 23, 42, 0.86);
  --tbai-live-border: rgba(56, 189, 248, 0.18);
  --tbai-live-border-2: rgba(99, 102, 241, 0.22);
  --tbai-live-glow: rgba(56, 189, 248, 0.22);
  --tbai-live-text: #e2e8f0;
  --tbai-live-muted: #94a3b8;
}

/* Fondo “studio” en páginas live */
.live-call-root,
.live-mobile-wrap,
[data-livekit-room],
[data-live-room] {
  background:
    radial-gradient(ellipse 110% 70% at 50% -25%, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(ellipse 90% 70% at 90% 90%, rgba(139, 92, 246, 0.08), transparent 50%),
    #070b12 !important;
}

/* Tiles (LiveKit) — estilo mosaico */
.lk-grid-layout,
.lk-focus-layout {
  gap: 8px !important;
  padding: 10px !important;
}

.lk-participant-tile,
.live-grid-tile,
.live-cam-tile {
  border-radius: 14px !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(2, 6, 23, 0.85)) !important;
  border: 1px solid var(--tbai-live-border) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 34px rgba(0,0,0,0.45);
  transform: translateZ(0);
}

.lk-participant-tile:hover,
.live-grid-tile:hover,
.live-cam-tile:hover {
  border-color: rgba(56, 189, 248, 0.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 16px 44px rgba(0,0,0,0.55),
    0 0 32px rgba(56, 189, 248, 0.12);
}

/* “Active speaker” (si la librería marca estado) */
.lk-participant-tile[data-speaking='true'],
.lk-participant-tile.lk-speaking,
.live-grid-tile.speaking,
.live-cam-tile.speaking {
  border-color: rgba(34, 211, 238, 0.6) !important;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.22), 0 0 38px rgba(34, 211, 238, 0.16) !important;
}

/* Labels más legibles */
.lk-participant-name,
.live-grid-tile__label,
.live-cam-tile__label,
.live-mobile-tile-cap,
.live-mobile-hero-cap {
  color: var(--tbai-live-text) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 18px rgba(0,0,0,0.55) !important;
  letter-spacing: 0.01em;
}

/* Indicadores mic/cam (si existen) */
.lk-participant-metadata,
.lk-participant-tile .lk-participant-metadata,
.lk-participant-tile .lk-participant-metadata * {
  color: var(--tbai-live-text) !important;
}

/* Controles: más “premium” y consistentes */
.live-controls,
.live-mobile-dock,
.live-viewer-bar {
  border: 1px solid rgba(148, 163, 184, 0.14) !important;
  background: rgba(15, 23, 42, 0.74) !important;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.live-btn {
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease !important;
}
.live-btn:active {
  transform: translateY(1px) scale(0.99);
}

/* Panel roster (live-room-participants.js) — más “mosaico” */
#tbai-live-room-roster {
  border: 1px solid rgba(56, 189, 248, 0.26) !important;
  box-shadow: 0 14px 46px rgba(0,0,0,0.55), 0 0 28px rgba(56, 189, 248, 0.10) !important;
}
#tbai-live-room-roster ul {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
@media (max-width: 520px) {
  #tbai-live-room-roster ul { grid-template-columns: 1fr !important; }
}
#tbai-live-room-roster li {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  background: rgba(30, 41, 59, 0.62) !important;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .live-btn,
  .lk-participant-tile,
  .live-grid-tile,
  .live-cam-tile {
    transition: none !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Grid/Focus layout — fill viewport, no scroll (mosaico + auto)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Main container: fill available height */
.lk-room-container,
[data-lk-theme] {
  height: 100% !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Grid and focus layouts: fill remaining space, no overflow */
.lk-grid-layout {
  flex: 1 1 0 !important;
  height: auto !important;
  max-height: calc(100vh - 80px) !important;
  overflow: hidden !important;
  align-content: center !important;
}

.lk-focus-layout {
  flex: 1 1 0 !important;
  height: auto !important;
  max-height: calc(100vh - 80px) !important;
  overflow: hidden !important;
}

/* Tiles: scale to fit within grid, never overflow */
.lk-grid-layout .lk-participant-tile {
  max-height: 100% !important;
  min-height: 0 !important;
}

.lk-grid-layout .lk-participant-tile video {
  object-fit: contain !important;
  max-height: 100% !important;
}

/* Focus layout: main area fills, carousel stays small */
.lk-focus-layout__content {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.lk-carousel {
  flex-shrink: 0 !important;
  max-height: 120px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

/* Live call root: ensure full viewport usage */
.live-call-root {
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Controls bar at bottom: fixed height */
.live-controls {
  flex-shrink: 0 !important;
}

/* Active speaker glow effect */
.lk-participant-tile[data-speaking='true']::after,
.lk-participant-tile.lk-speaking::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 0.5);
  animation: tbai-speak-glow 1.5s ease-in-out infinite;
}

@keyframes tbai-speak-glow {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 0.3), 0 0 12px rgba(34, 211, 238, 0.1); }
  50% { box-shadow: inset 0 0 0 2px rgba(34, 211, 238, 0.6), 0 0 24px rgba(34, 211, 238, 0.2); }
}

/* Responsive tiles: adapt grid based on participant count */
@media (min-width: 768px) {
  .lk-grid-layout {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    grid-auto-rows: 1fr !important;
  }
}

@media (max-width: 767px) {
  .lk-grid-layout {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    grid-auto-rows: 1fr !important;
  }
  .lk-carousel {
    max-height: 80px !important;
  }
}
