/* AI Chat — Streaming SSR Example Styles (dark/light aware via tokens.css) */

/* Demo notice */
.demo-notice {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--muted) 60%, var(--background));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.demo-notice code {
  font-size: 0.8rem;
  background: var(--muted);
  color: var(--muted-foreground);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.chat-container {
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--card);
  color: var(--card-foreground);
}

/* Messages */
.chat-messages {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}
.chat-msg { display: flex; }
.chat-user { justify-content: flex-end; }
.chat-assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 80%;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
  line-height: 1.5;
}
.chat-bubble p { margin: 0; }
.chat-bubble time {
  display: block;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}
.chat-user .chat-bubble {
  background: var(--primary);
  color: var(--primary-foreground);
  border-bottom-right-radius: var(--radius-sm);
}
.chat-user .chat-bubble time {
  color: color-mix(in oklch, var(--primary-foreground) 60%, transparent);
}
.chat-assistant .chat-bubble {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--radius-sm);
}

/* Suggestions */
.chat-suggestions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}
.suggestion-chip {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.suggestion-chip:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* Input area */
.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--background);
}
.chat-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--background);
  color: var(--foreground);
}
.chat-input:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.chat-send {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Skeleton loading */
.chat-skeleton {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.skeleton-msg {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-lg);
}
.skeleton-user {
  align-self: flex-end;
  background: var(--muted);
  width: 50%;
}
.skeleton-bot {
  align-self: flex-start;
  background: color-mix(in oklch, var(--muted) 70%, var(--background));
  width: 70%;
}
.skeleton-line {
  height: 0.8rem;
  background: color-mix(in oklch, var(--muted) 60%, var(--foreground) 10%);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.suggestions-skeleton {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}
.skeleton-chip {
  width: 8rem;
  height: 1.8rem;
  background: var(--muted);
  border-radius: 999px;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Streaming cursor */
.streaming-cursor {
  display: inline-block;
  color: currentColor;
  animation: cursor-blink 0.7s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
