:root {
  --bg-dark: #07090e;
  --bg-surface: #0e131f;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-glass: rgba(14, 19, 31, 0.82);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-glow: rgba(0, 242, 254, 0.4);

  --accent-cyan: #00f2fe;
  --accent-purple: #9d4edd;
  --accent-blue: #4facfe;
  --accent-pink: #f72585;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(79, 172, 254, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(157, 78, 221, 0.07) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.03) 0%, transparent 65%);
}

/* Layout Principal */
.aura-app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar de Navegação */
.aura-sidebar {
  width: 72px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.5rem;
  gap: 1rem;
  z-index: 60;
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.sidebar-logo svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.nav-item {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-glass);
}

.nav-item.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-spacer {
  flex: 1;
}

/* Área Central (3D Stage + Floating Controls) */
.aura-main-viewport {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 3D Avatar Canvas Container */
.avatar-3d-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

#avatar3DCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Top Floating HUD */
.top-hud {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 20;
  pointer-events: none;
}

.top-hud > * {
  pointer-events: auto;
}

.hud-pill {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.avatar-model-dropdown {
  background: rgba(14, 19, 31, 0.9);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.avatar-model-dropdown:hover, .avatar-model-dropdown:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

.avatar-model-dropdown option {
  background: var(--bg-surface);
  color: var(--text-main);
}

.hud-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse-dot 2s infinite ease-in-out;
}

.status-indicator.listening { color: var(--accent-cyan); }
.status-indicator.thinking { color: var(--accent-amber); }
.status-indicator.speaking { color: var(--accent-purple); }
.status-indicator.error { color: var(--accent-red); }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.35); opacity: 1; }
}

.hardware-metrics {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.metric-item span {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Indicador de Câmera Ativa */
.camera-active-alert {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: var(--accent-red);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  animation: pulse-cam 1.5s infinite;
}

.camera-active-alert.active {
  display: flex;
}

@keyframes pulse-cam {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Sublegendas em Tempo Real / Fala */
.subtitles-container {
  position: absolute;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 680px;
  width: 90%;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.subtitle-box {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.4rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-main);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transition: var(--transition);
}

.subtitle-box.idle {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Bottom Interaction Dock */
.bottom-dock {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 780px;
  width: 92%;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.55);
  z-index: 25;
}

.mic-toggle-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
  flex-shrink: 0;
}

.mic-toggle-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.6);
}

.mic-toggle-btn.listening {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  box-shadow: 0 0 30px rgba(247, 37, 133, 0.6);
  animation: pulse-mic 1.4s infinite;
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mic-toggle-btn svg {
  width: 22px;
  height: 22px;
}

.text-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0 0.5rem;
}

.text-input-field::placeholder {
  color: var(--text-dim);
}

.action-btn-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn-circle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn-circle.send-btn {
  background: var(--accent-cyan);
  color: #000;
  border: none;
}

.action-btn-circle.send-btn:hover {
  background: #fff;
  transform: scale(1.05);
}

.action-btn-circle svg {
  width: 18px;
  height: 18px;
}

/* Lateral Panel Drawer (Memórias, Conversas, Ferramentas, Logs, Config) */
.aura-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-glass);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.aura-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-body::-webkit-scrollbar {
  width: 5px;
}
.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

/* Componentes nos Painéis */
.card-block {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-control {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.input-control:focus {
  border-color: var(--accent-cyan);
}

.form-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-pill {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
}
.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Lista de Memórias */
.memory-list-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.memory-tag {
  font-size: 0.7rem;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.memory-content {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-top: 0.25rem;
}

/* Logs */
.log-item {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.log-item.WARN { border-left-color: var(--accent-amber); }
.log-item.ERROR { border-left-color: var(--accent-red); }

/* Modal de Confirmação de Segurança */
.security-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.security-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.security-modal-box {
  background: var(--bg-surface);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.25);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

/* Modal de Autenticação / Senha de Acesso */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(15, 23, 42, 0.96), rgba(5, 7, 15, 0.99));
  backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-modal-box {
  background: rgba(18, 22, 36, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: 0 0 60px rgba(0, 242, 254, 0.2), 0 25px 50px rgba(0, 0, 0, 0.8);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo-badge {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(123, 44, 191, 0.2));
  border: 1px solid rgba(0, 242, 254, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 1.2rem;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.3);
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-password-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  letter-spacing: 0.2em;
  outline: none;
  transition: var(--transition);
}

.auth-password-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
  background: rgba(0, 0, 0, 0.6);
}

.auth-error-msg {
  font-size: 0.8rem;
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.auth-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan), #00a8ff);
  color: #050b14;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 242, 254, 0.6);
}
