/* Audio / video call overlay + incoming call cards (shared by index.html and admin.html) */
.mp-call {
  position: fixed; inset: 0; z-index: 1000;
  display: none; flex-direction: column;
  background: radial-gradient(circle at 50% 30%, #2a1a4d 0%, #0c0a1a 70%);
  color: #f4f4f6; font-family: "DM Sans", system-ui, sans-serif;
}
.mp-call.open { display: flex; }
.mp-call-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.mp-call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .3s; }
.mp-call.has-video .mp-call-remote { opacity: 1; }
.mp-call.audio-only .mp-call-remote { pointer-events: none; }

.mp-call-identity {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px;
  transition: all .3s;
}
.mp-call-photo { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 3px solid #8d48f2; box-shadow: 0 0 0 10px rgba(141,72,242,.16); margin-bottom: 12px; }
.mp-call:not(.is-connected) .mp-call-photo { animation: mp-call-pulse 1.8s ease-in-out infinite; }
.mp-call-name { margin: 0; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 24px; }
.mp-call-status { margin: 0; color: #cbbef0; font-size: 14px; font-variant-numeric: tabular-nums; min-height: 18px; }

.mp-call.has-video .mp-call-identity {
  inset: 16px auto auto 16px; flex-direction: row; gap: 10px; padding: 8px 14px 8px 8px;
  background: rgba(12,10,26,.62); backdrop-filter: blur(8px); border-radius: 999px; text-align: left;
}
.mp-call.has-video .mp-call-photo { width: 36px; height: 36px; margin: 0; border-width: 2px; box-shadow: none; }
.mp-call.has-video .mp-call-name { font-size: 15px; }
.mp-call.has-video .mp-call-status { font-size: 12px; }

.mp-call-local {
  position: absolute; right: 16px; bottom: 16px; width: min(28vw, 220px); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: 14px; background: #15131f; border: 1px solid rgba(255,255,255,.14);
  transform: scaleX(-1); box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.mp-call.audio-only .mp-call-local, .mp-call.local-off .mp-call-local { display: none; }

.mp-call-controls { display: flex; justify-content: center; gap: 18px; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.mp-call-btn {
  width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background .15s, transform .15s;
}
.mp-call-btn:hover { background: rgba(255,255,255,.18); }
.mp-call-btn:active { transform: scale(.94); }
.mp-call-btn[aria-pressed="true"] { background: #f4f4f6; color: #15131f; }
.mp-call-btn[hidden] { display: none; }
.mp-call-btn svg, .mp-call-incoming svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mp-call-hangup, .mp-call-decline { background: #e5484d; border-color: #e5484d; }
.mp-call-hangup:hover, .mp-call-decline:hover { background: #f2555a; }
.mp-call-hangup svg, .mp-call-decline svg { fill: currentColor; stroke: none; }
.mp-call-btn:focus-visible, .mp-call-incoming button:focus-visible { outline: 2px solid #cda9ff; outline-offset: 3px; }

.mp-call-incoming-stack { position: fixed; right: 18px; bottom: 18px; z-index: 1001; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.mp-call-incoming {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px;
  background: #1b1730; border: 1px solid #3a2f63; color: #f4f4f6; box-shadow: 0 16px 40px rgba(0,0,0,.45);
  animation: mp-call-in .25s ease-out;
}
.mp-call-incoming img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mp-call-incoming > div:not(.mp-call-incoming-actions) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-call-incoming strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-call-incoming small { color: #a59cc0; font-size: 12px; }
.mp-call-incoming-actions { display: flex; gap: 8px; }
.mp-call-incoming-actions button { width: 42px; height: 42px; border-radius: 50%; border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; }
.mp-call-incoming-actions svg { width: 20px; height: 20px; }
.mp-call-accept { background: #2fb36d; animation: mp-call-ring 1.2s ease-in-out infinite; }
.mp-call-accept:hover { background: #38c47a; }

.admin-status.offline i { background: #e5484d; }
.person-avatar i.is-offline, .chat-contact i.is-offline { background: #6b6780 !important; }
.card-name i.is-online { background: #51d69a; }
/* Person (companion) using the chat screen: hide member-only controls. */
.chat-layout.companion-mode .favorite-btn,
.chat-layout.companion-mode #imageBtn,
.chat-layout.companion-mode .chat-tabs { display: none; }
.chat-layout.companion-mode #messageInput:disabled { opacity: .6; cursor: not-allowed; }
.message.pending { opacity: .6; }
.message.failed { outline: 1px solid #e5484d; outline-offset: 2px; }
.chat-typing {align-self: flex-start; color: #8e899e; font-size: 12px; padding: 2px 4px; }

@keyframes mp-call-pulse { 0%, 100% { box-shadow: 0 0 0 8px rgba(141,72,242,.18); } 50% { box-shadow: 0 0 0 20px rgba(141,72,242,.05); } }
@keyframes mp-call-ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } 50% { transform: rotate(0); } }
@keyframes mp-call-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .mp-call-photo, .mp-call-accept, .mp-call-incoming { animation: none !important; }
}
@media (max-width: 600px) {
  .mp-call-local { width: 34vw; right: 10px; bottom: 10px; }
  .mp-call-btn { width: 54px; height: 54px; }
}
