/* Portal global styles — loaded after Mantine's CSS, no Tailwind preflight so
   it never fights Mantine's base styles. */
/* Inter carries no Ge'ez glyphs, so Noto Sans Ethiopic is loaded alongside it.
   Without it every Amharic string in the app renders in whatever the OS
   happens to substitute — different on Windows, macOS and Android. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Ethiopic:wght@400;500;600;700&display=swap');

:root {
  --ema-surface-light: #f5f8fc;
  --ema-surface-dark: #0e1521;
}

/* ---------------------------------------------------------------------------
   Scrollbars — themed instead of the raw OS default, so a dark page doesn't
   carry a stark white scrollbar (or vice versa). Firefox via scrollbar-color,
   Chrome/Safari/Edge via the ::-webkit-scrollbar-* pseudo-elements. Colors
   come from Mantine's dark palette so they track the active color scheme
   instead of a fixed gray.

   These lived in `apps/portal/src/styles.css`, which nothing ever imported —
   so the portal has been running with unthemed scrollbars while the backoffice
   had these. Moved here, where they load.
   --------------------------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--mantine-color-gray-5) transparent;
}
[data-mantine-color-scheme='dark'] * {
  scrollbar-color: var(--mantine-color-dark-3) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--mantine-color-gray-5);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--mantine-color-gray-6);
}
[data-mantine-color-scheme='dark'] ::-webkit-scrollbar-thumb {
  background-color: var(--mantine-color-dark-3);
}
[data-mantine-color-scheme='dark'] ::-webkit-scrollbar-thumb:hover {
  background-color: var(--mantine-color-dark-2);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tinted app background that adapts to the color scheme. */
[data-mantine-color-scheme='light'] body {
  background-color: var(--ema-surface-light);
}
[data-mantine-color-scheme='dark'] body {
  background-color: var(--ema-surface-dark);
}

[data-mantine-color-scheme] body {
  transition: background-color 200ms ease;
}

/* ---- Motion utilities ---------------------------------------------------- */
@keyframes ema-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ema-page-enter {
  animation: ema-fade-up 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Subtle lift on interactive cards. */
.ema-hover-lift {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}
.ema-hover-lift:hover {
  transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
  .ema-page-enter,
  .ema-hover-lift {
    animation: none;
    transition: none;
  }
}
