/* Legacy EMR Voice AI Application Styles */

/* Legacy EMR Header Navigation */
.emr-header {
  background-color: #ffffff;
  border-bottom: 1px solid #ddd;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left .header-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2c5aa0;
}

.header-right .user-info {
  display: flex;
  align-items: center;
}

.user-name {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* Main Content Layout */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

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

.page-header h1 {
  color: #2c5aa0;
  font-size: 2.2em;
  font-weight: 500;
  margin: 0;
}

/* EMR Card Structure - Legacy Style */
.emr-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.emr-card .card-header {
  background-color: transparent;
  border-bottom: none;
  padding: 24px 24px 16px 24px;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.emr-card .card-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2c5aa0;
  letter-spacing: -0.025em;
}

.emr-card .card-body {
  padding: 0 24px 24px 24px;
}

/* Card Action Buttons */
.card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
  background-color: white;
  color: #374151;
  height: 40px;
  padding: 0 16px;
  cursor: pointer;
}

.card-action-btn:hover {
  background-color: #f9fafb;
  color: #111827;
}

.card-action-btn:focus {
  outline: none;
  ring: 2px solid #2563eb;
  ring-offset: 2px;
}

/* Enhanced Card Hover Effects */
.emr-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

/* Command and Instruction Lists */
.command-list {
  margin: 0;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.command-list li {
  margin: 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 16px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  border-left: 3px solid #2c5aa0;
}

.instruction-list {
  margin: 0;
  padding: 0;
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: step-counter;
}

.instruction-list li {
  margin: 0;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 16px 12px 40px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  position: relative;
  counter-increment: step-counter;
}

.instruction-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #2c5aa0;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  outline: none;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  color: #374151;
  height: 40px;
  padding: 8px 16px;
  cursor: pointer;
  margin: 16px 0;
  min-width: 200px;
}

.voice-btn.active {
  background-color: #dc2626;
  border-color: #dc2626;
  color: white;
}

.voice-btn.active:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
  color: white;
}

.voice-btn.connecting {
  background-color: #f59e0b;
  border-color: #f59e0b;
  color: white;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.8;
}

.voice-btn:hover:not(:disabled):not(.connecting) {
  background-color: #f3f4f6;
  color: #111827;
}

.voice-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.voice-btn:disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Connection Status Indicators */
.connection-status {
  margin: 0 0 20px 0;
  text-align: center;
}

.status {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  display: inline-block;
  font-size: 14px;
  border: 1px solid transparent;
}

