/* ==========================================================================
   Omnia / iMio — LibreChat Custom Theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Montserrat — Self-hosted (RGPD / GDPR compliant, no Google Fonts)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/montserrat-v26-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/montserrat-v26-latin-regular.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. CSS Custom Properties — iMio brand palette
   -------------------------------------------------------------------------- */

:root {
  --omnia-accent: #de047b;
  --omnia-accent-hover: #c50369;
  --omnia-fill: #e30289;
  --omnia-gradient: linear-gradient(135deg, #ba217d, #e30289);
  --omnia-font: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --omnia-accent-ring: rgba(222, 4, 123, 0.2);

  /* Light-mode gray overrides (iMio palette) */
  --omnia-gray-50: #fafafa;
  --omnia-gray-100: #f6f6f6;
  --omnia-gray-200: #ededed;
  --omnia-gray-300: #d2d2d2;
  --omnia-gray-400: #ababab;
  --omnia-gray-500: #8a8a8a;
}

/* --------------------------------------------------------------------------
   3. Global typography
   -------------------------------------------------------------------------- */

html,
body {
  font-family: var(--omnia-font) !important;
}

/* --------------------------------------------------------------------------
   4. Primary action buttons (send message, etc.)
   Multiple selectors (data-testid, Tailwind class, class substring) provide
   resilience against upstream markup changes — if one selector breaks, the
   others still match.
   -------------------------------------------------------------------------- */

button[data-testid="send-button"],
button.bg-green-500,
button[class*="submit"] {
  background-color: var(--omnia-accent) !important;
  color: #fff !important;
  transition: background-color 0.15s ease;
}

button[data-testid="send-button"]:hover,
button.bg-green-500:hover,
button[class*="submit"]:hover {
  background-color: var(--omnia-accent-hover) !important;
}

/* --------------------------------------------------------------------------
   5. Toggle switches
   -------------------------------------------------------------------------- */

[role="switch"][aria-checked="true"] {
  background-color: var(--omnia-accent) !important;
}

/* --------------------------------------------------------------------------
   6. SSO / OAuth button on login
   Multiple selectors (data-testid + class substring, both button and anchor)
   provide resilience against upstream markup changes.
   -------------------------------------------------------------------------- */

button[data-testid="openid"],
a[data-testid="openid"],
button[class*="social"],
a[class*="social"] {
  background: var(--omnia-gradient) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 600;
  transition: filter 0.15s ease;
}

button[data-testid="openid"]:hover,
a[data-testid="openid"]:hover,
button[class*="social"]:hover,
a[class*="social"]:hover {
  filter: brightness(1.08);
}

/* Input focus ring on login */
input:focus {
  border-color: var(--omnia-accent) !important;
  box-shadow: 0 0 0 2px var(--omnia-accent-ring) !important;
  outline: none !important;
}

/* --------------------------------------------------------------------------
   7. Chat links
   -------------------------------------------------------------------------- */

.prose a,
.markdown a,
[class*="message"] a {
  color: var(--omnia-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover,
.markdown a:hover,
[class*="message"] a:hover {
  color: var(--omnia-accent-hover);
}

/* --------------------------------------------------------------------------
   8. Text selection
   -------------------------------------------------------------------------- */

::selection {
  background-color: var(--omnia-accent-ring);
  color: inherit;
}

/* --------------------------------------------------------------------------
   9. Hide Settings from user dropdown menu
   Stratégie défense-en-profondeur : plusieurs sélecteurs ciblent les mêmes
   éléments par différentes méthodes (position, icône, attribut). Si l'upstream
   change le markup, au moins un sélecteur continue de fonctionner.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   10. Sidebar logo — Omnia branding above chat history
   -------------------------------------------------------------------------- */

/* Le <nav> est le frère adjacent du div contenant close-sidebar-button */
div:has(> button#close-sidebar-button) + nav {
  display: flex !important;
  flex-direction: column !important;
}

div:has(> button#close-sidebar-button) + nav::before {
  content: "";
  display: block;
  flex-shrink: 0;
  width: 100%;
  height: 80px;
  margin: 12px 0;
  background: url("/assets/OmniaIMIO.svg") no-repeat center / contain;
}

/* Le div scrollable interne prend l'espace restant */
div:has(> button#close-sidebar-button) + nav > div {
  flex: 1;
  min-height: 0;
}

/* --------------------------------------------------------------------------
   11. Hide "Fork conversation" button
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   12. Larger Omnia icon in model selector
   -------------------------------------------------------------------------- */

img[src="/assets/icon-192x192.png"] {
  width: 2rem !important;
  height: 2rem !important;
}

div[data-testid="convo-icon"] {
  display: none !important;
}

div[title="Omnia LLM"] img {
  margin-top: -5px; /* alignement optique de l'icône avec le texte */
}

/* --------------------------------------------------------------------------
   13. Force light mode — hide theme toggle
   -------------------------------------------------------------------------- */

/* Par l'icône lucide (sun/moon/monitor) dans le sélecteur de thème */
.account-settings-popover .select-item:has(.lucide-sun),
.account-settings-popover .select-item:has(.lucide-moon),
.account-settings-popover .select-item:has(.lucide-monitor) {
  display: none !important;
}

/* Par le label du groupe de sélection de thème */
.account-settings-popover [role="group"]:has(.lucide-sun) {
  display: none !important;
}
