/* =========================================================================
   css/pages/test-call.css
   Test Call page (js/pages/test-call.js). Only what Tailwind utilities can't
   express: page grid, call-progress stepper, sticky action bar, toggle.
   Colours are the platform's (amber #f59e0b, gray scale, status red/green) -
   there is no per-mode theme. Cards, inputs, labels and buttons come from the
   shared class strings in js/components/ui.js.
   ========================================================================= */

/* ── Page grid: form | live status ──────────────────────────────────────── */
.tc-page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.tc-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 1100px) { .tc-page { grid-template-columns: minmax(0, 1fr); } }

.tc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tc-span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .tc-fields { grid-template-columns: minmax(0, 1fr); } }

/* ── Phone input with +91 prefix ────────────────────────────────────────── */
.tc-phone { display: flex; align-items: stretch; }
.tc-phone-prefix {
  display: flex; align-items: center; padding: 0 12px; font-size: 14px; font-weight: 700; color: #4b5563;
  background: #f3f4f6; border: 1px solid #d1d5db; border-right: 0; border-radius: 12px 0 0 12px;
}
.tc-phone input { border-top-left-radius: 0; border-bottom-left-radius: 0; font-weight: 600; letter-spacing: .03em; }
.tc-phone input::placeholder { font-weight: 400; letter-spacing: 0; }

/* ── Segmented toggle (AI engines) ──────────────────────────────────────── */
.tc-seg { display: inline-flex; gap: 2px; padding: 3px; background: #f3f4f6; border-radius: 12px; }
.tc-seg button {
  padding: 6px 14px; font-size: 12px; font-weight: 700; color: #6b7280;
  background: transparent; border: 0; border-radius: 9px; cursor: pointer; transition: all .15s;
}
.tc-seg button:hover { color: #111827; }
.tc-seg button.on { background: #f59e0b; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* ── Action bar: stays visible while the form scrolls ───────────────────── */
.tc-actions {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; background: rgba(255, 255, 255, .97); border-top: 1px solid #f3f4f6;
}
.tc-endpoint {
  display: inline-block; padding: 2px 8px; font-size: 11px; color: #374151; background: #f3f4f6; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.tc-spin {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: tc-rot .7s linear infinite;
}
@keyframes tc-rot { to { transform: rotate(360deg); } }
.tc-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; display: inline-block; }
.tc-dot.ok { background: #22c55e; }
.tc-dot.bad { background: #ef4444; }

/* ── Call progress ──────────────────────────────────────────────────────── */
.tc-steps { display: flex; align-items: flex-start; margin: 20px 0 4px; }
.tc-step { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: #9ca3af; text-align: center; }
.tc-step::before { content: ''; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: #e5e7eb; }
.tc-step:first-child::before { display: none; }
.tc-step-dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid #e5e7eb; color: #9ca3af;
}
.tc-step.done { color: #374151; }
.tc-step.done::before, .tc-step.now::before { background: #f59e0b; }
.tc-step.done .tc-step-dot { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.tc-step.now { color: #111827; }
.tc-step.now .tc-step-dot { border-color: #f59e0b; animation: tc-pulse 1.6s ease-out infinite; }
.tc-step.bad { color: #b91c1c; }
.tc-step.bad::before { background: #fca5a5; }
.tc-step.bad .tc-step-dot { background: #ef4444; border-color: #ef4444; color: #fff; }
@keyframes tc-pulse { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .45); } 100% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } }

/* ── Result message + raw response ──────────────────────────────────────── */
.tc-msg { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; line-height: 1.45; }
.tc-msg svg { flex: none; margin-top: 1px; }
.tc-msg.ok { background: #d1fae5; color: #065f46; }
.tc-msg.bad { background: #fee2e2; color: #b91c1c; }
.tc-raw { margin-top: 12px; }
.tc-raw summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #6b7280; user-select: none; }
.tc-raw pre {
  margin: 8px 0 0; max-height: 260px; overflow: auto; padding: 12px; font-size: 11px; line-height: 1.55;
  background: #f9fafb; color: #374151; border: 1px solid #f3f4f6; border-radius: 12px; white-space: pre-wrap; word-break: break-word;
}

/* ── Recent calls (same row feel as the History table) ──────────────────── */
.tc-hist { max-height: 360px; overflow: auto; }
.tc-hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 24px; border-bottom: 1px solid #f3f4f6; }
.tc-hrow:last-child { border-bottom: 0; }
.tc-hrow:hover { background: #fffbeb; }
.tc-idrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 12px; }
.tc-idrow code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #4b5563; }
.tc-empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: #fffbeb; color: #f59e0b; }
