* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f3f4f6; /* Light grey background */
  display: flex;
  flex-direction: column;
  height: 100vh;
  color: #1f2937; /* Dark text */
  overflow: hidden;
  position: relative;
}

/* Watermark */
.watermark-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 480px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 1;
}
.watermark-container img {
  width: 100%;
  height: auto;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 2;
  position: relative;
}

/* Header */
.app-header {
  background-color: #ffffff; /* White background */
  color: #1f2937;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-left .logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #ffffff;
  object-fit: contain;
  padding: 2px;
  border: 1px solid #e53935;
}
.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: #e53935; /* Red brand color */
}

/* Connection Status */
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #f3f4f6;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  color: #4b5563;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #bbb;
  display: inline-block;
}
.status-connecting .status-dot {
  background-color: #ffb74d;
  animation: pulse-dot 1.2s infinite;
}
.status-online .status-dot {
  background-color: #4caf50;
}
.status-offline .status-dot {
  background-color: #e53935;
}
@keyframes pulse-dot {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.view-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Avatar Pulse Wave (Patient View) */
.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 24px;
}
.operator-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  outline: 3px solid #e53935;
  box-shadow: 0 0 20px rgba(229, 57, 53, 0.2);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
}
.avatar-pulse {
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  border: 3px solid #e53935;
  opacity: 0;
  z-index: 1;
}
.speaking .avatar-pulse {
  animation: pulse-wave 1.5s infinite linear;
}
@keyframes pulse-wave {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { opacity: 0.4; }
  100% { transform: scale(1.2); opacity: 0; }
}

.display-title {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1f2937;
  margin-bottom: 6px;
}
.verified-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.display-subtitle {
  font-size: 0.95rem;
  color: #6b7280;
}

/* Patient Card Glassmorphism (Admin View) */
.patient-card-glass {
  background: #ffffff; /* White card */
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 30px;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.avatar-initials {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #e53935;
  color: white;
  font-size: 2.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
  border: 2px solid #ffffff;
}
.patient-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}
.patient-details {
  font-size: 0.95rem;
  color: #4b5563;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: stretch;
  background-color: #f9fafb;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
}
.patient-details p {
  display: flex;
  align-items: center;
  gap: 8px;
}
.patient-details i {
  color: #e53935;
  width: 16px;
}

/* Speaking Wave Animation (Admin View) */
.speaking-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #4caf50;
  font-size: 0.9rem;
  font-weight: 600;
}
.speaking .speaking-indicator {
  display: flex;
}
.wave-bar {
  width: 3px;
  height: 12px;
  background-color: #4caf50;
  border-radius: 3px;
}
.speaking .wave-bar:nth-child(1) { animation: voice-wave 0.8s infinite ease-in-out alternate; }
.speaking .wave-bar:nth-child(2) { animation: voice-wave 0.8s infinite ease-in-out alternate 0.2s; }
.speaking .wave-bar:nth-child(3) { animation: voice-wave 0.8s infinite ease-in-out alternate 0.4s; }
@keyframes voice-wave {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* Controls Footer */
.app-footer {
  padding: 20px;
  background-color: #ffffff;
  border-top: 1px solid #e5e7eb;
}
.controls-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 100%;
}
.btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-large {
  flex: 1;
  max-width: 200px;
  height: 52px;
}
.btn-danger {
  background-color: #ef4444;
  color: white;
}
.btn-danger:hover {
  background-color: #dc2626;
}
.btn-secondary {
  background-color: #f3f4f6;
  color: #4b5563;
  width: 52px;
  height: 52px;
  font-size: 1.3rem;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
}
.btn-secondary.muted {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}
.btn-primary {
  background-color: #e53935;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  width: 100%;
}
.btn-primary:hover {
  background-color: #c62828;
}

/* Overlay screens */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f3f4f6;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.spinner {
  border: 4px solid rgba(0, 0, 0, 0.05);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border-left-color: #e53935;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.overlay-card {
  background: #ffffff;
  padding: 35px 25px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.exit-title {
  font-size: 1.4rem;
  font-weight: bold;
  color: #e53935;
  margin-bottom: 12px;
}
.exit-text {
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 20px;
}
