/* Vancouver Division Demo Styles */
/* Color Scheme: Teal (#0D6F8B / rgb(13,111,139)) with white accents */

:root {
  --vancouver-teal: #0D6F8B;
  --vancouver-teal-dark: #0A5A6F;
  --vancouver-teal-light: #1A8BA8;
  --vancouver-white: #FAFDFD;
  --vancouver-gray: #F0F2F4;
  --vancouver-text: #111418;
  --vancouver-success: #2F6F48;
  --vancouver-orange: #FF6B35;
}

/* Utility classes for Vancouver Division colors */
.bg-vancouver-teal { background-color: var(--vancouver-teal); }
.bg-vancouver-teal-dark { background-color: var(--vancouver-teal-dark); }
.bg-vancouver-teal-light { background-color: var(--vancouver-teal-light); }
.bg-vancouver-success { background-color: var(--vancouver-success); }
.bg-vancouver-orange { background-color: var(--vancouver-orange); }

.text-vancouver-teal { color: var(--vancouver-teal); }
.text-vancouver-teal-dark { color: var(--vancouver-teal-dark); }
.text-vancouver-success { color: var(--vancouver-success); }

.border-vancouver-teal { border-color: var(--vancouver-teal); }
.border-vancouver-teal-dark { border-color: var(--vancouver-teal-dark); }

.hover\:bg-vancouver-teal-dark:hover { background-color: var(--vancouver-teal-dark); }
.hover\:text-vancouver-teal-dark:hover { color: var(--vancouver-teal-dark); }

.focus\:ring-vancouver-teal:focus { 
  --tw-ring-color: var(--vancouver-teal);
  ring-color: var(--vancouver-teal);
}

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

body {
  font-family: 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--vancouver-white);
  color: var(--vancouver-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.demo-header {
  background: var(--vancouver-teal);
  color: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 10px;
  padding: 6px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 1px;
}

.header-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.header-title .subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
}

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

.nav-link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  font-weight: 600;
}

/* Main Container */
.demo-container {
  flex: 1;
  min-height: 0; /* Allow flex item to shrink */
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: flex-start; /* Changed from center to allow content to start at top */
  justify-content: center;
}

/* Screen Management */
.screen {
  display: none;
  width: 100%;
  min-height: 0;
}

.screen.active {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

/* Welcome Screen */
.welcome-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  min-height: 0; /* Allow content to flow */
}

