﻿/* ==========================================================================
   HayaLink — design tokens
   Copy into the Blazor app's wwwroot (e.g. wwwroot/css/tokens.css).
   Direction: "Firoozeh" — Persian turquoise tilework on cool paper, saffron as
   a rare highlight. One font family (Vazirmatn), RTL first.
   ========================================================================== */

/* --- Font ---------------------------------------------------------------
   Production: put Vazirmatn[wght].woff2 in wwwroot/fonts/ (path below is
   relative to this file at wwwroot/css/). The CDN URL is a fallback so the
   static mockups render without the file; remove it in the app.            */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* --- Color: light ---------------------------------------------------- */
  --color-bg:            #F3F6F6;  /* page */
  --color-surface:       #FFFFFF;  /* cards, inputs */
  --color-surface-2:     #EAF0F0;  /* subtle fills, table head, hover rows */
  --color-border:        #D3DDDE;  /* dividers, card outlines (decorative) */
  --color-border-strong: #7A8D90;  /* input borders: 3.5:1 on surface (non-text >= 3:1) */

  --color-text:          #12232E;  /* 16.1:1 on surface */
  --color-text-muted:    #4C5F67;  /* 6.7:1 on surface */
  --color-text-subtle:   #5A6C73;  /* 5.4:1 on surface, 4.7:1 on surface-2 — placeholders, meta */

  --color-primary:       #0A7570;  /* firoozeh; 5.5:1 on surface, white on it 5.5:1 */
  --color-primary-hover: #075F5B;
  --color-primary-active:#054B48;
  --color-primary-soft:  #DDF1EF;  /* selected rows, soft buttons */
  --color-on-primary:    #FFFFFF;

  --color-accent:        #E8A317;  /* saffron — decoration only, never text on light */
  --color-accent-ink:    #8A5600;  /* saffron when it must be text: 6.2:1 */

  --color-success:       #1B7340;  --color-success-soft: #E3F3E8;
  --color-warning:       #8F5400;  --color-warning-soft: #FDF1D8;
  --color-danger:        #B3261E;  --color-danger-soft:  #FCE9E7;
  --color-on-danger:     #FFFFFF;
  --color-info:          #2A5BB8;  --color-info-soft:    #E6EEFB;

  --color-focus:         #2A5BB8;  /* focus ring, distinct from primary */
  --color-overlay:       rgb(10 25 32 / 0.55);

  /* Hero band (home) — the one bold surface */
  --hero-bg:             #0B3B3E;
  --hero-text:           #F1F7F7;
  --hero-muted:          #B5CFD0;  /* 7.5:1 on hero-bg */
  --hero-pattern:        rgb(255 255 255 / 0.06);

  /* Charts: single-hue (magnitude) */
  --chart-bar:           #0A7570;
  --chart-bar-hover:     #054B48;
  --chart-track:         #E3EAEA;
  --chart-grid:          #E1E8E9;

  /* --- Type ------------------------------------------------------------ */
  --font-sans: "Vazirmatn", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-ltr:  "Vazirmatn", ui-sans-serif, "Segoe UI", Roboto, sans-serif; /* URLs/codes */

  /* Major third (1.25) on 16px */
  --text-xs:   0.8125rem; /* 13 */
  --text-sm:   0.875rem;  /* 14 */
  --text-base: 1rem;      /* 16 */
  --text-md:   1.125rem;  /* 18 */
  --text-lg:   1.25rem;   /* 20 */
  --text-xl:   1.5625rem; /* 25 */
  --text-2xl:  1.9375rem; /* 31 */
  --text-3xl:  2.4375rem; /* 39 */
  --text-4xl:  3.0625rem; /* 49 */

  --leading-tight: 1.35;  /* headings (Persian needs more than Latin) */
  --leading-snug:  1.55;
  --leading-body:  1.85;  /* body copy */

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-bold:    700;
  --weight-black:   850;

  /* --- Spacing (4px grid) --------------------------------------------- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* --- Radius: grows with the size of the thing ----------------------- */
  --radius-xs:   4px;   /* badges, chart bar ends */
  --radius-sm:   8px;   /* buttons, inputs */
  --radius-md:   12px;  /* cards, menus */
  --radius-lg:   20px;  /* hero shortener, modals */
  --radius-pill: 999px;

  /* --- Shadows (tinted with ink, not grey) ---------------------------- */
  --shadow-sm: 0 1px 2px rgb(18 35 46 / 0.06);
  --shadow-md: 0 2px 4px rgb(18 35 46 / 0.04), 0 6px 16px rgb(18 35 46 / 0.07);
  --shadow-lg: 0 8px 16px rgb(18 35 46 / 0.08), 0 24px 56px rgb(18 35 46 / 0.18);

  --focus-ring: 0 0 0 3px var(--color-surface), 0 0 0 5px var(--color-focus);

  /* --- Layout & motion ------------------------------------------------- */
  --container:     72rem;
  --container-sm:  28rem;
  --sidebar-width: 15rem;
  --header-height: 4rem;

  --ease-out:   cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration-1: 120ms;
  --duration-2: 200ms;
  --duration-3: 320ms;

  --z-header: 20;
  --z-menu:   30;
  --z-modal:  40;
  --z-toast:  50;
}

