/*
 * Verktygsboden theme for LibreChat — example of runtime theming.
 * LibreChat's UI is driven by CSS variables (see html{...} and .dark{...} in the built
 * index.*.css). Overriding them here re-skins the whole app without rebuilding.
 * Palette and type follow verktygsboden.se (vb-blue #195178, HK Grotesk, square corners).
 */

/* Hanken Grotesk is the open-source successor of HK Grotesk, which verktygsboden.se uses */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

/* ---------- Brand palette ---------- */
:root {
  --brand-50:  #eef4f8;
  --brand-100: #d6e5ef;
  --brand-200: #aecbde;
  --brand-400: #5fa3d3;   /* readable accent on dark surfaces */
  --brand-500: #195178;   /* vb-blue */
  --brand-600: #14446a;
  --brand-700: #003057;   /* vb-blue-darker */
  --vb-green:  #59a021;
  --vb-red:    #a61200;
  --vb-yellow: #ffd336;
  --gray-50:  #f8f8f8;
  --gray-100: #e9e9e9;
  --gray-200: #d6d6d6;
  --navy-950: #04111d;
  --navy-900: #071a2b;
  --navy-850: #0a2236;
  --navy-800: #0e2a42;
  --navy-700: #153955;
  --navy-600: #1d4a6b;
}

html, body, button, input, textarea, select {
  font-family: 'Hanken Grotesk', 'HKGrotesk', ui-sans-serif, system-ui, sans-serif !important;
}

/* ---------- Light mode ---------- */
html {
  --brand-purple: var(--brand-500);
  --surface-submit: var(--brand-500);
  --surface-submit-hover: var(--brand-700);
  --surface-primary-alt: var(--gray-50);    /* sidebar */
  --surface-secondary: var(--gray-50);
  --surface-active: var(--brand-100);
  --surface-active-alt: var(--brand-100);
  --surface-hover: var(--gray-100);
  --surface-hover-alt: var(--gray-200);
  --border-light: var(--gray-200);
  --ring-primary: var(--brand-500);
  --text-primary: #212529;
  --primary: 205 65% 28%;                   /* shadcn components (hsl) */
  --primary-foreground: 0 0% 100%;
  --ring: 205 65% 28%;
}

/* ---------- Dark mode (deep vb-blue instead of neutral gray) ---------- */
html.dark, .dark {
  --brand-purple: var(--brand-400);
  --presentation: var(--navy-900);
  --surface-primary: var(--navy-950);
  --surface-primary-alt: var(--navy-900);  /* sidebar */
  --surface-primary-contrast: var(--navy-850);
  --surface-secondary: var(--navy-850);
  --surface-secondary-alt: var(--navy-800);
  --surface-tertiary: var(--navy-800);
  --surface-tertiary-alt: var(--navy-800);
  --surface-dialog: var(--navy-900);
  --surface-chat: var(--navy-800);
  --surface-active: var(--navy-600);
  --surface-active-alt: var(--navy-700);
  --surface-hover: var(--navy-700);
  --surface-hover-alt: var(--navy-700);
  --surface-submit: var(--brand-500);
  --surface-submit-hover: var(--navy-600);
  --header-primary: var(--navy-900);
  --header-hover: var(--navy-800);
  --header-button-hover: var(--navy-800);
  --border-light: var(--navy-700);
  --ring-primary: var(--brand-400);
  --primary: 205 55% 60%;
  --primary-foreground: 0 0% 100%;
  --background: 209 76% 7%;
  --ring: 205 55% 60%;
}

/* ---------- Auth pages (login/register use hard-coded Tailwind colors) ---------- */
.dark .dark\:bg-gray-900 { background-color: var(--navy-950) !important; }
.text-green-600, .dark .dark\:text-green-500 { color: var(--brand-500) !important; }
.dark .dark\:text-green-500 { color: var(--brand-400) !important; }
.hover\:text-green-700:hover, .dark .dark\:hover\:text-green-400:hover { color: var(--brand-700) !important; }
.bg-green-500, .bg-green-600 { background-color: var(--brand-500) !important; }
.hover\:bg-green-600:hover, .hover\:bg-green-700:hover { background-color: var(--brand-700) !important; }
.dark input { background-color: var(--navy-900); }

/* Logo is drawn in vb-blue; flip it to white on dark backgrounds */
.dark img[src*="logo.svg"] { filter: brightness(0) invert(1); }

/* ---------- Square, workshop-style corners (verktygsboden.se uses no rounding) ---------- */
button, input, textarea, select,
.rounded, .rounded-md, .rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl {
  border-radius: 2px !important;
}

/* ---------- Small touches ---------- */
::selection { background: rgba(25, 81, 120, 0.25); }

a { color: inherit; }
.markdown a, .prose a { color: var(--brand-500) !important; }
.dark .markdown a, .dark .prose a { color: var(--brand-400) !important; }

/* Branded caret in the chat input */
form textarea { caret-color: var(--brand-500); }
.dark form textarea { caret-color: var(--brand-400); }
