/* ============================================
   GeniusPay Design System - CSS Variables
   ============================================ */

:root {
  /* ============================================
     Color Palette - Primary (White/Black Theme)
     ============================================ */
  --color-primary: #000000;
  --color-primary-dark: #000000;
  --color-primary-light: #333333;
  
  --color-primary-50: #f5f5f5;
  --color-primary-100: #e0e0e0;
  --color-primary-200: #bdbdbd;
  --color-primary-300: #9e9e9e;
  --color-primary-400: #757575;
  --color-primary-500: #616161;
  --color-primary-600: #424242;
  --color-primary-700: #212121;
  --color-primary-800: #0a0a0a;
  --color-primary-900: #000000;

  /* ============================================
     Color Palette - Grayscale (White/Black Theme)
     ============================================ */
  --color-gray-50: #fafafa;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #eeeeee;
  --color-gray-300: #e0e0e0;
  --color-gray-400: #bdbdbd;
  --color-gray-500: #9e9e9e;
  --color-gray-600: #757575;
  --color-gray-700: #616161;
  --color-gray-800: #424242;
  --color-gray-900: #212121;

  --color-secondary: var(--color-gray-600);
  --color-secondary-dark: var(--color-gray-700);
  --color-secondary-light: var(--color-gray-500);

  /* ============================================
     Color Palette - Semantic Colors (Monochrome with subtle tones)
     ============================================ */
  --color-success: #2d5016;
  --color-success-light: #4a7c2a;
  --color-success-dark: #1a3009;
  --color-success-bg: #e8f5e0;

  --color-warning: #756012;
  --color-warning-light: #9a7d18;
  --color-warning-dark: #4d3f0c;
  --color-warning-bg: #f5f0d8;

  --color-danger: #8b0000;
  --color-danger-light: #b30000;
  --color-danger-dark: #660000;
  --color-danger-bg: #ffe5e5;

  --color-info: #004d66;
  --color-info-light: #006699;
  --color-info-dark: #003344;
  --color-info-bg: #e0f2f5;

  /* ============================================
     RGB triplets for the same six colours.

     Bootstrap's .bg-* utilities are opacity-aware - they paint
     rgba(var(--bs-*-rgb), var(--bs-bg-opacity)) so that .bg-opacity-10 yields a 10% TINT.
     components.css overrides those utilities with the palette above, and an override written
     against a flat hex cannot express opacity, which silently made every .bg-opacity-* class in
     the portal inert. Thirty-six usages asking for a tint were painted at 100%: that is what
     turned the SuperAdmin stat cards into solid black/green/olive blocks and put #000000 text on
     a #000000 card (a 1.00:1 contrast ratio - an invisible number).

     KEEP THESE IN SYNC with the hex values above -
     tests/GeniusPay.Core.Api.Tests/UI/BackgroundOpacityUtilityTests.cs fails if they drift.
     ============================================ */
  --color-primary-rgb: 0, 0, 0;          /* #000000 */
  --color-secondary-rgb: 117, 117, 117;  /* #757575 - var(--color-gray-600) */
  --color-success-rgb: 45, 80, 22;       /* #2d5016 */
  --color-warning-rgb: 117, 96, 18;      /* #756012 */
  --color-danger-rgb: 139, 0, 0;         /* #8b0000 */
  --color-info-rgb: 0, 77, 102;          /* #004d66 */

  /* ============================================
     Background Colors (White/Black Theme)
     ============================================ */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  
  --bg-sidebar: #000000;
  --bg-sidebar-dark: #0a0a0a;
  --bg-sidebar-header: rgba(0, 0, 0, 0.3);
  
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --bg-hover: rgba(255, 255, 255, 0.1);
  --bg-active: rgba(255, 255, 255, 0.15);

  /* ============================================
     Text Colors (White/Black Theme)
     ============================================ */
  --text-primary: #000000;
  --text-secondary: var(--color-gray-700);
  --text-tertiary: var(--color-gray-600);
  --text-muted: var(--color-gray-500);
  --text-inverse: #ffffff;
  --text-sidebar: #ffffff;
  --text-sidebar-muted: rgba(255, 255, 255, 0.7);

  /* ============================================
     Border Colors (White/Black Theme)
     ============================================ */
  --border-color: #e0e0e0;
  --border-color-light: #f5f5f5;
  --border-color-dark: #bdbdbd;
  --border-sidebar: rgba(255, 255, 255, 0.15);

  /* ============================================
     Typography
     ============================================ */
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

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

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* ============================================
     Spacing Scale
     ============================================ */
  --spacing-0: 0;
  --spacing-1: 0.25rem;   /* 4px */
  --spacing-2: 0.5rem;    /* 8px */
  --spacing-3: 0.75rem;   /* 12px */
  --spacing-4: 1rem;      /* 16px */
  --spacing-5: 1.25rem;   /* 20px */
  --spacing-6: 1.5rem;    /* 24px */
  --spacing-8: 2rem;      /* 32px */
  --spacing-10: 2.5rem;   /* 40px */
  --spacing-12: 3rem;     /* 48px */
  --spacing-16: 4rem;     /* 64px */
  --spacing-20: 5rem;     /* 80px */

  /* ============================================
     Border Radius
     ============================================ */
  --radius-none: 0;
  --radius-sm: 0.25rem;   /* 4px */
  --radius-base: 0.375rem; /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* ============================================
     Shadows (Elevation System)
     ============================================ */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* ============================================
     Transitions
     ============================================ */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ============================================
     Breakpoints
     ============================================ */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ============================================
     Z-Index Scale
     ============================================ */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* ============================================
     Sidebar
     ============================================ */
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 80px;
  --sidebar-header-height: 80px;
  --nav-item-height: 48px;
  --nav-item-padding-x: var(--spacing-6);
  --nav-item-padding-y: var(--spacing-3);

  /* ============================================
     Header
     ============================================ */
  --header-height: 64px;
  --header-bg: var(--bg-primary);
  --header-shadow: var(--shadow-sm);

  /* ============================================
     Content
     ============================================ */
  --content-padding: var(--spacing-6);
  --content-max-width: 1400px;

  /* ============================================
     Focus Ring (UI-10)
     A visible focus indicator is mandatory. base.css already applies *:focus-visible globally;
     these tokens keep every bespoke control (drag handle, chip, toast close) on the same ring.
     ============================================ */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --focus-ring-color: var(--color-primary);
  --focus-ring-color-inverse: #ffffff;

  /* ============================================
     Grid Density and Typography (UI-4)
     ============================================ */
  --row-height-compact: 40px;
  --row-height-comfortable: 52px;
  --variant-indent: var(--spacing-6);
  --variant-rule-width: 3px;

  /* ============================================
     Stock Badge (UI-4 / UI-10)
     Semantic aliases over the EXISTING palette - no new colours are introduced. The badge always
     renders a number and a text label as well, so colour is never the sole carrier of meaning.
     ============================================ */
  --stock-zero-bg: var(--color-gray-200);
  --stock-zero-text: var(--text-tertiary);
  --stock-low-bg: var(--color-warning-bg);
  --stock-low-text: var(--color-warning-dark);
  --stock-ok-bg: var(--color-success-bg);
  --stock-ok-text: var(--color-success-dark);

  /* ============================================
     Drag and Drop (UI-3)
     ============================================ */
  --drop-indicator-color: var(--color-primary);
  --drop-indicator-width: 2px;
  --drag-ghost-opacity: 0.45;

  /* ============================================
     Category Rail (UI-2 / UI-9)
     The rail collapses to a horizontal chip scroller under 900px. That breakpoint lives in the
     media queries in components.css - a custom property cannot be used inside @media.
     ============================================ */
  --rail-width: 260px;
  --rail-chip-height: 40px;

  /* ============================================
     Toast (UI-1)
     Above --z-modal (1050) so a failure raised while a dialog is open is still visible.
     ============================================ */
  --z-toast: 1080;
  --toast-width: 360px;
}

/* ============================================
   Dark Theme Support (Future)
   ============================================ */
@media (prefers-color-scheme: dark) {
  /* Future dark mode implementation */
}