.status.connecting {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.status.connected {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
}

.status.disconnected {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* Status Messages */
.status-message {
  background-color: #f0f9ff;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #bae6fd;
  border-left: 4px solid #2c5aa0;
  font-weight: 500;
  color: #1e40af;
  font-size: 14px;
}

/* General layout styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 20px;
  padding: 0;
  background-color: #f8f9fa;
  line-height: 1.6;
}

#status {
  margin: 15px 0 0 0;
  padding: 0;
  min-height: 20px;
}

/* Error Page Styles */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
}

.error-container {
  background: white;
  border-radius: 15px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.error-icon {
  font-size: 4em;
  margin-bottom: 20px;
}

.error-page h1 {
  color: #dc3545;
  font-size: 2.5em;
  margin-bottom: 10px;
  font-weight: 600;
}

.error-page h2 {
  color: #6c757d;
  font-size: 1.5em;
  margin-bottom: 20px;
  font-weight: 400;
}

.error-message {
  color: #495057;
  font-size: 1.1em;
  margin-bottom: 20px;
  line-height: 1.6;
}

.error-reasons {
  text-align: left;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border-left: 4px solid #ffc107;
}

.error-reasons li {
  color: #6c757d;
  margin: 8px 0;
  font-size: 1em;
}

.error-details {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  color: #856404;
  font-size: 0.9em;
  text-align: left;
}

.support-info {
  background-color: #e3f2fd;
  border-radius: 10px;
  padding: 25px;
  margin-top: 30px;
}

.support-info h3 {
  color: #1565c0;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.support-info p {
  color: #424242;
  margin: 10px 0;
  font-size: 1em;
}

.support-info a {
  color: #1976d2;
  text-decoration: none;
  font-weight: 500;
}

.support-info a:hover {
  text-decoration: underline;
}

/* Chat Interface */
.chat-container {
  background: transparent;
  border: none;
  margin: 0;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  max-height: 300px;
}

.message {
  margin: 10px 0;
  padding: 10px 15px;
  border-radius: 15px;
  max-width: 80%;
}

.message.user {
  background: #007bff;
  color: white;
  margin-left: auto;
  text-align: right;
}

.message.ai {
  background: #f1f3f4;
  color: #333;
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #e9ecef;
}

.text-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  margin-right: 10px;
  outline: none;
}

.send-btn {
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
}

.send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Appointment Cards */
.appointment-card {
  margin-top: 10px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: #007bff;
  color: white;
  padding: 10px 15px;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  font-size: 14px;
}

.card-body {
  padding: 15px;
}

.appointment-detail {
  margin: 8px 0;
  color: #495057;
  font-size: 14px;
}

.appointment-item {
  padding: 10px;
  border-bottom: 1px solid #f1f3f4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.appointment-item:last-child {
  border-bottom: none;
}

.apt-date {
  font-weight: bold;
  color: #007bff;
  flex: 2;
}

.apt-doctor {
  color: #495057;
  flex: 2;
}

.apt-location {
  color: #6c757d;
  font-size: 12px;
  flex: 1;
  text-align: right;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .header-left .header-title {
    font-size: 18px;
  }

  .main-content {
    padding: 16px;
  }

  .emr-card .card-body {
    padding: 0 16px 16px 16px;
  }

  .emr-card .card-header {
    padding: 16px 16px 12px 16px;
  }

  .page-header h1 {
    font-size: 1.8em;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 10px 12px;
  }

  .header-left .header-title {
    font-size: 16px;
  }

  .main-content {
    padding: 12px;
  }

  .emr-card .card-body {
    padding: 0 12px 12px 12px;
  }

  .emr-card .card-header {
    padding: 12px 12px 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .emr-card .card-header h3 {
    font-size: 18px;
  }

  .page-header h1 {
    font-size: 1.6em;
  }

  .voice-btn {
    min-width: 180px;
    font-size: 14px;
    padding: 14px 24px;
  }

  .command-list li,
  .instruction-list li {
    padding: 10px 12px;
    font-size: 13px;
  }

  .instruction-list li {
    padding-left: 32px;
  }

  .instruction-list li::before {
    width: 16px;
    height: 16px;
    font-size: 10px;
    left: 10px;
  }
}

/* NEW: Workflow Progress Styles */
.workflow-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 8px;
}

.workflow-indicator {
  font-size: 13px;
  color: #1e40af;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cancel-workflow-btn {
  background-color: #dc2626;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.cancel-workflow-btn:hover {
  background-color: #b91c1c;
}

.workflow-progress {
  background-color: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.workflow-progress .card-header {
  background-color: #0ea5e9;
  color: white;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.workflow-progress .card-body {
  padding: 12px;
}

.workflow-detail {
  margin-bottom: 8px;
  font-size: 13px;
  color: #374151;
}

.confirmation-required {
  background-color: #fef3c7;
  color: #92400e;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  border-left: 3px solid #f59e0b;
}

.workflow-message {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.4;
  background-color: white;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

/* Enhanced Command List for Workflow Categories */
.command-list li strong {
  color: #2c5aa0;
  font-weight: 600;
  font-size: 14px;
}

.command-list li:has(strong) {
  background-color: #f1f5f9;
  border-left: 3px solid #2c5aa0;
  font-weight: 600;
}

/* Responsive Workflow Styles */
@media (max-width: 768px) {
  .workflow-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cancel-workflow-btn {
    align-self: flex-end;
  }
}
