/**
 * Srijonshil Gaibandha NGO - Centralized Design Tokens & Foundation System
 * File: assets/css/tokens.css
 * Phase: Phase 1 (Design Token System & Asset Architecture)
 * Target Environment: LAMP / cPanel Shared Hosting (PHP 8.1+)
 * 
 * Rules:
 * 1. Mandatory brand colors: #2FA84F, #E11D48, #148F41, #FFFFFF
 * 2. Non-destructive: purely additive, zero breaking overrides on existing pages.
 */

:root {
  /* ==========================================================================
     1. MANDATORY BRAND COLOR SYSTEM (Exact Approved Hex Codes)
     ========================================================================== */
  --brand-green: #2FA84F;           /* Primary brand green: accents, badges, highlights */
  --brand-red: #E11D48;             /* Highlight red: donate CTA, urgent indicators, active markers */
  --brand-dark-green: #148F41;      /* Dark green: navbar brand text, headings, dark surfaces */
  --brand-white: #FFFFFF;           /* Pure white: card backgrounds, contrast text */

  /* Aliases for semantic clarity */
  --brand-primary: var(--brand-green);
  --brand-accent: var(--brand-red);
  --brand-highlight: var(--brand-red);
  --brand-dark: var(--brand-dark-green);

  /* Paired Brand Shades & Gradients */
  --brand-crimson: #c81e3d;         /* Paired with #E11D48 in donation/hero gradients */
  --brand-forest: #0d6e2a;          /* Paired with #148F41 in footer top gradient */
  --brand-forest-dark: #0a3d1f;     /* Footer copyright bottom banner */
  --brand-surface-tint: #f8fff9;    /* Light green surface tint for dropdowns/cards */

  /* RGB Components (for rgba opacity calculations) */
  --brand-green-rgb: 47, 168, 79;
  --brand-red-rgb: 225, 29, 72;
  --brand-dark-green-rgb: 20, 143, 65;
  --brand-white-rgb: 255, 255, 255;

  /* ==========================================================================
     2. FUNCTIONAL & SEMANTIC STATUS COLORS
     ========================================================================== */
  --color-success: #148F41;
  --color-success-bg: rgba(47, 168, 79, 0.1);
  --color-danger: #E11D48;
  --color-danger-bg: rgba(225, 29, 72, 0.1);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.1);
  --color-info: #0284c7;
  --color-info-bg: rgba(2, 132, 199, 0.1);

  /* ==========================================================================
     3. NEUTRAL SURFACES & TEXT PALETTE
     ========================================================================== */
  --text-primary: #1e293b;          /* Primary body & heading text */
  --text-secondary: #475569;        /* Subtitles, meta info, descriptions */
  --text-muted: #64748b;            /* Timestamps, secondary notes */
  --text-inverse: #ffffff;          /* White text on dark/colored backgrounds */
  
  --bg-page: #f8fafc;               /* Page base background */
  --bg-surface: #ffffff;            /* Card & container surfaces */
  --bg-surface-elevated: #ffffff;   /* Dropdown & modal surfaces */
  --bg-surface-alt: #f1f5f9;        /* Table headers, tag backgrounds */
  
  --border-color: #e2e8f0;          /* Standard structural border */
  --border-subtle: rgba(47, 168, 79, 0.15); /* Brand-tinted subtle border */
  --border-strong: #cbd5e1;         /* Input borders, active separators */

  /* ==========================================================================
     4. TYPOGRAPHY SYSTEM
     ========================================================================== */
  --font-body: 'Poppins', 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Montserrat', 'Hind Siliguri', 'Noto Sans Bengali', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-bengali: 'Hind Siliguri', 'Noto Sans Bengali', 'SolaimanLipi', 'Kalpurush', sans-serif;
  --font-brand: 'Montserrat', 'Segoe UI', sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Font Weights */
  --fw-light: 300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Font Size Scale */
  --fs-xs: 0.75rem;     /* 12px */
  --fs-sm: 0.875rem;    /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md: 1.125rem;    /* 18px */
  --fs-lg: 1.25rem;     /* 20px */
  --fs-xl: 1.5rem;      /* 24px */
  --fs-2xl: 1.875rem;   /* 30px */
  --fs-3xl: 2.25rem;    /* 36px */
  --fs-4xl: 3rem;       /* 48px */

  /* Line Heights */
  --lh-tight: 1.25;
  --lh-snug: 1.375;
  --lh-normal: 1.5;
  --lh-relaxed: 1.625;
  --lh-loose: 2;

  /* ==========================================================================
     5. SPACING SCALE (8-Point Grid System)
     ========================================================================== */
  --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.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 */

  /* ==========================================================================
     6. CONTAINER & LAYOUT DIMENSIONS
     ========================================================================== */
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
  --container-xxl: 1320px;
  --header-height: 80px;

  /* ==========================================================================
     7. BORDER RADIUS SCALE
     ========================================================================== */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 50px;
  --radius-circle: 50%;

  /* ==========================================================================
     8. ELEVATION & SHADOW TOKENS
     ========================================================================== */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
  --shadow-brand-green: 0 6px 20px rgba(47, 168, 79, 0.25);
  --shadow-brand-red: 0 6px 20px rgba(225, 29, 72, 0.3);

  /* ==========================================================================
     9. TRANSITIONS & FOCUS STATES
     ========================================================================== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  --focus-ring: 0 0 0 3px rgba(47, 168, 79, 0.35);
  --focus-ring-red: 0 0 0 3px rgba(225, 29, 72, 0.35);

  /* ==========================================================================
     10. BREAKPOINTS (Reference Tokens)
     ========================================================================== */
  --bp-xs: 400px;
  --bp-sm: 576px;
  --bp-md: 768px;
  --bp-lg: 992px;
  --bp-xl: 1200px;
  --bp-xxl: 1400px;

  /* ==========================================================================
     11. DOCUMENTED LEGACY / INCONSISTENT VALUES (Preserved for compatibility)
     ========================================================================== */
  --legacy-bootstrap-blue: #007bff;
  --legacy-bootstrap-dark-blue: #0d6efd;
  --legacy-cyan: #00c6ff;
  --legacy-green: #007C00;
}

/* ==========================================================================
   FOUNDATION UTILITY CLASSES (Non-destructive, additive only)
   ========================================================================== */

/* Brand Color Utility Helpers */
.text-brand-green { color: var(--brand-green) !important; }
.text-brand-red { color: var(--brand-red) !important; }
.text-brand-dark { color: var(--brand-dark-green) !important; }

.bg-brand-green { background-color: var(--brand-green) !important; color: var(--brand-white) !important; }
.bg-brand-red { background-color: var(--brand-red) !important; color: var(--brand-white) !important; }
.bg-brand-dark { background-color: var(--brand-dark-green) !important; color: var(--brand-white) !important; }

.border-brand-green { border-color: var(--brand-green) !important; }
.border-brand-red { border-color: var(--brand-red) !important; }

/* Accessible Focus Utility */
.brand-focus:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.brand-focus-red:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-red);
}
