/* BigFood Platform — Chainlit App Theme
   Applicato all'app Chainlit diretta a :8001 (NON al copilot embedded in BigFood).
   Per il copilot embedded, gli stili vengono iniettati nel Shadow DOM
   da base.html tramite _injectShadowStyles().

   Nota: Chainlit legge le CSS custom properties da #cl-shadow-root, non da :root.
   I selettori includono entrambi per massima compatibilità.
   Il theming principale è gestito da theme.json; questo file gestisce font e overrides.
*/

/* Font BigFood */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Light mode ──
   Selettori doppi: :root per standard CSS, #cl-shadow-root per Chainlit interno */
:root,
#cl-shadow-root:not(.dark) {
    /* Colori primari — teal BigFood #40916C */
    --primary: 153 38% 41%;
    --primary-foreground: 0 0% 100%;
    --ring: 153 38% 41%;

    /* Sfondi e carte */
    --background: 0 0% 100%;
    --foreground: 222 47% 11%;
    --card: 0 0% 100%;
    --card-foreground: 222 47% 11%;
    --popover: 0 0% 100%;
    --popover-foreground: 222 47% 11%;

    /* Secondari e toni neutri */
    --secondary: 210 40% 96%;
    --secondary-foreground: 222 47% 11%;
    --muted: 210 40% 96%;
    --muted-foreground: 215 16% 47%;   /* warm gray #64748b */
    --accent: 210 40% 96%;
    --accent-foreground: 222 47% 11%;

    /* Bordi e input */
    --border: 214 32% 91%;             /* #e2e8f0 */
    --input: 214 32% 91%;

    /* Distruttivo — rust BigFood #C44536 */
    --destructive: 5 58% 45%;

    /* Raggio angoli */
    --radius: 0.5rem;
}

/* ── Dark mode ── */
.dark,
#cl-shadow-root.dark {
    /* Colori primari — teal brillante dark #52B788 */
    --primary: 152 41% 52%;
    --primary-foreground: 0 0% 100%;
    --ring: 152 41% 52%;

    /* Sfondi — navy profondo BigFood */
    --background: 220 32% 16%;         /* #1a2332 */
    --foreground: 214 32% 95%;         /* #f1f5f9 */
    --card: 220 20% 20%;               /* #252d3a */
    --card-foreground: 214 32% 95%;
    --popover: 220 20% 20%;
    --popover-foreground: 214 32% 95%;

    /* Secondari e toni neutri */
    --secondary: 215 25% 27%;
    --secondary-foreground: 214 32% 95%;
    --muted: 215 25% 27%;
    --muted-foreground: 215 20% 65%;   /* #94a3b8 */
    --accent: 215 25% 27%;
    --accent-foreground: 214 32% 95%;

    /* Bordi e input */
    --border: 215 25% 30%;             /* #3d4f66 */
    --input: 220 32% 18%;              /* #1e2a3b */

    /* Distruttivo — rust chiaro dark #E07A5F */
    --destructive: 10 54% 62%;
}