/* --- Color: dark ---------------------------------------------------------
   Selected, not inverted. Applied when the user picks dark
   (data-theme="dark") or the OS prefers dark and the user didn't pick light. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --color-bg:            #0C171B;
  --color-surface:       #13232A;
  --color-surface-2:     #1A2D35;
  --color-border:        #263C45;
  --color-border-strong: #6C8690;  /* 4.2:1 on surface */

  --color-text:          #E3EDEF;  /* 13.5:1 */
  --color-text-muted:    #A3B7BE;  /* 7.7:1 */
  --color-text-subtle:   #8DA3AB;  /* 6.1:1 */

  --color-primary:       #45C4BA;  /* 7.6:1 on surface */
  --color-primary-hover: #6AD3CB;
  --color-primary-active:#8FE0DA;
  --color-primary-soft:  #143B3B;
  --color-on-primary:    #04211F;

  --color-accent:        #F0B43C;
  --color-accent-ink:    #F0B43C;

  --color-success:       #6FCF8F;  --color-success-soft: #15321F;
  --color-warning:       #F2B75B;  --color-warning-soft: #36280F;
  --color-danger:        #FF8F85;  --color-danger-soft:  #3B1A18;
  --color-on-danger:     #2A0705;
  --color-info:          #8DB2FF;  --color-info-soft:    #172A4A;

  --color-focus:         #8DB2FF;
  --color-overlay:       rgb(0 0 0 / 0.65);

  --hero-bg:             #0E2C30;
  --hero-text:           #EAF4F4;
  --hero-muted:          #A9C6C7;
  --hero-pattern:        rgb(255 255 255 / 0.045);

  --chart-bar:           #45C4BA;
  --chart-bar-hover:     #8FE0DA;
  --chart-track:         #1F343C;
  --chart-grid:          #22363E;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-md: 0 2px 6px rgb(0 0 0 / 0.3), 0 8px 20px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 12px 24px rgb(0 0 0 / 0.35), 0 28px 64px rgb(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #0C171B; --color-surface: #13232A; --color-surface-2: #1A2D35;
    --color-border: #263C45; --color-border-strong: #6C8690;
    --color-text: #E3EDEF; --color-text-muted: #A3B7BE; --color-text-subtle: #8DA3AB;
    --color-primary: #45C4BA; --color-primary-hover: #6AD3CB; --color-primary-active: #8FE0DA;
    --color-primary-soft: #143B3B; --color-on-primary: #04211F;
    --color-accent: #F0B43C; --color-accent-ink: #F0B43C;
    --color-success: #6FCF8F; --color-success-soft: #15321F;
    --color-warning: #F2B75B; --color-warning-soft: #36280F;
    --color-danger: #FF8F85; --color-danger-soft: #3B1A18; --color-on-danger: #2A0705;
    --color-info: #8DB2FF; --color-info-soft: #172A4A;
    --color-focus: #8DB2FF; --color-overlay: rgb(0 0 0 / 0.65);
    --hero-bg: #0E2C30; --hero-text: #EAF4F4; --hero-muted: #A9C6C7; --hero-pattern: rgb(255 255 255 / 0.045);
    --chart-bar: #45C4BA; --chart-bar-hover: #8FE0DA; --chart-track: #1F343C; --chart-grid: #22363E;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-md: 0 2px 6px rgb(0 0 0 / 0.3), 0 8px 20px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 12px 24px rgb(0 0 0 / 0.35), 0 28px 64px rgb(0 0 0 / 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-1: 0ms; --duration-2: 0ms; --duration-3: 0ms; }
}
