@import "tailwindcss";

/*
 * ─── Theme CSS Variables ───
 * Generated at runtime by syncTokensToCss() in theme.ts.
 * Do NOT define --clui-* vars here — JS tokens are the single source of truth.
 */

html, body, #root {
  height: 100%;
  margin: 0;
  background: transparent !important;
  overflow: hidden;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar — thin & subtle ─── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--clui-scroll-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clui-scroll-thumb-hover);
}

/* ─── Glass surface — shared card/pill style ─── */
.glass-surface {
  background: var(--clui-container-bg);
  border: 1px solid var(--clui-container-border);
  box-shadow: var(--clui-card-shadow);
}

/* ─── Textarea reset ─── */
textarea {
  font-family: inherit;
  font-size: inherit;
  cursor: text;
}
textarea:focus {
  outline: none;
}
textarea::placeholder,
input::placeholder {
  color: var(--clui-placeholder);
}

/* ─── Allow text selection in conversation content ─── */
.prose-cloud,
.conversation-selectable {
  user-select: text;
  -webkit-user-select: text;
}

/* ─── Prose overrides for markdown ─── */
.prose-cloud {
  color: var(--clui-text-primary);
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}
.prose-cloud p {
  margin: 0.25em 0;
}
.prose-cloud pre {
  background: var(--clui-code-bg);
  border: 1px solid var(--clui-container-border);
  border-radius: 10px;
  padding: 0.75em 1em;
  font-size: 12px;
  overflow-x: auto;
}
.prose-cloud code {
  background: var(--clui-accent-light);
  color: var(--clui-accent);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}
.prose-cloud pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.prose-cloud a {
  color: var(--clui-accent);
  text-decoration: none;
}
.prose-cloud a:hover {
  text-decoration: underline;
}
.prose-cloud ul, .prose-cloud ol {
  padding-left: 1.2em;
  margin: 0.25em 0;
}
.prose-cloud li {
  margin: 0.1em 0;
}
.prose-cloud h1, .prose-cloud h2, .prose-cloud h3, .prose-cloud h4 {
  margin: 0.5em 0 0.25em;
  font-weight: 600;
  color: var(--clui-text-primary);
}
.prose-cloud blockquote {
  border-left: 3px solid var(--clui-tool-running-border);
  padding-left: 0.75em;
  color: var(--clui-text-secondary);
  margin: 0.5em 0;
}
.prose-cloud table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12px;
}
.prose-cloud th, .prose-cloud td {
  border: 1px solid var(--clui-container-border);
  padding: 0.4em 0.6em;
  overflow-wrap: anywhere;
}
.prose-cloud th:first-child, .prose-cloud td:first-child {
  white-space: nowrap;
}
.prose-cloud th {
  background: var(--clui-surface-primary);
  font-weight: 600;
}

/* ─── Pulsing dot animation ─── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.animate-pulse-dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ─── Bouncing dots for thinking ─── */
@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}
.animate-bounce-dot {
  animation: bounce-dot 1.2s ease-in-out infinite;
}

/* ─── Stacking circle buttons ─── */
.circles-out {
  position: absolute;
  right: calc(100% + 10px);
  bottom: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.btn-stack {
  position: relative;
  width: 160px;
  height: 46px;
  overflow: visible;
}

.stack-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clui-text-tertiary);
  cursor: pointer;
  transition: right 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
              color 0.15s ease,
              background 0.15s ease;
}
.stack-btn:hover:not(:disabled) { color: var(--clui-btn-hover-color); background: var(--clui-btn-hover-bg); }
.stack-btn:disabled { color: var(--clui-btn-disabled); cursor: default; }

/* Collapsed: stacked on the right, overlapping */
.stack-btn-1 { right: 0;    z-index: 3; }
.stack-btn-2 { right: 28px; z-index: 2; }
.stack-btn-3 { right: 56px; z-index: 1; }

/* Expanded on hover: spread evenly */
.btn-stack:hover .stack-btn-1 { right: 0; }
.btn-stack:hover .stack-btn-2 { right: 56px; }
.btn-stack:hover .stack-btn-3 { right: 112px; }

/* ─── Drag region for frameless window ─── */
/* Manual drag via IPC replaces -webkit-app-region which conflicts with setIgnoreMouseEvents */
.drag-region {
  cursor: grab;
}
.drag-region:active {
  cursor: grabbing;
}
.no-drag {
  cursor: default;
}
