/* ============================================================
   call-agent.css  —  AI Sales Call Agent panel styles
   Follows the same design language as the rest of the app
   ============================================================ */

/* ── Keyframe for spinner dots ─────────────────────────────── */
@keyframes capPulse {

  0%,
  100% {
    opacity: .2;
    transform: scale(.8);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Container injected into sidebar / panel ──────────────── */
#callAgentContainer {
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Outer panel card ─────────────────────────────────────── */
.cap-panel {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border, #E5E7EB);
  background: var(--surface, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Section heading ──────────────────────────────────────── */
.cap-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: -4px;
}

/* ── Header row ───────────────────────────────────────────── */
.cap-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cap-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0A66C218;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.cap-header-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #1F2937);
}

.cap-header-sub {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
}

/* ── Company cards ────────────────────────────────────────── */
.cap-company-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cap-company-card {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #E5E7EB);
  background: var(--surface, #fff);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color .15s, background .15s;
}

.cap-company-card:hover {
  border-color: #0A66C280;
}

.cap-company-card.selected {
  border-color: #0A66C2;
  background: #0A66C208;
}

.cap-company-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary, #1F2937);
}

.cap-company-sub {
  font-size: 11px;
  color: var(--text-muted, #6B7280);
}

.cap-phone-count {
  font-size: 11px;
}

.cap-phone-count.has-phone {
  color: #10B981;
}

.cap-phone-count.no-phone {
  color: #6B7280;
}

/* ── Contact cards ────────────────────────────────────────── */
.cap-contact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cap-contact-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #E5E7EB);
  background: var(--surface, #fff);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  transition: border-color .15s;
}

.cap-contact-card:hover:not(.disabled) {
  border-color: #0A66C280;
}

.cap-contact-card.selected {
  border-color: #0A66C2;
  background: #0A66C208;
}

.cap-contact-card.disabled {
  opacity: .55;
  cursor: not-allowed;
}

.cap-contact-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary, #1F2937);
}

.cap-contact-title {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
  margin-top: 2px;
}

.cap-contact-email {
  font-size: 11px;
  color: var(--text-muted, #6B7280);
  margin-top: 6px;
}

.cap-contact-phone {
  flex-shrink: 0;
}

/* ── Badge ────────────────────────────────────────────────── */
.cap-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

/* ── Language picker ──────────────────────────────────────── */
.cap-lang-row {
  display: flex;
  gap: 8px;
}

.cap-lang-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 8px;
  border: 1.5px solid var(--border, #E5E7EB);
  background: transparent;
  color: var(--text-muted, #6B7280);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.cap-lang-btn.active {
  border-color: #0A66C2;
  background: #0A66C20e;
  color: #0A66C2;
  font-weight: 500;
}

.cap-lang-btn:hover:not(.active) {
  border-color: #0A66C260;
}

/* ── AI preview box ───────────────────────────────────────── */
.cap-ai-preview {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-alt, #F9FAFB);
  border: 1px solid var(--border, #E5E7EB);
  font-size: 12px;
  color: var(--text-muted, #6B7280);
  line-height: 1.7;
}

.cap-ai-preview-label {
  font-weight: 500;
  color: var(--text-primary, #1F2937);
}

/* ── Error ────────────────────────────────────────────────── */
.cap-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: #EF444410;
  border: 1px solid #EF444430;
  color: #EF4444;
  font-size: 13px;
}

/* ── Launch button ────────────────────────────────────────── */
.cap-launch-btn {
  width: 100%;
  padding: 12px 0;
  border-radius: 10px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, opacity .15s;
  font-family: inherit;
  cursor: pointer;
}

.cap-launch-btn.active {
  background: #0A66C2;
  color: #fff;
}

.cap-launch-btn.active:hover {
  background: #0855a3;
}

.cap-launch-btn.disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  cursor: not-allowed;
}

/* ── Disclaimer ───────────────────────────────────────────── */
.cap-disclaimer {
  font-size: 11px;
  color: var(--text-muted, #6B7280);
  text-align: center;
}

/* ── Hint text ────────────────────────────────────────────── */
.cap-hint {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
  margin: 0;
}

/* ── Empty state ──────────────────────────────────────────── */
.cap-empty {
  padding: 24px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--border, #E5E7EB);
  background: var(--surface, #fff);
}

.cap-empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.cap-empty-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary, #1F2937);
  margin-bottom: 6px;
}

.cap-empty-desc {
  font-size: 13px;
  color: var(--text-muted, #6B7280);
  line-height: 1.6;
}

/* ── Status bar (live call) ───────────────────────────────── */
.cap-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.cap-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cap-status-dot {
  font-size: 10px;
}

.cap-status-label {
  font-weight: 500;
  font-size: 13px;
}

.cap-status-dur {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
}

/* ── Transcript ───────────────────────────────────────────── */
.cap-transcript {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
  scroll-behavior: smooth;
}

.cap-transcript-empty {
  text-align: center;
  color: var(--text-muted, #6B7280);
  font-size: 13px;
  padding: 24px;
}

/* ── Transcript turns ─────────────────────────────────────── */
.cap-turn {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.cap-turn.agent {
  flex-direction: row;
}

.cap-turn.prospect {
  flex-direction: row-reverse;
}

.cap-turn-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

.cap-turn-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--text-primary, #1F2937);
  line-height: 1.5;
}

.cap-turn.agent .cap-turn-bubble {
  border-radius: 12px 12px 12px 2px;
}

.cap-turn.prospect .cap-turn-bubble {
  border-radius: 12px 12px 2px 12px;
}

.cap-turn-time {
  font-size: 10px;
  color: var(--text-muted, #6B7280);
  margin-top: 4px;
}

/* ── Post-call summary ────────────────────────────────────── */
.cap-summary {
  padding: 14px;
  border-radius: 10px;
  background: var(--surface-alt, #F9FAFB);
  border: 1px solid var(--border, #E5E7EB);
}

.cap-summary-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary, #1F2937);
  margin-bottom: 8px;
}

.cap-summary-body {
  font-size: 12px;
  color: var(--text-muted, #6B7280);
  line-height: 1.7;
  white-space: pre-wrap;
}

.cap-next-steps {
  margin-top: 8px;
  font-size: 12px;
  color: #0A66C2;
}

/* ── Done button ──────────────────────────────────────────── */
.cap-done-btn {
  width: 100%;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--border, #E5E7EB);
  background: transparent;
  color: var(--text-muted, #6B7280);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.cap-done-btn:hover {
  background: var(--surface-alt, #F9FAFB);
}

/* ── Spinner dots ─────────────────────────────────────────── */
.cap-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: capPulse 1.2s ease-in-out infinite;
  display: inline-block;
}

/* ── Dark-mode overrides (respects your existing theme) ───── */
[data-theme="dark"] .cap-panel,
[data-theme="dark"] .cap-empty,
[data-theme="dark"] .cap-company-card,
[data-theme="dark"] .cap-contact-card {
  background: var(--surface, #1a1a2e);
  border-color: var(--border, #2a2a3e);
}

[data-theme="dark"] .cap-ai-preview,
[data-theme="dark"] .cap-summary {
  background: var(--surface-alt, #12121f);
  border-color: var(--border, #2a2a3e);
}

[data-theme="dark"] .cap-done-btn:hover {
  background: var(--surface-alt, #12121f);
}

/* ── Responsive: collapse inside mobile drawer ────────────── */
@media (max-width: 768px) {
  .cap-panel {
    padding: 12px;
  }

  .cap-transcript {
    max-height: 220px;
  }
}





/* ── Quick-bar call chip ────────────────────────────────────── */
.quick-chip.call {
  border-color: #0A66C2;
  color: #0A66C2;
  position: relative;
  overflow: hidden;
  /* Keep the animation if you want it to softly pulse, otherwise remove this line */
  animation: capCallPulse 2.5s ease-in-out infinite;
}

/* .quick-chip.call::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
} */

@keyframes capCallPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(10, 102, 194, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(10, 102, 194, 0);
  }
}

/* Mobile variant */
.quick-action-chip.call {
  border-color: #0A66C2;
  color: #0A66C2;
  font-weight: 500;
  white-space: nowrap;
  animation: capCallPulse 2.5s ease-in-out infinite;
}

/* Call Agent Modal backdrop */
#callAgentModal.open {
  display: flex !important;
}

/* Dark mode modal background */
[data-theme="dark"] #callAgentModal>div {
  background: var(--surface, #1a1a2e);
}


/* ── Modal open/close transition ──────────────────────────── */
#callAgentModal {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  display: none;
}

#callAgentModal.open {
  opacity: 1;
  pointer-events: auto;
  display: flex !important;
}

#callAgentModal>div {
  transform: translateY(16px);
  transition: transform .25s ease;
}

#callAgentModal.open>div {
  transform: translateY(0);
}

/* Dark mode */
[data-theme="dark"] #callAgentModal>div {
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border, #2a2a3e);
}