/* Voice Support Agent — Liquid AI Design System */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text-primary: #111111;
  --text-secondary: #6d6d6d;
  --text-muted: #999999;
  --accent: #111111;
  --accent-light: #f5f5f5;
  --success: #22c55e;
  --warning: #f59e0b;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--accent);
  color: white;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.header-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.header-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Pipeline Visualization */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pipeline-stage {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  transition:
    background 0.2s,
    box-shadow 0.2s;
  position: relative;
}

.pipeline-stage.active {
  background: #f0f9ff;
  box-shadow: 0 0 0 2px var(--blue);
}

.pipeline-stage.done {
  background: #f0fdf4;
}

.stage-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.stage-info {
  flex: 1;
  min-width: 0;
}

.stage-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.stage-model {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.stage-latency {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.stage-latency.measured {
  color: var(--success);
}

.stage-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pipeline-stage.active .stage-status {
  background: var(--blue);
  animation: pulse 1s infinite;
}

.pipeline-stage.done .stage-status {
  background: var(--success);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.pipeline-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 18px;
  padding: 0 4px;
  flex-shrink: 0;
}

/* Insight Callout */
.insight-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius);
  margin-bottom: 28px;
  font-size: 13px;
  color: #854d0e;
  line-height: 1.5;
}

.insight-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Interaction Area */
.interaction {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.interaction-left,
.interaction-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Microphone Button */
.mic-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.mic-button:not(:disabled):hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.mic-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-button.recording {
  border-color: #ef4444;
  background: #fef2f2;
  border-style: solid;
}

.mic-button.recording .mic-icon {
  color: #ef4444;
  animation: recording-pulse 0.8s infinite;
}

@keyframes recording-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.mic-icon {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.mic-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Transcript */
.transcript-area,
.response-area {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
}

.transcript-header,
.response-header {
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.transcript-text,
.response-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 40px;
}

.transcript-text.placeholder,
.response-text.placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Intent Card */
.intent-card {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.intent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.intent-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: #e0e7ff;
  color: #3730a3;
}

.intent-confidence {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--success);
  font-weight: 500;
}

.intent-routing {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Latency Breakdown */
.latency-breakdown {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.breakdown-title {
  font-size: 13px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  align-items: center;
  gap: 12px;
}

.breakdown-label {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-secondary);
  white-space: nowrap;
}

.breakdown-bar-container {
  height: 20px;
  background: var(--accent-light);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.bar-stt {
  background: var(--blue);
}
.bar-intent {
  background: var(--purple);
}
.bar-tts {
  background: var(--blue);
  opacity: 0.7;
}
.bar-total {
  background: var(--accent);
}

.breakdown-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  color: var(--text-primary);
}

.breakdown-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Examples */
.examples {
  margin-bottom: 32px;
}

.examples-title {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-muted);
  margin-bottom: 10px;
}

.examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}

.example-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-light);
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.footer-models {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.footer-model {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  background: var(--accent-light);
  border-radius: 6px;
  color: var(--text-primary);
}

.footer-sep {
  font-size: 14px;
  color: var(--text-muted);
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 24px 16px;
  }
  .header-title {
    font-size: 28px;
  }
  .pipeline {
    flex-direction: column;
    gap: 8px;
  }
  .pipeline-arrow {
    transform: rotate(90deg);
    padding: 4px 0;
  }
  .interaction {
    grid-template-columns: 1fr;
  }
  .breakdown-row {
    grid-template-columns: 120px 1fr 50px;
  }
}
