/**
 * Design System - CSS Custom Properties
 * Pricetag.co.za - Dark Theme (Evetech-inspired)
 *
 * Global tokens defined once, used everywhere.
 */

:root {
  /* =========================================================================
     COLOR PALETTE - DARK THEME
     ========================================================================= */

  /* Primary - Burgundy/Maroon */
  --color-primary-50: #fdf2f2;
  --color-primary-100: #fce4e4;
  --color-primary-200: #fbd5d5;
  --color-primary-300: #f5a3a3;
  --color-primary-400: #ee6b6b;
  --color-primary-500: #8B2B2B;
  --color-primary-600: #7a2424;
  --color-primary-700: #651e1e;
  --color-primary-800: #541919;
  --color-primary-900: #471515;
  --color-primary: var(--color-primary-500);

  /* Accent - Pink/Magenta (for highlights) */
  --color-accent-50: #fdf2f8;
  --color-accent-100: #fce7f3;
  --color-accent-200: #fbcfe8;
  --color-accent-300: #f9a8d4;
  --color-accent-400: #f472b6;
  --color-accent-500: #ec4899;
  --color-accent-600: #db2777;
  --color-accent-700: #be185d;
  --color-accent: var(--color-accent-500);

  /* Secondary - Deep Red */
  --color-secondary-500: #991b1b;
  --color-secondary-600: #7f1d1d;
  --color-secondary-700: #450a0a;
  --color-secondary: var(--color-secondary-500);

  /* Success - Green */
  --color-success-50: #f0fdf4;
  --color-success-100: #dcfce7;
  --color-success-500: #22c55e;
  --color-success-600: #16a34a;
  --color-success-700: #15803d;
  --color-success: var(--color-success-500);

  /* Warning - Orange/Amber */
  --color-warning-50: #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;
  --color-warning: var(--color-warning-500);

  /* Danger - Red */
  --color-danger-50: #fef2f2;
  --color-danger-100: #fee2e2;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;
  --color-danger-700: #b91c1c;
  --color-danger: var(--color-danger-500);

  /* Dark Theme Neutrals */
  --color-neutral-0: #ffffff;
  --color-neutral-50: #fafafa;
  --color-neutral-100: #f4f4f5;
  --color-neutral-200: #e4e4e7;
  --color-neutral-300: #d4d4d8;
  --color-neutral-400: #a1a1aa;
  --color-neutral-500: #71717a;
  --color-neutral-600: #52525b;
  --color-neutral-700: #3f3f46;
  --color-neutral-800: #27272a;
  --color-neutral-900: #18181b;
  --color-neutral-950: #09090b;

  /* Dark Theme Semantic colors */
  --color-text: #ffffff;
  --color-text-secondary: #b0b0b8;
  --color-text-muted: #808088;
  --color-text-light: #606068;
  --color-text-inverse: #1a1a1f;
  --color-text-link: var(--color-accent-500);

  /* Charcoal backgrounds - warmer than pure black */
  --color-background: #1e1e24;
  --color-background-secondary: #252530;
  --color-background-alt: #2e2e38;
  --color-background-elevated: #36363f;
  --color-background-hover: #404048;
  --color-background-input: #282832;

  --color-border: #3a3a44;
  --color-border-light: #32323c;
  --color-border-focus: var(--color-primary);

  /* Card backgrounds with subtle gradients */
  --color-card-bg: linear-gradient(135deg, #282832 0%, #2e2e38 100%);
  --color-card-bg-hover: linear-gradient(135deg, #2e2e38 0%, #36363f 100%);

  /* =========================================================================
     TYPOGRAPHY
     ========================================================================= */

  /* Font families */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;

  /* Font sizes - Mobile first (base 16px) */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */

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

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* =========================================================================
     SPACING
     ========================================================================= */

  --space-0: 0;
  --space-px: 1px;
  --space-0-5: 0.125rem;  /* 2px */
  --space-1: 0.25rem;     /* 4px */
  --space-1-5: 0.375rem;  /* 6px */
  --space-2: 0.5rem;      /* 8px */
  --space-2-5: 0.625rem;  /* 10px */
  --space-3: 0.75rem;     /* 12px */
  --space-3-5: 0.875rem;  /* 14px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-7: 1.75rem;     /* 28px */
  --space-8: 2rem;        /* 32px */
  --space-9: 2.25rem;     /* 36px */
  --space-10: 2.5rem;     /* 40px */
  --space-11: 2.75rem;    /* 44px */
  --space-12: 3rem;       /* 48px */
  --space-14: 3.5rem;     /* 56px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  --space-28: 7rem;       /* 112px */
  --space-32: 8rem;       /* 128px */

  /* =========================================================================
     BORDERS
     ========================================================================= */

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

  /* Border widths */
  --border-0: 0;
  --border-1: 1px;
  --border-2: 2px;
  --border-4: 4px;
  --border-8: 8px;

  /* =========================================================================
     SHADOWS (adjusted for dark theme)
     ========================================================================= */

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.6);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.3);
  --shadow-none: 0 0 #0000;

  /* Glow effects for dark theme */
  --shadow-glow-primary: 0 0 20px rgb(139 43 43 / 0.4);
  --shadow-glow-accent: 0 0 20px rgb(236 72 153 / 0.4);

  /* =========================================================================
     TRANSITIONS & ANIMATIONS
     ========================================================================= */

  /* Durations */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;

  /* Timing functions */
  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Common transitions */
  --transition-colors: color var(--duration-150) var(--ease-in-out),
                       background-color var(--duration-150) var(--ease-in-out),
                       border-color var(--duration-150) var(--ease-in-out);
  --transition-opacity: opacity var(--duration-150) var(--ease-in-out);
  --transition-transform: transform var(--duration-200) var(--ease-out);
  --transition-all: all var(--duration-200) var(--ease-in-out);

  /* =========================================================================
     Z-INDEX SCALE
     ========================================================================= */

  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* =========================================================================
     LAYOUT
     ========================================================================= */

  /* Container widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1440px;

  /* Content width */
  --content-width: var(--container-xl);

  /* Header height */
  --header-height: 70px;
  --header-height-scrolled: 60px;

  /* Sidebar width */
  --sidebar-width: 280px;
  --sidebar-width-collapsed: 70px;

  /* =========================================================================
     FORM ELEMENTS
     ========================================================================= */

  --input-height: 48px;
  --input-height-sm: 40px;
  --input-height-lg: 56px;
  --input-padding-x: var(--space-4);
  --input-border-radius: var(--radius-lg);
  --input-border-color: var(--color-border);
  --input-border-color-focus: var(--color-primary);
  --input-background: var(--color-background-input);

  /* =========================================================================
     COMPONENT SPECIFIC
     ========================================================================= */

  /* Cards */
  --card-padding: var(--space-6);
  --card-radius: var(--radius-xl);
  --card-shadow: var(--shadow-md);
  --card-shadow-hover: var(--shadow-lg);
  --card-background: var(--color-background-elevated);

  /* Buttons */
  --button-padding-x: var(--space-6);
  --button-padding-y: var(--space-3);
  --button-radius: var(--radius-lg);
  --button-font-weight: var(--font-semibold);

  /* Badges */
  --badge-padding-x: var(--space-3);
  --badge-padding-y: var(--space-1);
  --badge-radius: var(--radius-full);
  --badge-font-size: var(--text-xs);

  /* Product cards */
  --product-card-gap: var(--space-6);
  --product-image-ratio: 1 / 1;
}

/* =========================================================================
   GLOBAL RESETS FOR DARK THEME
   ========================================================================= */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-neutral-600) var(--color-background-secondary);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--color-background-secondary);
}

*::-webkit-scrollbar-thumb {
  background: var(--color-neutral-600);
  border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--color-neutral-500);
}

::selection {
  background: var(--color-primary);
  color: white;
}
