@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap');

:root {
  --bg-dark: #080C14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(6, 182, 212, 0.3);
  
  --primary: #06B6D4;
  --primary-glow: rgba(6, 182, 212, 0.4);
  --secondary: #8B5CF6;
  --secondary-glow: rgba(139, 92, 246, 0.4);
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.5) 0%, transparent 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* App Header */
header {
  padding: 1rem 2rem;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--primary-glow);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #FFFFFF, #93C5FD);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Main Dashboard Grid */
.dashboard-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1100px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: border-color 0.25s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.15);
  color: var(--primary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Left Column: Call Stage */
.call-stage {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.audio-visualizer-container {
  height: 110px;
  background: rgba(10, 15, 26, 0.85);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#visualizerCanvas {
  width: 100%;
  height: 100%;
}

.visualizer-overlay {
  position: absolute;
  pointer-events: none;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Live Call Action Bar */
.call-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.mic-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: linear-gradient(135deg, var(--primary), #0284C7);
  color: #FFFFFF;
  box-shadow: 0 0 20px var(--primary-glow);
  transition: all 0.2s ease;
}

.mic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.6);
}

.mic-btn.active {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.6);
  animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); box-shadow: 0 0 35px rgba(239, 68, 68, 0.8); }
  100% { transform: scale(1); }
}

.voice-select-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

select#voiceSelect {
  background: #0F172A;
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

select#voiceSelect:focus {
  border-color: var(--primary);
}

/* Live STT Banner */
.live-stt-box {
  background: rgba(6, 182, 212, 0.05);
  border: 1px dashed rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.live-stt-box .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.live-stt-box .content {
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 500;
  min-height: 1.5rem;
}

.content .partial-word {
  color: #67E8F9;
  border-bottom: 2px dotted #67E8F9;
}

/* Chat Transcript Stream */
.transcript-stream {
  flex: 1;
  min-height: 380px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.5rem;
}

.transcript-stream::-webkit-scrollbar {
  width: 6px;
}
.transcript-stream::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chat-bubble {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.user {
  align-self: flex-start;
}

.chat-bubble.agent {
  align-self: flex-end;
}

.bubble-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bubble-body {
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-bubble.user .bubble-body {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
}

.chat-bubble.agent .bubble-body {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid var(--border-accent);
  border-top-right-radius: 4px;
}

.bubble-audio-btn {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--primary);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bubble-audio-btn:hover {
  background: rgba(6, 182, 212, 0.25);
}

/* Prompt chips */
.prompt-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s;
}

.chip-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  color: var(--text-main);
  border-color: var(--primary);
}

/* Text fallback form */
.text-input-form {
  display: flex;
  gap: 0.75rem;
}

.text-input-form input {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
}

.text-input-form input:focus {
  border-color: var(--primary);
}

.text-send-btn {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.text-send-btn:hover {
  background: var(--primary);
  color: #000;
}

/* Right Column: Telemetry Cards */
.telemetry-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.telemetry-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.telemetry-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.metric-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

.telemetry-body {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Code block style */
.mono-box {
  background: #090D16;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #E2E8F0;
  word-break: break-all;
}

.highlight-token {
  background: rgba(6, 182, 212, 0.2);
  color: #67E8F9;
  padding: 0 0.2rem;
  border-radius: 3px;
  font-weight: 600;
}

/* Security Auth Badge */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-badge.unverified {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-badge.verified {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Latency Waterfall */
.waterfall-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
}

.waterfall-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.waterfall-segment.stt { background: #38BDF8; }
.waterfall-segment.router { background: #F59E0B; }
.waterfall-segment.norm { background: #10B981; }
.waterfall-segment.tts { background: #8B5CF6; }

.waterfall-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* 5 Test Cases Section */
.test-cases-container {
  max-width: 1700px;
  margin: 0 auto 3rem auto;
  padding: 0 2rem;
  width: 100%;
}

.test-cases-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.test-cases-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-run-all {
  background: linear-gradient(135deg, var(--secondary), #6366F1);
  color: #FFFFFF;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 20px var(--secondary-glow);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-run-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.6);
}

.test-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.tc-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s;
}

.tc-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
}

.tc-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tc-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #FFFFFF;
}

.tc-text-box {
  background: #090D16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #67E8F9;
  position: relative;
}

.tc-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.tc-action-btn {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--primary);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.tc-action-btn:hover {
  background: var(--primary);
  color: #000000;
}

/* Benchmark Result Table */
.benchmark-modal {
  margin-top: 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-accent);
  border-radius: 14px;
  padding: 1.25rem;
  animation: fadeIn 0.3s ease;
}

.bm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.bm-table th, .bm-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bm-table th {
  color: var(--text-muted);
  font-family: var(--font-heading);
  background: rgba(255, 255, 255, 0.03);
}

.bm-table td {
  font-family: var(--font-mono);
}

