/**
 * CountWize Design Tokens
 * ========================
 * Single source of truth for all design values.
 * DO NOT use hardcoded values - always reference these tokens.
 *
 * Usage: var(--token-name)
 * Example: font-size: var(--font-base);
 *
 * Created: 2026-01-08
 * Phase: V3 Design Polish
 */

:root {
  /* ========================================
     TYPOGRAPHY SCALE
     Base: 16px, Ratio: 1.25 (Major Third)
     ======================================== */
  --font-xs: 0.75rem;      /* 12px - captions, labels */
  --font-sm: 0.875rem;     /* 14px - secondary text */
  --font-base: 1rem;       /* 16px - body text */
  --font-md: 1.25rem;      /* 20px - lead paragraphs */
  --font-lg: 1.5rem;       /* 24px - h4, large text */
  --font-xl: 2rem;         /* 32px - h3 */
  --font-2xl: 2.5rem;      /* 40px - h2 */
  --font-3xl: 3rem;        /* 48px - h1 tablet */
  --font-4xl: 3.75rem;     /* 60px - h1 desktop */

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.2;    /* headings */
  --leading-snug: 1.375;   /* subheadings */
  --leading-normal: 1.5;   /* body text */
  --leading-relaxed: 1.625;
  --leading-loose: 1.8;    /* large body text */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;

  /* ========================================
     SPACING SCALE
     Base: 4px (0.25rem)
     ======================================== */
  --space-0: 0;
  --space-1: 0.25rem;      /* 4px */
  --space-2: 0.5rem;       /* 8px */
  --space-3: 0.75rem;      /* 12px */
  --space-4: 1rem;         /* 16px */
  --space-5: 1.5rem;       /* 24px */
  --space-6: 2rem;         /* 32px */
  --space-7: 2.5rem;       /* 40px */
  --space-8: 3rem;         /* 48px */
  --space-9: 4rem;         /* 64px */
  --space-10: 5rem;        /* 80px */
  --space-11: 6rem;        /* 96px */
  --space-12: 8rem;        /* 128px */

  /* ========================================
     COLORS - BRAND
     ======================================== */
  /* Primary Green */
  --color-primary: #34D399;
  --color-primary-light: #6EE7B7;
  --color-primary-dark: #059669;
  --color-primary-muted: #aec3b0;

  /* Primary with opacity (for borders, overlays) */
  --color-primary-10: rgba(52, 211, 153, 0.1);
  --color-primary-20: rgba(52, 211, 153, 0.2);
  --color-primary-30: rgba(52, 211, 153, 0.3);

  /* ========================================
     COLORS - BACKGROUNDS
     ======================================== */
  --color-bg-base: #050b0c;        /* Darkest - body background */
  --color-bg-elevated: #0a1214;    /* Cards, elevated surfaces */
  --color-bg-surface: #121a1c;     /* Inputs, interactive areas */
  --color-bg-overlay: rgba(5, 11, 12, 0.95);  /* Modal backdrops */
  --color-bg-hover: rgba(163, 220, 173, 0.08); /* Subtle hover */

  /* ========================================
     COLORS - TEXT
     ======================================== */
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.7);
  --color-text-muted: rgba(255, 255, 255, 0.5);
  --color-text-disabled: rgba(255, 255, 255, 0.3);
  --color-text-inverse: #050b0c;   /* Text on light backgrounds */

  /* ========================================
     COLORS - BORDERS
     ======================================== */
  --color-border-default: rgba(163, 220, 173, 0.2);
  --color-border-hover: rgba(163, 220, 173, 0.4);
  --color-border-focus: rgba(163, 220, 173, 0.6);
  --color-border-subtle: rgba(255, 255, 255, 0.1);

  /* ========================================
     COLORS - STATE
     ======================================== */
  --color-error: #ef4444;
  --color-error-light: #fca5a5;
  --color-error-bg: rgba(239, 68, 68, 0.1);

  --color-success: #22c55e;
  --color-success-light: #86efac;
  --color-success-bg: rgba(34, 197, 94, 0.1);

  --color-warning: #f59e0b;
  --color-warning-light: #fcd34d;
  --color-warning-bg: rgba(245, 158, 11, 0.1);

  --color-info: #3b82f6;
  --color-info-light: #93c5fd;
  --color-info-bg: rgba(59, 130, 246, 0.1);

  /* ========================================
     BORDER RADIUS
     ======================================== */
  --radius-none: 0;
  --radius-sm: 4px;        /* Small buttons, tags */
  --radius-md: 8px;        /* Buttons, inputs */
  --radius-lg: 12px;       /* Cards */
  --radius-xl: 16px;       /* Large cards, modals */
  --radius-2xl: 24px;      /* Hero sections */
  --radius-full: 9999px;   /* Pills, avatars */

  /* ========================================
     SHADOWS
     ======================================== */
  --shadow-none: none;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.25);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.3);

  /* Glow shadows (for hover states) */
  --shadow-glow-sm: 0 0 12px rgba(52, 211, 153, 0.2);
  --shadow-glow-md: 0 0 20px rgba(52, 211, 153, 0.3);
  --shadow-glow-lg: 0 0 32px rgba(52, 211, 153, 0.4);

  /* ========================================
     TRANSITIONS
     ======================================== */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-slower: 600ms ease;

  /* Easing functions */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ========================================
     Z-INDEX SCALE
     ======================================== */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 500;
  --z-fixed: 1000;
  --z-modal-backdrop: 1500;
  --z-modal: 2000;
  --z-popover: 2500;
  --z-tooltip: 3000;
  --z-toast: 9000;
  --z-max: 9999;

  /* ========================================
     COMPONENT TOKENS
     ======================================== */
  /* Buttons */
  --btn-height-sm: 32px;
  --btn-height-md: 40px;
  --btn-height-lg: 48px;
  --btn-padding-sm: var(--space-2) var(--space-4);
  --btn-padding-md: var(--space-3) var(--space-5);
  --btn-padding-lg: var(--space-4) var(--space-6);

  /* Inputs */
  --input-height: 44px;
  --input-padding: var(--space-3) var(--space-4);
  --input-border-width: 1px;

  /* Cards */
  --card-padding: var(--space-5);
  --card-padding-lg: var(--space-6);

  /* Section */
  --section-padding-desktop: var(--space-10);
  --section-padding-tablet: var(--space-9);
  --section-padding-mobile: var(--space-8);

  /* ========================================
     BREAKPOINTS (for reference)
     CSS can't use variables in media queries,
     but documenting here for consistency.
     ======================================== */
  /*
  --breakpoint-sm: 480px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  */

  /* ========================================
     ACCESSIBILITY
     ======================================== */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring-color: var(--color-primary);
  --min-touch-target: 44px;
}

/* ========================================
   DARK MODE DEFAULTS (already dark site)
   ======================================== */
/* No light mode needed - site is dark by design */

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
    --transition-slower: 0ms;
  }
}
