/* FOTP comms.css — Communication UI (calls, messages, PTT).
   Follows the tactical.css military C2 aesthetic. */

/* ═══════════════════════════════ SIP INDICATOR ═══════════════════ */
.sip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-label); display: inline-block;
  margin-right: 6px; vertical-align: middle;
  transition: background .3s ease;
}
.sip-dot.connected {
  background: var(--ok);
  box-shadow: 0 0 6px rgba(110,142,98,.6);
}

/* ═══════════════════════════════ CALL OVERLAY ════════════════════ */
.call-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  z-index: 4000; display: flex; align-items: center; justify-content: center;
}
.call-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; text-align: center;
  min-width: 320px; max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.call-status {
  font-size: 14px; font-weight: 600; color: var(--accent);
  margin-bottom: 4px; letter-spacing: .05em;
}
.call-label {
  font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  margin-bottom: 12px;
}
.call-timer {
  font-family: var(--mono); font-size: 28px; font-weight: 600;
  color: var(--ok); letter-spacing: .1em; margin: 12px 0;
}
.call-btns { display: flex; gap: 8px; justify-content: center; }
.call-card video {
  width: 100%; max-height: 320px; border-radius: var(--radius-sm);
  background: #000; margin: 8px 0;
}
.call-card video[style*="display: none"] { margin: 0; }

/* ═══════════════════════════════ INCOMING CALL ═══════════════════ */
.incoming-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  z-index: 4500; display: flex; align-items: center; justify-content: center;
}
.incoming-card {
  background: var(--surface); border: 2px solid var(--ok);
  border-radius: var(--radius); padding: 32px; text-align: center;
  min-width: 300px; box-shadow: 0 0 30px rgba(110,142,98,.3);
  animation: pulse-border 1.5s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: var(--ok); box-shadow: 0 0 15px rgba(110,142,98,.2); }
  50% { border-color: var(--accent); box-shadow: 0 0 30px rgba(79,163,181,.3); }
}
.incoming-ring {
  font-size: 48px; margin-bottom: 12px;
  animation: ring-shake .4s ease-in-out infinite;
}
@keyframes ring-shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}
.incoming-text { font-size: 14px; color: var(--text); margin-bottom: 20px; }
.incoming-btns { display: flex; gap: 12px; justify-content: center; }
.incoming-btns button { flex: 1; font-size: 13px; padding: 10px; }

/* ═══════════════════════════════ MESSAGE PANEL ═══════════════════ */
.msg-panel {
  position: fixed; bottom: 0; right: 16px; width: 380px; height: 480px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.4);
  z-index: 3000; display: flex; flex-direction: column;
}
.msg-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border-subtle);
  font-weight: 600; font-size: 13px; color: var(--text);
  background: var(--surface-2);
}
.msg-body {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.msg-input {
  display: flex; gap: 6px; padding: 8px 10px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.msg-input input {
  flex: 1; margin: 0; padding: 6px 10px; font-size: 12px;
}
.msg-attach-btn {
  cursor: pointer; display: flex; align-items: center;
  font-size: 18px; padding: 0 4px;
}

/* ── Message Bubbles ────────────────────────────────────────────── */
.msg-bubble {
  max-width: 80%; padding: 8px 12px;
  border-radius: 12px; font-size: 12.5px; line-height: 1.4;
  position: relative; word-wrap: break-word;
}
.msg-bubble.out {
  align-self: flex-end;
  background: rgba(79,163,181,.12); border: 1px solid rgba(79,163,181,.2);
  color: var(--text); border-bottom-right-radius: 4px;
}
.msg-bubble.in {
  align-self: flex-start;
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  color: var(--text); border-bottom-left-radius: 4px;
}
.msg-ts {
  font-family: var(--mono); font-size: 9px; color: var(--text-label);
  margin-top: 4px; text-align: right;
}
.msg-thumb {
  max-width: 200px; max-height: 150px; border-radius: var(--radius-sm);
  cursor: pointer; margin: 4px 0; display: block;
  border: 1px solid var(--border-subtle);
  transition: transform .15s ease;
}
.msg-thumb:hover { transform: scale(1.03); }
.msg-ai {
  display: inline-block; cursor: pointer; font-size: 14px;
  margin-left: 6px; opacity: .7; transition: opacity .15s;
}
.msg-ai:hover { opacity: 1; }

/* ── Unread badge ───────────────────────────────────────────────── */
.msg-badge {
  font-size: 12px; margin-left: auto; animation: badge-pop .3s ease;
}
@keyframes badge-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* ═══════════════════════════════ AI ANALYSIS POPUP ═══════════════ */
.ai-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  z-index: 5000; display: flex; align-items: center; justify-content: center;
}
.ai-popup {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; max-width: 520px; width: 90%;
  box-shadow: var(--shadow-card); max-height: 80vh; overflow-y: auto;
}
.ai-popup h3 { margin: 0 0 12px; font-size: 14px; color: var(--accent); }
.ai-popup p { margin: 6px 0; font-size: 12.5px; line-height: 1.5; }
.ai-popup strong { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* ═══════════════════════════════ TOAST NOTIFICATIONS ═════════════ */
.toast {
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); box-shadow: var(--shadow-card);
  transform: translateX(100%); opacity: 0;
  transition: all .3s ease; pointer-events: auto;
  max-width: 340px;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.alert {
  border-color: rgba(139,58,58,.4); color: var(--alert);
  background: rgba(139,58,58,.08);
}
.toast.info {
  border-left: 3px solid var(--accent);
}

/* ═══════════════════════════════ COMM BUTTONS IN POPUP ═══════════ */
.comm-btns {
  display: flex; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border-subtle);
}
.comm-btn {
  flex: 1; padding: 6px 4px; border-radius: var(--radius-sm);
  background: rgba(79,163,181,.08); border: 1px solid rgba(79,163,181,.2);
  color: var(--accent); cursor: pointer; text-align: center;
  font-size: 10px; font-weight: 500; letter-spacing: .03em;
  transition: all .15s ease; margin: 0;
}
.comm-btn:hover {
  background: rgba(79,163,181,.18); border-color: rgba(79,163,181,.4);
}
.comm-btn .icon { font-size: 16px; display: block; margin-bottom: 2px; }

/* ═══════════════════════════════ RESPONSIVE ══════════════════════ */
@media (max-width: 800px) {
  .msg-panel { width: 100%; right: 0; height: 60vh; }
  .call-card { min-width: 280px; }
}
