/* Tarjeta flotante de llamada (portal y panel) */
.nexo-call { position: fixed; right: 16px; bottom: 16px; z-index: 9000; max-width: calc(100vw - 32px); width: 340px; }
.nexo-call.hidden { display: none; }
.nexo-call .nc-card { background: var(--surface, #fff); color: var(--text, #111); border: 1px solid var(--border, #ddd); border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.nexo-call .nc-head { display: flex; gap: 10px; align-items: center; }
.nexo-call .nc-icon { font-size: 26px; }
.nexo-call .nc-title { font-weight: 700; font-size: 15px; }
.nexo-call .nc-sub { font-size: 12px; color: var(--muted, #777); }
.nexo-call .nc-status { font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nexo-call .nc-timer { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 4px; }
.nexo-call .nc-dot { width: 9px; height: 9px; border-radius: 50%; background: #999; display: inline-block; }
.nexo-call .nc-dot.ringing, .nexo-call .nc-dot.connecting { background: #f1c40f; animation: ncblink 1s infinite; }
.nexo-call .nc-dot.active { background: #2ecc71; }
.nexo-call .nc-dot.failed, .nexo-call .nc-dot.missed, .nexo-call .nc-dot.rejected { background: #e74c3c; }
.nexo-call .nc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nexo-call .nc-btn { flex: 1; min-width: 110px; padding: 12px 10px; border-radius: 12px; border: 1px solid var(--border, #ddd); background: var(--bg, #f4f4f4); color: var(--text, #111); font-size: 14px; font-weight: 600; cursor: pointer; }
.nexo-call .nc-btn.accept { background: #2ecc71; color: #fff; border-color: #27ae60; }
.nexo-call .nc-btn.reject { background: #e74c3c; color: #fff; border-color: #c0392b; }
.nexo-call .nc-secure { font-size: 11px; color: var(--muted, #777); }
/* Llamada entrante: ocupa el centro en el teléfono para que no pase desapercibida */
.nexo-call.ringing { left: 16px; right: 16px; bottom: auto; top: 50%; transform: translateY(-50%); width: auto; max-width: 420px; margin: 0 auto; }
.nexo-call.ringing .nc-card { border-color: #2ecc71; box-shadow: 0 0 0 6px rgba(46, 204, 113, .25), 0 12px 40px rgba(0, 0, 0, .4); animation: ncpulse 1.4s ease-in-out infinite; }
.nexo-call.ringing .nc-icon { font-size: 40px; animation: ncshake 1s infinite; }
@keyframes ncblink { 50% { opacity: .3; } }
@keyframes ncpulse { 50% { box-shadow: 0 0 0 14px rgba(46, 204, 113, 0), 0 12px 40px rgba(0, 0, 0, .4); } }
@keyframes ncshake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-15deg); } 75% { transform: rotate(15deg); } }
@media (max-width: 600px) { .nexo-call { right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); } }

/* Vídeo y pantalla compartida. La tarjeta de la llamada crece solo cuando hay imagen:
   en una llamada de voz normal no se ve nada de esto. */
.nexo-call .nc-video { position: relative; border-radius: 12px; overflow: hidden; background: #000; }
.nexo-call .nc-video video { display: block; width: 100%; max-height: 42vh; object-fit: contain; background: #000; }
.nexo-call .nc-video video.hidden { display: none; }
.nexo-call .nc-local { position: absolute; right: 8px; bottom: 8px; width: 28%; max-width: 150px;
  max-height: 110px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.nexo-call .nc-video:has(#ncRemoteVideo.hidden) .nc-local { position: static; width: 100%; max-width: none; max-height: 42vh; border: 0; box-shadow: none; }
/* Con vídeo la tarjeta se convierte en un panel de verdad: una pantalla compartida
   metida en 340 px no se lee, y leerla es justo para lo que sirve. */
.nexo-call.con-video { width: min(96vw, 1000px); right: 2vw; bottom: 12px; }
.nexo-call.con-video .nc-video video { max-height: min(68vh, 620px); }
.nexo-call .nc-zoom { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 8px;
  border: 0; cursor: pointer; font-size: 16px; line-height: 1; color: #fff; background: rgba(0, 0, 0, .55); }
.nexo-call .nc-zoom:hover { background: rgba(0, 0, 0, .8); }
.nexo-call .nc-zoom.hidden { display: none; }
/* A pantalla completa manda la imagen: el recuadro propio se queda pequeño en la esquina */
.nexo-call .nc-video:fullscreen { display: grid; place-items: center; background: #000; }
.nexo-call .nc-video:fullscreen video#ncRemoteVideo { width: 100vw; height: 100vh; max-height: none; object-fit: contain; }
.nexo-call .nc-video:fullscreen .nc-local { position: absolute; right: 16px; bottom: 16px; width: 18vw; max-width: 260px; max-height: 200px; }

/* Aviso de grabación y petición de compartir pantalla */
.nexo-call .nc-rec { font-size: 12.5px; font-weight: 600; color: #e74c3c; display: flex; align-items: center; gap: 6px; }
.nexo-call .nc-rec.aviso { font-weight: 500; line-height: 1.4; background: rgba(231, 76, 60, .12);
  border: 1px solid rgba(231, 76, 60, .4); border-radius: 10px; padding: 8px 10px; color: inherit; }
.nexo-call .nc-pide { font-size: 12.5px; line-height: 1.4; background: rgba(46, 134, 222, .12);
  border: 1px solid rgba(46, 134, 222, .4); border-radius: 10px; padding: 8px 10px; }
.nexo-call .nc-btn[disabled] { opacity: .45; cursor: not-allowed; }
.nexo-call .aviso-cerrable { position: relative; padding-right: 32px; }
.nexo-call .nc-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0;
  border-radius: 6px; background: transparent; color: inherit; cursor: pointer; font-size: 13px; opacity: .6; }
.nexo-call .nc-x:hover { opacity: 1; background: rgba(0, 0, 0, .12); }
