/* tbai Multi-Agent Mobile-First Glassmorphic CSS */
:root {
  --bg-main: #070e17;
  --bg-card: rgba(15, 27, 44, 0.75);
  --border-card: rgba(0, 190, 150, 0.2);
  --primary-teal: #00be96;
  --primary-teal-glow: rgba(0, 190, 150, 0.4);
  --hospital-blue: #0f6c7f;
  --hospital-blue-dark: #0a4653;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-purple: #8b5cf6;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(15, 108, 127, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 190, 150, 0.15) 0%, transparent 40%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.app-viewport {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(11, 20, 32, 0.95);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* Header */
.app-header {
  padding: 16px 20px;
  background: rgba(15, 27, 44, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--hospital-blue), var(--primary-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 15px var(--primary-teal-glow);
}

.brand-info h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--primary-teal);
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--primary-teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary-teal);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.lang-selector select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

/* Chat Area */
.chat-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.welcome-card h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #fff;
}

.welcome-card p {
  font-size: 13px;
  color: var(--text-muted);
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}

.quick-chip {
  background: rgba(0, 190, 150, 0.1);
  border: 1px solid rgba(0, 190, 150, 0.3);
  color: var(--primary-teal);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-chip:hover {
  background: var(--primary-teal);
  color: #000;
}

/* Messages */
.message-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 85%;
}

.message-row.user {
  align-self: flex-end;
}

.message-row.ai {
  align-self: flex-start;
}

.bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.user .bubble {
  background: linear-gradient(135deg, var(--hospital-blue), var(--hospital-blue-dark));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(15, 108, 127, 0.3);
}

.ai .bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(8px);
}

/* Multi-Agent Visualizer Card */
.agent-visualizer {
  background: rgba(15, 27, 44, 0.9);
  border: 1px solid var(--primary-teal-glow);
  border-radius: 16px;
  padding: 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.agent-step.active {
  color: var(--primary-teal);
  font-weight: 600;
}

.agent-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 190, 150, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* Action Confirmation Card */
.action-card {
  background: rgba(0, 190, 150, 0.08);
  border: 1px solid var(--primary-teal);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-card-header {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-teal);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-card-body {
  font-size: 13.5px;
  color: #e2e8f0;
}

.action-card-btns {
  display: flex;
  gap: 10px;
}

.btn-confirm {
  flex: 1;
  background: var(--primary-teal);
  color: #051419;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

/* Input Bar */
.input-bar-wrap {
  padding: 16px;
  background: rgba(15, 27, 44, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-card);
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 12px 18px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--primary-teal);
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.mic-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary-teal);
}

.mic-btn.listening {
  background: #ef4444;
  color: #fff;
  animation: pulse 1s infinite;
}

.send-btn {
  background: linear-gradient(135deg, var(--hospital-blue), var(--primary-teal));
  color: #fff;
  box-shadow: 0 0 15px var(--primary-teal-glow);
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 32px 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--hospital-blue), var(--primary-teal));
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 25px var(--primary-teal-glow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--hospital-blue), var(--primary-teal));
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 20px var(--primary-teal-glow);
}

/* Live Voice Call Overlay */
.call-overlay {
  position: fixed;
  inset: 0;
  background: #050b14;
  background-image: 
    radial-gradient(circle at 50% 30%, rgba(0, 190, 150, 0.2) 0%, transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(15, 108, 127, 0.3) 0%, transparent 60%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px 40px;
  animation: fadeIn 0.3s ease-out;
}

.call-header-summary {
  background: rgba(15, 27, 44, 0.85);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.call-status-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-teal);
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 12px #ef4444;
  animation: pulse 1.5s infinite;
}

.call-summary-content {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.call-center-avatar {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-agent-sphere {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hospital-blue), var(--primary-teal));
  box-shadow: 0 0 40px var(--primary-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  z-index: 10;
}

.avatar-wave {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary-teal);
  opacity: 0;
  animation: waveExpand 2.5s infinite linear;
}

.wave-1 { width: 120px; height: 120px; animation-delay: 0s; }
.wave-2 { width: 150px; height: 150px; animation-delay: 0.8s; }
.wave-3 { width: 180px; height: 180px; animation-delay: 1.6s; }

@keyframes waveExpand {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.call-transcript-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  font-size: 13.5px;
  color: #94a3b8;
  font-style: italic;
  max-width: 360px;
  margin: 0 auto;
}

.call-controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.call-control-btn {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mic-active {
  background: rgba(0, 190, 150, 0.2);
  color: var(--primary-teal);
  border: 2px solid var(--primary-teal);
}

.mic-muted {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 2px solid #ef4444;
}

.btn-end-call {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.btn-end-call:hover {
  transform: scale(1.08);
}

