/* Project Face — Medical Patient Avatar */

:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-panel: #222633;
  --bg-hover: #2a2e3d;
  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b4;
  --text-dim: #6b7280;
  --accent: #4f8cff;
  --accent-hover: #3a7aff;
  --accent-glow: rgba(79, 140, 255, 0.25);
  --surgeon-color: #4f8cff;
  --patient-color: #34d399;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --border: #2d3348;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Layout */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Avatar Loading */
#avatar-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

#avatar-loading .loading-text {
  font-size: 14px;
}

#avatar-fullscreen #avatar-loading.hidden,
#avatar-loading.hidden {
  display: none;
}

/* ─── Idle Screen ─────────────────────────────────────────────────────── */
#idle-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 100;
}

#idle-screen.hidden {
  display: none;
}

#idle-prompt {
  font-size: 22px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 500px;
  line-height: 1.6;
}

#idle-status {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-dim);
  min-height: 20px;
}

/* ─── Fullscreen Avatar ───────────────────────────────────────────────── */
#avatar-fullscreen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 50;
}

#avatar-fullscreen.hidden {
  display: none;
}

#avatar-fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#avatar-fullscreen audio {
  display: none;
}

/* Loading overlay (inside fullscreen) */
#avatar-fullscreen #avatar-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10;
}

/* ─── Subtitle Bar ────────────────────────────────────────────────────── */
#subtitle-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 24px 40px 40px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#subtitle-bar.visible {
  opacity: 1;
}

#subtitle-text {
  font-size: 20px;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  max-width: 800px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Speaker label in subtitles */
#subtitle-text .speaker-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  display: block;
  margin-bottom: 4px;
}
