/* ============================================================
   LUCID Embed Styles — lucid-embed.css
   Qrucible-themed styles for the LUCID AI integration.

   Covers:
   - Status bar indicators
   - Bridge worker progress panel
   - Provider health badges
   - Utility classes for LUCID integration

   Note: The chat widget itself uses Shadow DOM with inline styles
   (see lucid-embed.js). This file styles the bridge-level UI
   elements that live in the main document.
   ============================================================ */

/* ═══════════════════════════════════════════════════════════
   STATUS BAR — LUCID indicator in app-shell statusbar
   ═══════════════════════════════════════════════════════════ */

.lucid-status-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  font-size: 11px;
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  color: var(--text-secondary, #A0A0B0);
  border-left: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  margin-left: 8px;
}

.lucid-status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-muted, #52526A);
  transition: background 0.3s ease;
}

.lucid-status-indicator[data-lucid-status="connected"] {
  background: var(--cyan, #22C55E);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.lucid-status-indicator[data-lucid-status="streaming"] {
  background: var(--orange, #D4A017);
  animation: lucid-status-pulse 1s infinite;
}

.lucid-status-indicator[data-lucid-status="error"] {
  background: var(--red, #EF4444);
}

.lucid-status-indicator[data-lucid-status="idle"] {
  background: var(--text-muted, #52526A);
}

@keyframes lucid-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.lucid-status-label {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #A0A0B0);
}

.lucid-status-v9 {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple, #8B5CF6);
  letter-spacing: 0.03em;
}

.lucid-status-health {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
}

.lucid-status-health.all-healthy {
  color: var(--cyan, #22C55E);
}

.lucid-status-health.degraded {
  color: var(--orange, #D4A017);
}

.lucid-status-health.down {
  color: var(--red, #EF4444);
}

/* ═══════════════════════════════════════════════════════════
   BRIDGE WORKER PANEL — parallel dispatch visualization
   ═══════════════════════════════════════════════════════════ */

.lucid-bridge-workers {
  background: var(--bg-elevated, #2C2C38);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.lucid-bridge-workers-title {
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--purple, #8B5CF6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lucid-bridge-workers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lucid-bridge-worker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg-surface, #32323E);
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--text-primary, #F0F0F5);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lucid-bridge-worker.running {
  border-color: rgba(212, 160, 23, 0.2);
}

.lucid-bridge-worker.done {
  border-color: rgba(34, 197, 94, 0.2);
  opacity: 0.75;
}

.lucid-bridge-worker.failed {
  border-color: rgba(239, 68, 68, 0.2);
}

.lucid-bridge-worker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lucid-bridge-worker-dot.running {
  background: var(--orange, #D4A017);
  animation: lucid-status-pulse 1s infinite;
}

.lucid-bridge-worker-dot.done {
  background: var(--cyan, #22C55E);
}

.lucid-bridge-worker-dot.failed {
  background: var(--red, #EF4444);
}

.lucid-bridge-worker-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════
   PROVIDER HEALTH BADGES
   ═══════════════════════════════════════════════════════════ */

.lucid-provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono, 'Roboto Mono', monospace);
  font-weight: 500;
  background: var(--bg-surface, #32323E);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}

.lucid-provider-badge[data-state="CLOSED"] {
  color: var(--cyan, #22C55E);
  border-color: rgba(34, 197, 94, 0.2);
}

.lucid-provider-badge[data-state="HALF_OPEN"] {
  color: var(--orange, #D4A017);
  border-color: rgba(212, 160, 23, 0.2);
}

.lucid-provider-badge[data-state="OPEN"] {
  color: var(--red, #EF4444);
  border-color: rgba(239, 68, 68, 0.2);
}

.lucid-provider-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ═══════════════════════════════════════════════════════════
   GUIDE PANEL — LUCID tab (if tab switching is used)
   ═══════════════════════════════════════════════════════════ */

.lucid-guide-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm, 4px);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary, #A0A0B0);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.lucid-guide-tab:hover {
  color: var(--text-primary, #F0F0F5);
  background: var(--bg-hover, #38384A);
}

.lucid-guide-tab.active {
  color: var(--cyan, #22C55E);
  border-color: var(--cyan-border, rgba(34, 197, 94, 0.25));
  background: var(--cyan-subtle, rgba(34, 197, 94, 0.10));
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .lucid-status-bar {
    display: none; /* hide from statusbar on mobile — widget toggle is enough */
  }

  .lucid-bridge-workers {
    margin: 8px;
    padding: 8px 10px;
  }
}
