/*
 * Barabari look for Whatomate releases up to v0.1.1-beta-0.17 (Tailwind + shadcn-vue UI).
 * install.sh uses this file as barabari/theme.css when the running Whatomate has that UI;
 * for the newer Oat UI it uses theme-oat.css instead.
 *
 * nginx adds this stylesheet at the end of <head>, after Whatomate's own CSS, and adds
 * barabari/light.js at the start of <head>, so the app always opens in its light mode
 * (the dashboard is light only, D-019). Whatomate's code is not changed.
 *
 * This UI keeps colours as "H S% L%" triplets used as hsl(var(--x)), and in places uses
 * Tailwind's emerald and teal classes directly for its brand accent; both are mapped to the
 * dashboard's navy and blue (src/styles/brand-tokens.css). Plain green stays: Whatomate uses
 * it for success (delivered, connected).
 */

@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("/barabari/fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("/barabari/fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("/barabari/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("/barabari/fonts/montserrat-latin-700-normal.woff2") format("woff2"); }

/* Theme variables. Same values for :root, .light and .dark, so even a stray dark class shows our light look. */
:root, html.light, html.dark, .light, .dark {
  color-scheme: light;
  --background: 216 100% 98%;          /* brand canvas #f5f9ff */
  --foreground: 221 39% 11%;           /* ink #111827 */
  --card: 0 0% 100%;
  --card-foreground: 221 39% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 221 39% 11%;
  --primary: 230 49% 40%;              /* brand blue #344499 */
  --primary-foreground: 0 0% 100%;
  --secondary: 220 79% 96%;            /* brand wash #eef3fd */
  --secondary-foreground: 231 49% 24%; /* brand navy #1f285b */
  --muted: 220 79% 96%;
  --muted-foreground: 217 17% 40%;     /* brand muted #566378 */
  --accent: 223 100% 96%;              /* brand blue wash #eaf0ff */
  --accent-foreground: 231 49% 24%;
  --destructive: 4 76% 40%;            /* brand danger #b42318 */
  --destructive-foreground: 0 0% 100%;
  --border: 219 78% 93%;               /* brand line #dee8fb */
  --input: 222 66% 85%;                /* brand line strong #c0cff2 */
  --ring: 230 49% 40%;
  --radius: 0.625rem;                  /* dashboard controls 10px */
  --glass-bg: rgba(31, 40, 91, 0.02);
  --glass-bg-hover: rgba(31, 40, 91, 0.04);
  --glass-border: rgba(31, 40, 91, 0.08);
}

html, body, .font-sans {
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}
body, .light body { background-color: #f5f9ff; background-image: none; }

/* Logo in the sidebar and the mobile header: the Barabari mark instead of the green chat icon. */
a[href="/"] > .bg-gradient-to-br {
  background: #ffffff url("/barabari/logo.webp") center / 80% no-repeat;
  border: 1px solid #dee8fb;
  box-shadow: none;
}
a[href="/"] > .bg-gradient-to-br > svg { visibility: hidden; }
/* Product name next to the logo. */
a[href="/"] > .bg-gradient-to-br + span,
a[href="/"] > .bg-gradient-to-br + div > span:first-child {
  font-size: 0;
}
a[href="/"] > .bg-gradient-to-br + span::after,
a[href="/"] > .bg-gradient-to-br + div > span:first-child::after {
  content: "Barabari WhatsApp";
  font-size: 0.875rem;
  color: #1f285b;
}

/* Emerald and teal (Whatomate's brand accent) → Barabari blue and navy. */
.text-emerald-400, .text-emerald-500, .text-emerald-600, .text-emerald-700,
.light .light\:text-emerald-600, .light .light\:text-emerald-700,
.hover\:text-emerald-300:hover, .hover\:text-emerald-400:hover, .hover\:text-emerald-600:hover { color: #344499; }

.bg-emerald-500, .bg-emerald-600, .bg-teal-600, .light .light\:bg-emerald-500,
.hover\:bg-emerald-500:hover { background-color: #344499; }
.hover\:bg-emerald-600:hover { background-color: #293777; }
.bg-emerald-50, .bg-emerald-100, .light .light\:bg-emerald-50, .light .light\:bg-emerald-100 { background-color: #eaf0ff; }
.bg-emerald-100\/60, .light .light\:bg-emerald-100\/60 { background-color: rgb(234 240 255 / 0.6); }
.bg-emerald-500\/10, .hover\:bg-emerald-500\/10:hover { background-color: rgb(52 68 153 / 0.08); }
.bg-emerald-500\/20 { background-color: rgb(52 68 153 / 0.12); }
.hover\:bg-emerald-500\/30:hover { background-color: rgb(52 68 153 / 0.18); }

.border-emerald-200, .light .light\:border-emerald-200 { border-color: #c0cff2; }
.border-emerald-400, .border-emerald-500 { border-color: #344499; }
.border-emerald-500\/20 { border-color: rgb(52 68 153 / 0.2); }
.border-emerald-500\/40 { border-color: rgb(52 68 153 / 0.4); }
.border-emerald-500\/50 { border-color: rgb(52 68 153 / 0.5); }
.border-emerald-500\/60 { border-color: rgb(52 68 153 / 0.6); }

.ring-emerald-500 { --tw-ring-color: #344499; }
.ring-emerald-500\/30 { --tw-ring-color: rgb(52 68 153 / 0.3); }
.shadow-emerald-500\/20, .shadow-teal-500\/20 { --tw-shadow-color: rgb(52 68 153 / 0.2); --tw-shadow: var(--tw-shadow-colored); }
.shadow-emerald-500\/5 { --tw-shadow-color: rgb(52 68 153 / 0.05); --tw-shadow: var(--tw-shadow-colored); }

/* Gradients (page-header icons, avatars): blue to navy. */
.from-emerald-400, .from-emerald-500, .from-emerald-600, .from-teal-500, .from-teal-600, .light .light\:from-emerald-600 {
  --tw-gradient-from: #344499 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(52 68 153 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-emerald-500\/60 {
  --tw-gradient-from: rgb(52 68 153 / 0.6) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(52 68 153 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.to-emerald-500, .to-emerald-600, .to-teal-500, .to-teal-600,
.bg-gradient-to-br.from-emerald-500.to-green-600 { --tw-gradient-to: #1f285b var(--tw-gradient-to-position); }
.to-emerald-500\/0 { --tw-gradient-to: rgb(52 68 153 / 0) var(--tw-gradient-to-position); }

/* Outgoing chat bubble stays WhatsApp green (brand chat-bubble token); the page behind chats is brand paper. */
:focus-visible { outline-color: #344499; }

@media (forced-colors: active) {
  a[href="/"] > .bg-gradient-to-br { forced-color-adjust: none; }
}
