/* ============================================================
   DELYAR DESIGN TOKENS
   Emotional calm UX — warm cream, rose terracotta, sage green
   All CSS custom properties used throughout the component tree
   ============================================================ */

:root {

  /* ── COLORS: Brand Rose ─────────────────────────────── */
  --color-rose-50:   #FEF8F5;
  --color-rose-100:  #FDF0EB;
  --color-rose-200:  #F5D9CC;
  --color-rose-400:  #E8B59A;
  --color-rose-500:  #D49478;
  --color-rose-600:  #C47B5A;   /* Primary brand */
  --color-rose-700:  #A05A3E;

  /* ── COLORS: Sage (all is well) ─────────────────────── */
  --color-sage-100:  #EAF3EB;
  --color-sage-200:  #D4E8D5;
  --color-sage-400:  #A3C7A6;
  --color-sage-600:  #5E9063;   /* Success / okay */
  --color-sage-700:  #4A7A4E;

  /* ── COLORS: Amber (attentive) ──────────────────────── */
  --color-amber-100: #FEF3E2;
  --color-amber-200: #FAE0B5;
  --color-amber-400: #F0BB7A;
  --color-amber-600: #D4780E;
  --color-amber-700: #B5620A;

  /* ── COLORS: Emergency (warm rose, not alarm red) ───── */
  --color-emergency-50:  #FFF5F6;
  --color-emergency-100: #FDF0F1;
  --color-emergency-200: #F5CDD1;
  --color-emergency-400: #E09AA2;
  --color-emergency-600: #C0404A;   /* Emergency primary */
  --color-emergency-700: #A8202E;

  /* ── COLORS: Neutrals (warm-tinted, never cold) ─────── */
  --color-neutral-50:  #F7F2ED;
  --color-neutral-100: #EDE5DC;
  --color-neutral-200: #D9CEC5;
  --color-neutral-300: #C4B5A8;
  --color-neutral-400: #A8988A;
  --color-neutral-500: #8C7060;
  --color-neutral-700: #5C4A38;
  --color-neutral-900: #2D2416;

  /* ── COLORS: Backgrounds ────────────────────────────── */
  --color-bg-canvas:   #FDF6EE;   /* Warm cream — main page background */
  --color-bg-surface:  #FFFFFF;   /* Card surfaces */
  --color-bg-sunken:   #F5EDE3;   /* Input fields, inner containers */
  --color-bg-sidebar:  #FAF3EC;   /* Sidebar — slightly warmer than canvas */

  /* ── COLORS: Semantic ────────────────────────────────── */
  --color-text-primary:     var(--color-neutral-900);
  --color-text-secondary:   var(--color-neutral-700);
  --color-text-tertiary:    var(--color-neutral-500);
  --color-text-placeholder: var(--color-neutral-400);
  --color-text-on-rose:     #FFFFFF;
  --color-text-link:        var(--color-rose-700);
  --color-interactive:      var(--color-rose-600);
  --color-border-default:   var(--color-neutral-200);
  --color-border-focus:     var(--color-rose-400);
  --color-border-sidebar:   var(--color-neutral-200);

  /* ── TYPOGRAPHY ──────────────────────────────────────── */
  --font-persian:    'Vazirmatn', 'Tahoma', sans-serif;
  --font-latin:      'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body:       var(--font-persian);

  --text-xs:   0.75rem;     /* 12px */
  --text-sm:   0.875rem;    /* 14px */
  --text-base: 1rem;        /* 16px — body */
  --text-md:   1.125rem;    /* 18px */
  --text-lg:   1.25rem;     /* 20px */
  --text-xl:   1.5rem;      /* 24px */
  --text-2xl:  1.875rem;    /* 30px */
  --text-3xl:  2.25rem;     /* 36px */

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;

  --leading-tight:   1.2;
  --leading-snug:    1.4;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;
  --leading-loose:   2.0;

  /* ── SPACING (4px base) ──────────────────────────────── */
  --space-1:  0.25rem;    /*  4px */
  --space-2:  0.5rem;     /*  8px */
  --space-3:  0.75rem;    /* 12px */
  --space-4:  1rem;       /* 16px */
  --space-5:  1.25rem;    /* 20px */
  --space-6:  1.5rem;     /* 24px */
  --space-8:  2rem;       /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */

  /* ── BORDER RADIUS ───────────────────────────────────── */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;    /* Standard card radius */
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-3xl:  32px;
  --radius-full: 9999px;

  /* ── SHADOWS (warm-tinted) ───────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(45, 28, 14, 0.06);
  --shadow-sm: 0 2px 8px rgba(45, 28, 14, 0.08);
  --shadow-md: 0 4px 16px rgba(45, 28, 14, 0.10);
  --shadow-lg: 0 8px 24px rgba(45, 28, 14, 0.12);
  --shadow-xl: 0 16px 48px rgba(45, 28, 14, 0.14);

  /* ── ANIMATION ───────────────────────────────────────── */
  --duration-instant:  80ms;
  --duration-fast:    150ms;
  --duration-normal:  220ms;
  --duration-relaxed: 350ms;
  --duration-slow:    500ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-enter:    cubic-bezier(0, 0, 0.2, 1);
  --ease-exit:     cubic-bezier(0.4, 0, 1, 1);

  /* ── RESPONSIVE LAYOUT ───────────────────────────────── */

  /* Breakpoints (reference only — use in media queries) */
  /* --bp-sm:  480px  - large phones                      */
  /* --bp-md:  768px  - tablets (sidebar appears)         */
  /* --bp-lg:  1024px - desktop                           */
  /* --bp-xl:  1280px - large desktop                     */

  /* Navigation heights */
  --nav-height-top:    56px;
  --nav-height-bottom: 64px;    /* Mobile bottom nav */

  /* Sidebar */
  --sidebar-width: 240px;

  /* Content max-widths — for comfortable reading, not full-screen stretching */
  --content-max-width: 960px;   /* Main content reading width */
  --page-max-width: 1280px;     /* Absolute page cap */

  /* Responsive page padding (fluid via clamp) */
  --page-padding-x: clamp(1rem, 4vw, 3rem);

  /* Z-index scale */
  --z-sidebar:   50;
  --z-top-bar:  100;
  --z-bottom-nav: 100;
  --z-modal:    200;
  --z-toast:    300;
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
