/* Cascade BH Demo — Chainlit Embed Styles */

/* ============================================
   Uses CSS custom properties so portal can
   override via postMessage theme switching.

   Default: indigo/cyan palette matching BH demo.
   ============================================ */

/* --- Hide Chainlit chrome when embedded --- */

.embed-mode #header,
.embed-mode #readme-button {
  display: none !important;
}

/* When in iframe, always hide header (portal provides nav) */

/* --- Hide README button always --- */
#readme-button {
  display: none !important;
}

/* --- Theme: Light mode --- */

#welcome-screen {
  border-top: 3px solid transparent;
  border-image: linear-gradient(135deg, #6366f1, #06b6d4) 1;
  padding-top: 1rem;
}

#welcome-screen .prose h1 {
  background: linear-gradient(135deg, #6366f1, #06b6d4) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
  font-weight: 700 !important;
}

.prose h2 { color: #1e293b !important; }
.dark .prose h2 { color: #e2e8f0 !important; }

/* --- Starter buttons --- */

#starters button {
  border: 1px solid #6366f1 !important;
  transition: all 0.2s ease;
}

#starters button:hover {
  background-color: #eef2ff !important;
  border-color: #06b6d4 !important;
}

.dark #starters button:hover {
  background-color: rgba(99, 102, 241, 0.1) !important;
}

/* --- Markdown tables --- */

.prose table, .prose-sm table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.9em;
}

.prose thead th, .prose-sm thead th {
  background: linear-gradient(135deg, #6366f1, #06b6d4) !important;
  color: #ffffff !important;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #6366f1;
}

.prose tbody td, .prose-sm tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.prose tbody tr:hover, .prose-sm tbody tr:hover {
  background-color: #eef2ff;
}

.prose tbody tr:nth-child(even), .prose-sm tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.dark .prose tbody td, .dark .prose-sm tbody td {
  border-bottom-color: #334155;
}

.dark .prose tbody tr:hover, .dark .prose-sm tbody tr:hover {
  background-color: #1e293b;
}

.dark .prose tbody tr:nth-child(even), .dark .prose-sm tbody tr:nth-child(even) {
  background-color: #0f172a;
}

/* --- Links --- */

.prose a, .prose-sm a { color: #6366f1 !important; text-decoration: none; }
.prose a:hover, .prose-sm a:hover { color: #06b6d4 !important; text-decoration: underline; }
.dark .prose a, .dark .prose-sm a { color: #818cf8 !important; }
.dark .prose a:hover, .dark .prose-sm a:hover { color: #06b6d4 !important; }

/* --- Radix dropdown text fix (same as RHT) --- */

[data-radix-popper-content-wrapper] [role="menuitem"],
[data-radix-popper-content-wrapper] [role="menuitem"] * {
  color: hsl(var(--popover-foreground)) !important;
  -webkit-text-fill-color: hsl(var(--popover-foreground)) !important;
  opacity: 1 !important;
}

[role="menu"], [data-radix-popper-content-wrapper] [role="menu"] {
  background-color: hsl(var(--popover)) !important;
  color: hsl(var(--popover-foreground)) !important;
}

/* --- Scrollbar --- */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.5); }
.dark ::-webkit-scrollbar-thumb { background: rgba(6, 182, 212, 0.3); }
.dark ::-webkit-scrollbar-thumb:hover { background: rgba(6, 182, 212, 0.5); }
