/**
 * Confidence Talk - Voice Call Styles
 * Call screen overlay UI for real-time voice calls.
 *
 * @package ConfidenceTalk
 */

/* ===== Voice Call Card ===== */
.ct-voice-call-card {
  background: linear-gradient(135deg, #2c3e50, #34495e, #7f8c8d);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
}

/* ===== Accessibility ===== */
.ct-voice-call-btn:focus-visible,
.ct-voice-call-start .ct-btn:focus-visible,
.ct-voice-call-btn:focus {
  outline: 2px solid #CD853F;
  outline-offset: 2px;
}

.ct-voice-call-transcript {
  /* aria-live region for screen readers */
  min-height: 1em;
}

@media (prefers-reduced-motion: reduce) {
  .ct-voice-call-avatar.ct-voice-call-speaking .ct-voice-call-avatar-inner,
  .ct-voice-call-avatar.ct-voice-call-speaking::after {
    animation: none;
  }

  .ct-voice-call-btn {
    transition: none;
  }

  .ct-voice-call-btn:hover {
    transform: none;
  }

  .ct-voice-call-avatar-inner {
    transition: none;
  }
}

.ct-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);
}

.ct-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;
}

.ct-voice-call-status.ct-voice-call-error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}

/* ===== Call Body ===== */
.ct-voice-call-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

/* Agent avatar */
.ct-voice-call-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--color-primary-gradient, linear-gradient(135deg, #8B4513, #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;
}

.ct-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;
}

/* Speaking animation */
.ct-voice-call-avatar.ct-voice-call-speaking .ct-voice-call-avatar-inner {
  animation: ctVoiceCallBounce 0.6s ease-in-out infinite alternate;
}

.ct-voice-call-avatar.ct-voice-call-speaking::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #CD853F;
  animation: ctVoiceCallPulse 1.2s ease-in-out infinite;
}

@keyframes ctVoiceCallBounce {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

@keyframes ctVoiceCallPulse {
  0%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 0.5; }
  100% { opacity: 1; transform: scale(1.05); }
}

/* Agent name */
.ct-voice-call-agent-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

/* Timer */
.ct-voice-call-timer {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

/* Transcript */
.ct-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;
}

.ct-voice-call-transcript-entry {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
  word-wrap: break-word;
}

.ct-voice-call-transcript-entry strong {
  color: rgba(255, 255, 255, 0.9);
}

.ct-voice-call-transcript-user {
  color: #CD853F;
}

.ct-voice-call-transcript-agent {
  color: #e2e8f0;
}

.ct-voice-call-transcript-system {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

/* ===== Controls ===== */
.ct-voice-call-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.ct-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;
}

.ct-voice-call-btn:hover {
  transform: scale(1.05);
}

.ct-voice-call-btn-icon {
  font-size: 20px;
}

/* Mute button */
.ct-voice-call-btn-mute {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ct-voice-call-btn-mute.ct-voice-call-btn-active {
  background: rgba(70, 130, 180, 0.3);
  border-color: #4682B4;
}

/* End call button */
.ct-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);
}

.ct-voice-call-btn-end:hover {
  transform: rotate(-45deg) scale(1.05);
}

/* Speaker button */
.ct-voice-call-btn-speaker {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== Start Screen ===== */
.ct-voice-call-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  text-align: center;
}

.ct-voice-call-start .ct-btn {
  margin-top: 8px;
  padding: 12px 28px;
  font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .ct-voice-call-card {
    padding: 14px;
  }

  .ct-voice-call-avatar {
    width: 80px;
    height: 80px;
  }

  .ct-voice-call-avatar-inner {
    width: 68px;
    height: 68px;
    font-size: 32px;
  }

  .ct-voice-call-btn {
    width: 44px;
    height: 44px;
  }

  .ct-voice-call-btn-icon {
    font-size: 17px;
  }

  .ct-voice-call-transcript {
    max-height: 90px;
  }
}

@media (max-width: 480px) {
  .ct-voice-call-controls {
    gap: 14px;
  }

  .ct-voice-call-agent-name {
    font-size: 16px;
  }

  .ct-voice-call-status {
    font-size: 11px;
    padding: 3px 8px;
  }
}