/* AnimalPin — Light / Dark theme tokens
 *
 * Every brand colour is a CSS variable (as "R G B" so Tailwind opacity
 * modifiers like bg-sage/20 keep working). Light values are the original
 * palette, so light mode looks exactly as before.
 *
 * Dark mode rule (founder's spec):
 *   white  -> green        green -> white & gray
 *   cream  -> lighter green (cards stand out from the background)
 *   orange & gray stay untouched
 */
:root {
  --ap-alabaster: 250 250 250;   /* #FAFAFA  white surfaces / white text      */
  --ap-charcoal: 6 72 65;        /* #064841  dark green text & dark buttons    */
  --ap-slate: 6 72 65;           /* #064841  muted text                        */
  --ap-sage: 8 126 112;          /* #087E70  brand green                       */
  --ap-sand: 245 233 215;        /* #F5E9D7  cream cards & page background     */
  --ap-border: 211 211 211;      /* #D3D3D3  gray borders (unchanged in dark)  */
  --ap-mint: 101 200 150;        /* #65C896  light green accent                */
  --ap-terracotta: 224 122 95;   /* #E07A5F  orange (unchanged in dark)        */
  --ap-peach: 235 128 80;        /* #EB8050  orange (unchanged in dark)        */
  --ap-overlay: 6 72 65;         /* modal backdrops                            */
  color-scheme: light;
}

html.dark {
  --ap-alabaster: 6 72 65;       /* white  -> dark green #064841               */
  --ap-charcoal: 241 245 244;    /* green  -> white #F1F5F4                    */
  --ap-slate: 201 211 209;       /* green  -> gray #C9D3D1                     */
  --ap-sage: 221 229 227;        /* green  -> light gray #DDE5E3               */
  --ap-sand: 11 90 80;           /* cream  -> lighter green #0B5A50            */
  --ap-overlay: 2 24 21;         /* backdrops stay dark                        */
  color-scheme: dark;
}

/* Modal backdrops use the dark-green text colour with opacity; in dark mode that
   colour is white, so keep backdrops dark explicitly. */
html.dark .bg-charcoal\/40 { background-color: rgb(var(--ap-overlay) / 0.55) !important; }
html.dark .bg-charcoal\/50 { background-color: rgb(var(--ap-overlay) / 0.6) !important; }
html.dark .bg-charcoal\/60 { background-color: rgb(var(--ap-overlay) / 0.7) !important; }
html.dark .bg-charcoal\/65 { background-color: rgb(var(--ap-overlay) / 0.72) !important; }
html.dark .bg-charcoal\/70 { background-color: rgb(var(--ap-overlay) / 0.75) !important; }
html.dark .bg-charcoal\/80 { background-color: rgb(var(--ap-overlay) / 0.82) !important; }

/* A second cream shade used in a few places */
html.dark .bg-\[\#f2efe9\] { background-color: rgb(var(--ap-sand)) !important; }
html.dark .bg-\[\#F7FAF9\] { background-color: rgb(var(--ap-alabaster)) !important; }

/* Form fields: placeholder and native controls */
html.dark input::placeholder,
html.dark textarea::placeholder { color: rgb(var(--ap-slate) / 0.7); }
html.dark select option { background-color: rgb(var(--ap-alabaster)); color: rgb(var(--ap-charcoal)); }

/* Smooth switch between themes */
html.theme-anim, html.theme-anim * {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease !important;
}