.welcome-icon {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.welcome-content h2 {
  font-size: 1.4rem;
  color: var(--vancouver-teal);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.welcome-description {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #555;
  margin-bottom: 1.25rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-4 {
  gap: 1rem;
}

.items-center {
  align-items: center;
}

/* Buttons */
.btn-primary {
  background: var(--vancouver-teal);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(13, 111, 139, 0.3);
  width: 100%;
  text-align: center;
}

.btn-primary:hover {
  background: var(--vancouver-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 111, 139, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--vancouver-teal);
  color: white;
  border: none;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
  display: block;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(13, 111, 139, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--vancouver-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 111, 139, 0.4);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--vancouver-teal);
  border: 2px solid var(--vancouver-teal);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.btn-outline:hover {
  background: var(--vancouver-teal);
  color: white;
}

/* Audio Controls */
.btn-audio-toggle {
  background: white;
  color: var(--vancouver-teal);
  border: 2px solid var(--vancouver-teal);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-audio-toggle:hover {
  background: var(--vancouver-teal-light);
  border-color: var(--vancouver-teal-dark);
  transform: translateY(-1px);
}

.btn-audio-toggle.playing {
  background: var(--vancouver-teal);
  color: white;
  border-color: var(--vancouver-teal);
}

.btn-audio-toggle.muted {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.btn-audio-toggle.muted:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.audio-icon {
  font-size: 1rem;
  display: inline-block;
}

.audio-text {
  display: inline-block;
}

/* Demo Layout */
.demo-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 2rem;
  width: 100%;
  min-height: 0; /* Remove fixed min-height to allow content to flow */
  flex: 1; /* Take up available space in flex container */
  overflow: hidden; /* Prevent layout from overflowing */
}

/* Flow Panel */
.flow-panel {
  background: white;
  border-radius: 12px;
  max-height: calc(100vh - 200px); /* Limit height to viewport minus header/footer */
  overflow-y: auto; /* Allow scrolling if content is too tall */
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.flow-panel h3 {
  color: var(--vancouver-teal);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--vancouver-gray);
  transition: all 0.3s ease;
  position: relative;
}

.flow-step.active {
  background: var(--vancouver-teal);
  color: white;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(13, 111, 139, 0.3);
}

.flow-step.completed {
  background: #E8F5E9;
  border-left: 4px solid var(--vancouver-success);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  color: var(--vancouver-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.flow-step.active .step-number {
  background: white;
  color: var(--vancouver-teal);
}

.flow-step.completed .step-number {
  background: var(--vancouver-success);
  color: white;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.step-description {
  font-size: 0.8rem;
  opacity: 0.8;
}

.flow-step.active .step-description {
  opacity: 0.95;
}

.step-status {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.step-status.active {
  animation: spin 1s linear infinite;
}

.step-status.completed {
  color: var(--vancouver-success);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Visualization Panel */
.visualization-panel {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-height: 0; /* Remove fixed min-height */
  overflow-y: auto; /* Allow scrolling if content is too tall */
}

.visualization-container {
  width: 100%;
  height: 100%;
  min-height: 550px;
}

/* Visualization Styles */
.viz-welcome,
.viz-step1,
.viz-step2,
.viz-step3,
.viz-step4,
.viz-step5,
.viz-step6,
.viz-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  padding: 2rem;
}

.phone-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.viz-welcome h3 {
  color: var(--vancouver-teal);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Step 1 - VOIP Lookup */
.call-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.caller-box,
.system-box {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.caller-icon,
.system-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.caller-label,
.system-label {
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 0.5rem;
}

.caller-number,
.system-number {
  font-size: 0.9rem;
  color: #666;
  font-family: monospace;
}

.arrow-right {
  font-size: 2rem;
  color: var(--vancouver-teal);
}

.info-box {
  background: var(--vancouver-gray);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 500px;
  text-align: center;
}

.info-box p {
  margin-bottom: 0.5rem;
}

/* Step 2 - AI Gatekeeper */
.ai-gatekeeper {
  text-align: center;
  margin-bottom: 2rem;
}

.ai-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.ai-label {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--vancouver-teal);
}

.speech-bubble {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  max-width: 400px;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--vancouver-teal);
}

.speech-bubble p {
  margin: 0;
  font-style: italic;
  color: var(--vancouver-teal);
}

.caller-response {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--vancouver-gray);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.response-icon {
  font-size: 1.5rem;
}

.response-text {
  font-weight: 500;
}

.verification-box {
  background: #E8F5E9;
  border: 2px solid var(--vancouver-success);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  max-width: 400px;
}

.check-icon {
  font-size: 2rem;
  color: var(--vancouver-success);
  margin-bottom: 0.5rem;
}

.verification-box p {
  margin: 0.5rem 0;
}

/* Step 3 - Data Capture */
.data-capture-box {
  text-align: center;
  margin-bottom: 2rem;
}

.capture-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.capture-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--vancouver-teal);
}

.form-fields {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.form-field {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-field label {
  display: block;
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.field-value {
  background: var(--vancouver-gray);
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 1rem;
}

.urgency-moderate {
  color: var(--vancouver-orange);
  font-weight: 600;
}

.saving-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--vancouver-teal);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid var(--vancouver-gray);
  border-top-color: var(--vancouver-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Step 4 - On-Call Lookup */
.lookup-box {
  text-align: center;
  margin-bottom: 2rem;
}

.lookup-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.lookup-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--vancouver-teal);
}

.schedule-display {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.schedule-item {
  text-align: center;
  margin-bottom: 1.5rem;
}

.schedule-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 0.5rem;
}

.schedule-group {
  font-size: 0.9rem;
  color: #666;
}

.schedule-assignment {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--vancouver-gray);
  padding: 1.5rem;
  border-radius: 8px;
}

.assignment-icon {
  font-size: 2.5rem;
}

.assignment-details {
  flex: 1;
  text-align: left;
}

.doctor-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 0.25rem;
}

.shift-time {
  font-size: 0.9rem;
  color: #666;
}

.lookup-result {
  background: #E8F5E9;
  border: 2px solid var(--vancouver-success);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.result-icon {
  font-size: 1.5rem;
  color: var(--vancouver-success);
  margin-bottom: 0.5rem;
}

/* Step 5 - Connect to Doctor */
.connection-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.facility-box,
.doctor-box {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.facility-icon,
.doctor-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.facility-name,
.doctor-name {
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 0.5rem;
}

.doctor-phone {
  font-size: 0.85rem;
  color: #666;
  font-family: monospace;
}

.system-middle {
  text-align: center;
}

.routing-icon {
  font-size: 2rem;
  animation: spin 2s linear infinite;
  margin-bottom: 0.5rem;
}

.routing-text {
  font-weight: 600;
  color: var(--vancouver-teal);
}

.connection-line {
  width: 60px;
  height: 3px;
  background: var(--vancouver-teal);
  position: relative;
  overflow: hidden;
}

.line-pulse {
  position: absolute;
  width: 30px;
  height: 100%;
  background: var(--vancouver-teal-light);
  animation: pulse-line 1.5s ease-in-out infinite;
}

@keyframes pulse-line {
  0%, 100% { transform: translateX(-30px); opacity: 0; }
  50% { transform: translateX(60px); opacity: 1; }
}

.call-status {
  text-align: center;
  margin-bottom: 1rem;
}

.status-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: ring 1s ease-in-out infinite;
}

.status-icon.ringing {
  animation: ring 1s ease-in-out infinite;
}

@keyframes ring {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.call-connected {
  background: #E8F5E9;
  border: 2px solid var(--vancouver-success);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.connected-icon {
  font-size: 2rem;
  color: var(--vancouver-success);
  margin-bottom: 0.5rem;
}

/* Step 6 - Post-Call Processing */
.processing-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.process-step {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.process-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.process-label {
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.process-status {
  font-size: 0.85rem;
  color: var(--vancouver-success);
  font-weight: 600;
}

.encounter-preview {
  background: var(--vancouver-gray);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.encounter-preview h4 {
  color: var(--vancouver-teal);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.summary-content {
  text-align: left;
}

.summary-content p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Complete Screen */
.viz-complete {
  text-align: center;
}

.complete-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.viz-complete h3 {
  color: var(--vancouver-teal);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.complete-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--vancouver-teal);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
}

/* Info Panel */
.info-panel {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: fit-content;
  max-height: calc(100vh - 180px); /* Limit height to viewport minus header/footer */
  overflow-y: auto; /* Allow scrolling if content is too tall */
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
}

.info-section {
  margin-bottom: 1.25rem;
}

.info-section h4 {
  color: var(--vancouver-teal);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.current-step-info {
  background: var(--vancouver-gray);
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  color: var(--vancouver-teal);
  text-align: center;
  font-size: 0.9rem;
}

.call-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--vancouver-gray);
  border-radius: 6px;
  font-size: 0.85rem;
}

.detail-label {
  font-weight: 600;
  color: #666;
  font-size: 0.9rem;
}

.detail-value {
  color: var(--vancouver-teal);
  font-weight: 500;
  text-align: right;
  font-size: 0.9rem;
}

.system-status {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ccc;
}

.status-indicator.active {
  background: var(--vancouver-success);
  box-shadow: 0 0 8px rgba(47, 111, 72, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

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

.controls {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--vancouver-gray);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Animations */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.animate-in.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.demo-footer {
  background: var(--vancouver-teal);
  color: white;
  text-align: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Card Styles */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Toggle Switch */
.toggle-switch {
  width: 50px;
  height: 24px;
  background-color: #9ca3af;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: left 0.3s ease;
}

.toggle-switch.bg-green-500 {
  background-color: #10b981;
}

.toggle-switch.bg-green-500::after {
  left: 28px;
}

.toggle-switch.bg-gray-400 {
  background-color: #9ca3af;
}

/* Medical Blue */
:root {
  --medical-blue: #0D6F8B;
  --medical-blue-dark: #0A5A6F;
}

/* Conversation Styles */
.conversation-container {
  max-width: 700px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 12px;
  max-height: 500px;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: slideInMessage 0.4s ease-out;
}

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

.conversation-item.ai-message,
.conversation-item.doctor-message {
  flex-direction: row;
}

.conversation-item.nurse-message {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ai-avatar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.doctor-avatar {
  background: linear-gradient(135deg, #0D6F8B 0%, #1A8BA8 100%);
}

.nurse-avatar {
  background: linear-gradient(135deg, #2F6F48 0%, #4CAF50 100%);
}

.message-content {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.ai-message .message-content {
  border-left: 4px solid #667eea;
}

.doctor-message .message-content {
  border-left: 4px solid var(--vancouver-teal);
}

.nurse-message .message-content {
  border-right: 4px solid #2F6F48;
  background: #f0fdf4;
}

.message-sender {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--vancouver-teal);
}

.ai-message .message-sender {
  color: #667eea;
}

.doctor-message .message-sender {
  color: var(--vancouver-teal);
}

.nurse-message .message-sender {
  color: #2F6F48;
}

.message-text {
  color: #374151;
  line-height: 1.6;
  font-size: 0.95rem;
}

.message-text::before {
  content: '"';
  color: #9ca3af;
}

.message-text::after {
  content: '"';
  color: #9ca3af;
}

/* New Visualization Elements */
.decision-tree {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.decision-title {
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.decision-branches {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.decision-branch {
  padding: 0.75rem;
  background: var(--vancouver-gray);
  border-radius: 6px;
  border-left: 4px solid var(--vancouver-teal);
}

.decision-branch.inactive {
  opacity: 0.5;
  border-left-color: #ccc;
}

.branch-label {
  font-weight: 600;
  color: var(--vancouver-teal);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.branch-action {
  font-size: 0.85rem;
  color: #666;
}

.caller-id-matching {
  background: white;
  border: 2px solid var(--vancouver-teal);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.matching-title {
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 1rem;
}

.matching-process {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.process-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--vancouver-gray);
  border-radius: 6px;
  font-size: 0.9rem;
}

.process-item.success {
  background: #E8F5E9;
  border-left: 4px solid var(--vancouver-success);
}

.process-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--vancouver-teal);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.process-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--vancouver-success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.emergency-bypass {
  background: #FFF3CD;
  border: 2px solid #FFC107;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.bypass-note {
  font-weight: 600;
  color: #856404;
  font-size: 0.9rem;
}

.field-purpose {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
  font-style: italic;
}

.query-display {
  background: #1E1E1E;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.query-box {
  color: white;
}

.query-title {
  font-weight: 600;
  color: #4FC3F7;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.query-code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: #A5D6A7;
  line-height: 1.6;
  background: #2D2D2D;
  padding: 1rem;
  border-radius: 4px;
}

.routing-logic {
  background: var(--vancouver-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.logic-title {
  font-weight: 600;
  color: var(--vancouver-teal);
  margin-bottom: 1rem;
}

.logic-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logic-step {
  padding: 0.5rem;
  background: white;
  border-radius: 4px;
  font-size: 0.9rem;
  border-left: 3px solid var(--vancouver-teal);
  padding-left: 0.75rem;
}

.schedule-assignment.backup {
  background: #E3F2FD;
  border: 2px solid #90CAF9;
}

.doctor-label {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.encounter-creation {
  background: #E8F5E9;
  border: 2px solid var(--vancouver-success);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.creation-title {
  font-weight: 600;
  color: var(--vancouver-success);
  margin-bottom: 1rem;
}

.creation-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.creation-step {
  font-size: 0.9rem;
  color: #2E7D32;
}

.encounter-id {
  font-family: monospace;
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  margin-top: 0.5rem;
}

.processing-title {
  text-align: center;
  margin-bottom: 2rem;
}

.processing-title h3 {
  color: var(--vancouver-teal);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.processing-title .subtitle {
  color: #666;
  font-size: 0.9rem;
}

.process-detail {
  font-size: 0.8rem;
  color: #666;
  margin: 0.25rem 0;
}

.process-path {
  font-family: monospace;
  font-size: 0.75rem;
  color: #999;
  margin: 0.25rem 0;
  word-break: break-all;
}

.ai-subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

.fallback-note {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.75rem;
  font-style: italic;
}

.saving-detail {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .demo-layout {
    grid-template-columns: 240px 1fr 280px;
  }
}

@media (max-width: 968px) {
  .demo-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .flow-panel,
  .info-panel {
    position: static;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .call-flow {
    flex-direction: column;
  }

  .arrow-right {
    transform: rotate(90deg);
  }

  .connection-flow {
    flex-direction: column;
  }

  .connection-line {
    width: 3px;
    height: 40px;
  }

  .processing-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .demo-container {
    padding: 1rem;
  }

  .welcome-content {
    padding: 2rem 1rem;
  }

  .visualization-panel {
    padding: 1rem;
  }

  .complete-stats {
    flex-direction: column;
    gap: 1rem;
  }
}
