/* ══════════════════════════════════════════════════════════
   Cartha OpenClaw Dashboard — UI Polish
   Branding + Claude Code-style collapsible verbose content
   ══════════════════════════════════════════════════════════ */

/* ── Branding override ── */
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo svg:first-child {
  /* Hide original SVG logo only, keep our injected one */
}

/* ── Tool/exec message lines: collapsed by default ── */
.chat-line.other {
  opacity: 0.6;
  transition: opacity 0.2s;
}
.chat-line.other:hover {
  opacity: 1;
}

/* Tool role label: subtle */
.chat-line.other .chat-msg > .chat-role {
  font-size: 11px !important;
  opacity: 0.5;
}

/* ── Collapsible tool output blocks ── */
.cartha-collapsed {
  max-height: 60px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: max-height 0.3s ease;
}
.cartha-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--card, #1e2028));
  pointer-events: none;
}
.cartha-collapsed.cartha-expanded {
  max-height: none;
}
.cartha-collapsed.cartha-expanded::after {
  display: none;
}

/* Toggle button for collapsed content */
.cartha-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #71717a);
  background: var(--secondary, #27272a);
  border: 1px solid var(--border, #3f3f46);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.cartha-toggle:hover {
  color: var(--text, #e4e4e7);
  background: var(--border, #3f3f46);
}
.cartha-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}
.cartha-expanded + .cartha-toggle svg {
  transform: rotate(180deg);
}

/* ── Code blocks in assistant messages: collapse long ones ── */
.chat-line.assistant .chat-bubble pre.cartha-collapsed {
  max-height: 100px;
  border-radius: var(--radius-sm, 6px);
}
.chat-line.assistant .chat-bubble pre.cartha-collapsed::after {
  background: linear-gradient(transparent, var(--secondary, #1a1a2e));
}

/* ── Emphasize key assistant text ── */

/* Bold first paragraph / summary line of assistant messages */
.chat-line.assistant .chat-bubble > p:first-child,
.chat-line.assistant .chat-bubble > :first-child:not(pre):not(code):not(.cartha-collapsed) {
  font-weight: 500;
}

/* Lists with checkmarks / status items — make them pop */
.chat-line.assistant .chat-bubble li {
  line-height: 1.6;
}

/* Error messages — stand out */
.chat-line.assistant .chat-bubble code:has(error),
.chat-bubble [class*="error"],
.chat-bubble [class*="danger"] {
  color: var(--danger, #ef4444) !important;
  font-weight: 600;
}

/* Strong/bold in assistant messages — make prominent */
.chat-line.assistant .chat-bubble strong,
.chat-line.assistant .chat-bubble b {
  color: var(--text, #fff);
  font-weight: 700;
}

/* ── Exec/tool cards: more compact ── */
.chat-bubble .exec-approval-command {
  max-height: 40px;
  overflow: hidden;
  position: relative;
}

/* ── Tool lines: compress spacing ── */
.chat-line.other .chat-msg {
  gap: 2px !important;
}
.chat-line.other .chat-bubble {
  padding: 4px 10px !important;
  font-size: 13px;
}
.chat-line.other + .chat-line.other {
  margin-top: -4px;
}

/* ── "Completed" status badge ── */
.cartha-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.cartha-status-badge--success {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}
.cartha-status-badge--error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ── Inline code in assistant messages: subtler ── */
.chat-line.assistant .chat-bubble code:not(pre code) {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
  background: var(--secondary, rgba(255,255,255,0.06));
}

/* ── Hide redundant "tool 2:18 PM" timestamp on consecutive tool lines ── */
.chat-line.other + .chat-line.other .chat-role {
  display: none !important;
}

/* ── Login gate: simplify — only show Password + Connect ── */

/* Hide WebSocket URL field (first .field in login form) */
.login-gate__form > .field:first-child {
  display: none !important;
}

/* Hide Gateway Token field (second .field in login form) */
.login-gate__form > .field:nth-child(2) {
  display: none !important;
}

/* Hide "How to connect" help section */
.login-gate__help {
  display: none !important;
}
