/* ============================================
   Vulcan Materials — Chainlit UI Override
   ============================================ */

/* Force light mode colors on Chainlit's HSL-based CSS vars */
:root,
.dark,
[data-theme="dark"] {
  --background: 0 0% 100%;
  --foreground: 210 29% 24%;
  --card: 0 0% 100%;
  --card-foreground: 210 29% 24%;
  --popover: 0 0% 100%;
  --popover-foreground: 210 29% 24%;
  --primary: 210 100% 20%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 33% 96%;
  --secondary-foreground: 210 100% 20%;
  --muted: 210 33% 96%;
  --muted-foreground: 215 14% 34%;
  --accent: 210 100% 40%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 210 100% 40%;
  --radius: 0.75rem;
  --sidebar-background: 0 0% 100%;
  --sidebar-foreground: 210 29% 24%;
}

/* ---- Global ---- */
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background: #ffffff !important;
  color: #333333 !important;
}

#root {
  background: #ffffff !important;
}

/* ---- Header ---- */
#header {
  background: #ffffff !important;
  border-bottom: none !important;
  box-shadow: 0 2px 12px rgba(0, 51, 102, 0.12) !important;
  min-height: 56px !important;
  padding-left: 4px !important;
  position: relative !important;
}

/* Logo in header - use the local SVG */
#header img[alt="logo"] {
  max-height: 40px !important;
  width: auto !important;
}

/* Hide theme toggle */
#theme-toggle,
#readme-button {
  display: none !important;
}

/* New chat button - flush left */
#new-chat-button {
  color: #003366 !important;
  border-radius: 8px !important;
  margin-left: 0 !important;
}
#new-chat-button:hover {
  background: #f0f4f8 !important;
  color: #0066CC !important;
}

/* ---- Main content area ---- */
.h-screen.w-screen {
  background: #ffffff !important;
}

/* ---- Messages ---- */
/* User message */
[data-step-type="user_message"] .markdown-body {
  background: #003366 !important;
  color: #ffffff !important;
  padding: 12px 18px !important;
  border-radius: 16px 16px 4px 16px !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

/* Assistant message */
[data-step-type="assistant_message"] .markdown-body,
[data-step-type="run"] .markdown-body {
  background: #f5f7fa !important;
  color: #333333 !important;
  padding: 16px 20px !important;
  border-radius: 16px 16px 16px 4px !important;
  border: 1px solid #e2e8f0 !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

/* ---- Composer / Input area ---- */
#message-composer {
  background: #ffffff !important;
  border: 2px solid #d1d5db !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 12px rgba(0, 51, 102, 0.06) !important;
  transition: border-color 200ms ease, box-shadow 200ms ease !important;
}
#message-composer:focus-within {
  border-color: #0066CC !important;
  box-shadow: 0 2px 16px rgba(0, 102, 204, 0.1) !important;
}

#chat-input {
  font-size: 1rem !important;
  color: #333333 !important;
  background: transparent !important;
}
#chat-input::placeholder {
  color: #9ca3af !important;
}

/* ---- Buttons ---- */
#chat-submit {
  background: #0066CC !important;
  color: #ffffff !important;
  border-radius: 8px !important;
}
#chat-submit:hover {
  background: #0052A3 !important;
}
#chat-submit:disabled {
  background: #d1d5db !important;
  opacity: 0.6 !important;
}

/* Welcome screen layout: Logo → Starters → Composer */
#welcome-screen > img {
  order: -2 !important;
}
#welcome-screen > #starters {
  order: -1 !important;
  margin-bottom: 8px !important;
}
#welcome-screen > #message-composer {
  order: 0 !important;
}
.starters button,
button[class*="starter"] {
  border: 1.5px solid #003366 !important;
  border-radius: 8px !important;
  color: #003366 !important;
  font-weight: 500 !important;
  transition: all 250ms ease !important;
}
.starters button:hover,
button[class*="starter"]:hover {
  background-color: #003366 !important;
  color: #fff !important;
}



/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #003366;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #004080;
}

/* ---- Links inside messages ---- */
.markdown-body a {
  color: #0066CC !important;
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
  transition: border-color 200ms ease !important;
}
.markdown-body a:hover {
  border-bottom-color: #0066CC !important;
}

/* ---- Code blocks ---- */
.markdown-body pre {
  background: #1e293b !important;
  border-radius: 12px !important;
  border: none !important;
}
.markdown-body code {
  font-size: 0.875rem !important;
}
.markdown-body :not(pre) > code {
  background: #e2e8f0 !important;
  color: #003366 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}

/* ---- Welcome / Readme headings ---- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: #003366 !important;
  font-weight: 700 !important;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
