:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #000000;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: #000000;
  color: #ffffff;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #000000;
}

/* Header Styles */
.header {
  background-color: #000000;
  border-bottom: 1px solid #1f2937;
  padding: 1.5rem 1.5rem;
}

.header-content {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.patient-info-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #374151;
  color: white;
  border: 1px solid #4b5563;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  font-family: inherit;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.patient-info-button:hover {
  background-color: #4b5563;
}

.chevron-icon {
  width: 1rem;
  height: 1rem;
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #111827;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  max-width: 56rem;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid #374151;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid #374151;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  margin: 0;
}

.close-button {
  padding: 0.5rem;
  background-color: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.close-button:hover {
  background-color: #374151;
}

.close-button svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #9ca3af;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
  color: #d1d5db;
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Patient Info Content Styling */
.patient-info-content h2 {
  font-size: 1.25rem;
  font-weight: bold;
  color: #60a5fa;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.patient-info-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.patient-info-content p {
  color: #d1d5db;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.patient-info-content strong {
  color: white;
  font-weight: 600;
}

.patient-info-content ul {
  list-style: disc;
  list-style-position: inside;
  color: #d1d5db;
  margin-bottom: 0.75rem;
  padding-left: 1rem;
}

.patient-info-content li {
  margin-bottom: 0.25rem;
}

.patient-info-content hr {
  border: none;
  border-top: 1px solid #374151;
  margin: 1.5rem 0;
}

.patient-info-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow-x: auto;
  display: block;
}

.patient-info-content thead {
  background-color: #374151;
}

.patient-info-content th {
  border: 1px solid #4b5563;
  padding: 0.75rem 1rem;
  text-align: left;
  color: white;
  font-weight: 600;
}

.patient-info-content td {
  border: 1px solid #4b5563;
  padding: 0.75rem 1rem;
  color: #d1d5db;
}

.patient-info-content tr:hover {
  background-color: rgba(55, 65, 81, 0.5);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: calc(100vh - 120px);
}

.interface-container {
  width: 100%;
  max-width: 42rem;
}

/* Title Section */
.title-section {
  text-align: center;
  margin-bottom: 3rem;
}

.subtitle {
  color: #9ca3af;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.description {
  color: #6b7280;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Voice Interface */
.voice-interface {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Error Display */
.error-display {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: rgba(127, 29, 29, 0.5);
  border: 1px solid #991b1b;
  border-radius: 1rem;
  max-width: 28rem;
  width: 100%;
}

.error-display.hidden {
  display: none;
}

.error-text {
  color: #fca5a5;
  font-size: 0.875rem;
  text-align: center;
}

/* Voice Button */
.voice-button {
  position: relative;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease-in-out;
  cursor: pointer;
  border: 4px solid;
}

/* Button States - Medical Theme (Blue/Teal) */
.voice-button.disconnected {
  background: linear-gradient(to bottom right, #1f2937, #111827);
  border-color: #4b5563;
}

.voice-button.disconnected:hover {
  border-color: #6b7280;
}

.voice-button.connecting {
  background: linear-gradient(to bottom right, #0c4a6e, #075985);
  border-color: #38bdf8;
}

.voice-button.idle {
  background: linear-gradient(to bottom right, #134e4a, #115e59);
  border-color: #5eead4;
  cursor: pointer;
}

.voice-button.idle:hover {
  border-color: #99f6e4;
}

.voice-button.recording {
  background: linear-gradient(to bottom right, #1e3a8a, #1e40af);
  border-color: #60a5fa;
}

/* Button Icon */
.button-icon {
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease-in-out;
}

.button-icon svg {
  width: 100%;
  height: 100%;
  color: #d1d5db;
  transition: color 0.3s ease-in-out;
}

/* Status Text */
.status-text {
  font-size: 1.125rem;
  font-weight: 500;
  text-align: center;
  margin: 0;
  transition: color 0.3s ease-in-out;
}

.voice-button.disconnected .status-text {
  color: #9ca3af;
}

.voice-button.connecting .status-text {
  color: #38bdf8;
}

.voice-button.idle .status-text {
  color: #5eead4;
}

.voice-button.recording .status-text {
  color: #60a5fa;
}

/* Pulse Animation for Recording */
.voice-button.recording::before,
.voice-button.recording::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: #60a5fa;
  opacity: 0.2;
  animation: pulse 1.5s infinite ease-in-out;
}

.voice-button.recording::after {
  animation-delay: 0.5s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.2;
  }
  50% {
    transform: scale(1.1);
    opacity: 0;
  }
}

/* Recording Waves */
.recording-waves {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 3rem;
  margin-bottom: 1rem;
}

.wave-bar {
  width: 0.5rem;
  background-color: #60a5fa;
  border-radius: 9999px;
  animation: wave 1.5s infinite ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.5s; }
.wave-bar:nth-child(7) { animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% {
    height: 1rem;
  }
  50% {
    height: 2.5rem;
  }
}

/* Spinner */
.spinner {
  width: 4rem;
  height: 4rem;
  border: 4px solid #075985;
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Connection Status */
.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-dot.connected {
  background-color: #22c55e;
}

.status-dot.disconnected {
  background-color: #ef4444;
}

.status-label {
  font-size: 0.875rem;
  color: #6b7280;
}

/* Controls */
.controls {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
}

.controls.hidden {
  display: none;
}

.control-button {
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  font-family: inherit;
}

.stop-button {
  background-color: #dc2626;
  color: white;
}

.stop-button:hover {
  background-color: #b91c1c;
}

.disconnect-button {
  background-color: #374151;
  color: white;
}

.disconnect-button:hover {
  background-color: #1f2937;
}

.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: flex-start;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  .voice-button {
    width: 10rem;
    height: 10rem;
  }

  .button-icon {
    width: 3rem;
    height: 3rem;
  }

  .status-text {
    font-size: 1rem;
  }

  .title-section {
    margin-bottom: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .description {
    font-size: 0.8rem;
  }

  .control-button {
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
  }

  .modal-content {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 1rem;
  }

  .voice-button {
    width: 9rem;
    height: 9rem;
  }

  .button-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .status-text {
    font-size: 0.9rem;
  }

  .controls {
    flex-direction: column;
    width: 100%;
    max-width: 16rem;
  }

  .control-button {
    width: 100%;
  }

  .patient-info-button {
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
  }
}
