/**
 * Magna AI - Voice Call Styles
 *
 * Call screen overlay UI for real-time voice calls.
 *
 * ★ PORTED from ConfidenceTalk `public/css/voice-call.css` (2026-10-01).
 *   Prefix-adapted `ct-` → `aisg-`. Every class below was verified against the
 *   23 `aisg-voice-call-*` classes ACTUALLY rendered by `class-public.php`.
 *
 * ★ THEME-CONFORMANT. The card reads the theme token with a literal fallback —
 *   the CT original hardcoded the default gradient. The CT avatar used
 *   `var(--color-primary-gradient, ...)`; that var does NOT exist in AISG, so
 *   it is re-pointed at the AISG brand token.
 *
 * @package AISG
 */

/* ===== Voice Call Card ===== */
.aisg-voice-call-card {
  background: var(--aisg-hf-bg-alt, linear-gradient(135deg, #2c3e50, #34495e, #7f8c8d));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
}

/* ===== Accessibility ===== */
.aisg-voice-call-btn:focus-visible,
.aisg-voice-call-start .aisg-btn:focus-visible,
.aisg-voice-call-btn:focus {
  outline: 2px solid #CD853F;
  outline-offset: 2px;
}

.aisg-voice-call-transcript {
  /* aria-live region for screen readers */
  min-height: 1em;
}

/* ★ `-transcript-line` is the class `public/js/voice-call.js` ADDS when it
   appends a transcript entry (:123). The CT sheet styled `-transcript-entry`,
   which AISG never uses — that rule was measured as dead CSS by
   `.dev/verify-r5-groups.php` §4 and removed. This rule exists because the JS
   actually creates the element. */
.aisg-voice-call-transcript-line {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
  word-wrap: break-word;
}

@media (prefers-reduced-motion: reduce) {
  .aisg-voice-call-btn {
    transition: none;
  }

  .aisg-voice-call-btn:hover {
    transform: none;
  }

  .aisg-voice-call-avatar-inner {
    transition: none;
  }
}

.aisg-voice-call-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.aisg-voice-call-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

/* ===== Call Body ===== */
.aisg-voice-call-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

/* Agent avatar */
.aisg-voice-call-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--aisg-hf-accent, #CD853F);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 10px 25px -5px rgba(139, 69, 19, 0.4);
  position: relative;
}

.aisg-voice-call-avatar-inner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  transition: transform 0.2s ease;
}

/* Agent name */
.aisg-voice-call-agent-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

/* Timer */
.aisg-voice-call-timer {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

/* Transcript */
.aisg-voice-call-transcript {
  width: 100%;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.5;
}

.aisg-voice-call-transcript-line {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
  word-wrap: break-word;
}

/* ===== Controls ===== */
.aisg-voice-call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.aisg-voice-call-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.aisg-voice-call-btn:hover {
  transform: scale(1.05);
}

.aisg-voice-call-btn-icon {
  font-size: 20px;
}

/* Mute button — active state is driven by `aria-pressed`, which is what
   `public/js/voice-call.js` actually sets (:244). The CT sheet used a class
   (`-btn-active`) AISG never adds; that rule was measured dead and replaced. */
.aisg-voice-call-btn-mute {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.aisg-voice-call-btn-mute[aria-pressed="true"],
.aisg-voice-call-btn-speaker[aria-pressed="true"] {
  background: rgba(70, 130, 180, 0.3);
  border-color: #4682B4;
}

/* End call button */
.aisg-voice-call-btn-end {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  box-shadow: 0 8px 20px -4px rgba(231, 76, 60, 0.5);
  transform: rotate(-45deg);
}

.aisg-voice-call-btn-end:hover {
  transform: rotate(-45deg) scale(1.05);
}

/* Speaker button */
.aisg-voice-call-btn-speaker {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== Start Screen ===== */
.aisg-voice-call-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.aisg-voice-call-start .aisg-btn {
  margin-top: 8px;
  padding: 12px 28px;
  font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .aisg-voice-call-card {
    padding: 14px;
  }

  .aisg-voice-call-avatar {
    width: 80px;
    height: 80px;
  }

  .aisg-voice-call-avatar-inner {
    width: 68px;
    height: 68px;
    font-size: 32px;
  }

  .aisg-voice-call-btn {
    width: 44px;
    height: 44px;
  }

  .aisg-voice-call-btn-icon {
    font-size: 17px;
  }

  .aisg-voice-call-transcript {
    max-height: 90px;
  }
}

@media (max-width: 480px) {
  .aisg-voice-call-controls {
    gap: 14px;
  }

  .aisg-voice-call-agent-name {
    font-size: 16px;
  }

  .aisg-voice-call-status {
    font-size: 11px;
    padding: 3px 8px;
  }
}
