R/* ===========================================
   Khzanti Design System - Web Design Tokens
   ===========================================

   Comprehensive CSS custom properties for the Khzanti marketplace
   - Modern CSS with CSS custom properties
   - Fluid typography with clamp()
   - Responsive design system
   - Component-specific tokens
   - Accessibility compliance
   - RTL support
   - Performance optimized

   Generated from Flutter design system:
   - KhzantiColors, KhzantiTypography, KhzantiSpacing
   =========================================== */

/* ===== ROOT VARIABLES ===== */

:root {
  /* ===== COLOR TOKENS ===== */

  /* Primary Brand Colors */
  --color-primary-green: #1b4d3e;
  --color-primary-green-hover: #0d3a2d;
  --color-primary-green-light: #2e7d64;
  --color-primary-gold: #d4a574;
  --color-primary-gold-hover: #e5c085;
  --color-primary-gold-light: #e5c085;
  --color-primary-red: #e74c3c;
  --color-primary-red-hover: #c0392b;

  /* Neutral Colors */
  --color-background: #fafafa;
  --color-background-alt: #f5f5f5;
  --color-surface: #ffffff;
  --color-surface-alt: #f8f9fa;
  --color-text-primary: #2c3e50;
  --color-text-secondary: #7f8c8d;
  --color-text-disabled: #bdc3c7;
  --color-text-inverse: #ffffff;
  --color-border-light: #e5e5e5;
  --color-border-medium: #bdc3c7;
  --color-border-dark: #95a5a6;
  --color-divider: #ecf0f1;

  /* Semantic Colors */
  --color-success: #27ae60;
  --color-success-light: #2ecc71;
  --color-success-dark: #229954;
  --color-warning: #f39c12;
  --color-warning-light: #f1c40f;
  --color-warning-dark: #e67e22;
  --color-error: #e74c3c;
  --color-error-light: #ec7063;
  --color-error-dark: #c0392b;
  --color-info: #3498db;
  --color-info-light: #5dade2;
  --color-info-dark: #2980b9;

  /* Trust & Verification Colors */
  --color-trust-gold: #ffd700;
  --color-trust-silver: #c0c0c0;
  --color-trust-bronze: #cd7f32;
  --color-trust-platinum: #e5e4e2;
  --color-trust-indicator: #2ecc71;

  /* Additional Colors */
  --color-accent: #6a994e;
  --color-accent-light: #8bc34a;
  --color-accent-dark: #558b2f;
  --color-traditional: #8b4513;
  --color-calendar: #4a5568;
  --color-overlay: rgba(0, 0, 0, 0.5);
  --color-overlay-light: rgba(0, 0, 0, 0.25);
  --color-overlay-dark: rgba(0, 0, 0, 0.75);

  /* ===== TYPOGRAPHY TOKENS ===== */

  /* Font Families */
  --font-family-arabic: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-latin: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Cascadia Code', monospace;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semi-bold: 600;
  --font-weight-bold: 700;
  --font-weight-extra-bold: 800;
  --font-weight-black: 900;

  /* Fluid Typography Scale */
  --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);     /* 12px → 14px */
  --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);       /* 14px → 16px */
  --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);       /* 16px → 18px */
  --font-size-md: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);       /* 18px → 20px */
  --font-size-lg: clamp(1.25rem, 1.1rem + 0.75vw, 1.375rem);      /* 20px → 22px */
  --font-size-xl: clamp(1.375rem, 1.2rem + 0.875vw, 1.5rem);      /* 22px → 24px */
  --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.625rem);         /* 24px → 26px */
  --font-size-3xl: clamp(1.625rem, 1.4rem + 1.125vw, 1.75rem);    /* 26px → 28px */
  --font-size-4xl: clamp(1.75rem, 1.5rem + 1.25vw, 2rem);         /* 28px → 32px */
  --font-size-5xl: clamp(2rem, 1.7rem + 1.5vw, 2.5rem);           /* 32px → 40px */

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.5;
  --line-height-loose: 1.6;

  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;

  /* ===== SPACING TOKENS ===== */

  /* Base Spacing Scale (4px increments) */
  --space-1: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);    /* 4px → 8px */
  --space-2: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);     /* 8px → 12px */
  --space-3: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);      /* 12px → 16px */
  --space-4: clamp(1rem, 0.8rem + 1vw, 1.25rem);         /* 16px → 20px */
  --space-5: clamp(1.25rem, 1rem + 1.25vw, 1.5rem);      /* 20px → 24px */
  --space-6: clamp(1.5rem, 1.2rem + 1.5vw, 1.75rem);     /* 24px → 28px */
  --space-8: clamp(2rem, 1.6rem + 2vw, 2.25rem);         /* 32px → 36px */
  --space-10: clamp(2.5rem, 2rem + 2.5vw, 2.75rem);      /* 40px → 44px */
  --space-12: clamp(3rem, 2.4rem + 3vw, 3.25rem);        /* 48px → 52px */
  --space-16: clamp(4rem, 3.2rem + 4vw, 4.25rem);        /* 64px → 68px */
  --space-20: clamp(5rem, 4rem + 5vw, 5.25rem);          /* 80px → 84px */
  --space-24: clamp(6rem, 4.8rem + 6vw, 6.25rem);        /* 96px → 100px */

  /* ===== BORDER RADIUS TOKENS ===== */

  --radius-xs: 0.125rem;    /* 2px */
  --radius-sm: 0.25rem;     /* 4px */
  --radius-md: 0.5rem;      /* 8px */
  --radius-lg: 0.75rem;     /* 12px */
  --radius-xl: 1rem;        /* 16px */
  --radius-2xl: 1.5rem;     /* 24px */
  --radius-3xl: 2rem;       /* 32px */
  --radius-full: 9999px;

  /* ===== SHADOW TOKENS ===== */

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --shadow-none: none;

  /* ===== ANIMATION & TRANSITION TOKENS ===== */

  /* Duration Tokens */
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 700ms;

  /* Easing Functions */
  --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --easing-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Transition Tokens */
  --transition-fast: var(--duration-fast) var(--easing-standard);
  --transition-normal: var(--duration-normal) var(--easing-standard);
  --transition-slow: var(--duration-slow) var(--easing-standard);
  --transition-all-fast: all var(--duration-fast) var(--easing-standard);
  --transition-all-normal: all var(--duration-normal) var(--easing-standard);
  --transition-colors: color var(--duration-fast) var(--easing-standard),
                       background-color var(--duration-fast) var(--easing-standard),
                       border-color var(--duration-fast) var(--easing-standard);

  /* ===== RESPONSIVE BREAKPOINTS ===== */

  --breakpoint-mobile: 360px;
  --breakpoint-mobile-large: 414px;
  --breakpoint-tablet: 768px;
  --breakpoint-tablet-large: 1024px;
  --breakpoint-desktop: 1280px;
  --breakpoint-desktop-large: 1440px;
  --breakpoint-desktop-xl: 1920px;

  /* ===== CONTAINER SYSTEM ===== */

  --container-xs: 20rem;      /* 320px */
  --container-sm: 24rem;      /* 384px */
  --container-md: 28rem;      /* 448px */
  --container-lg: 32rem;      /* 512px */
  --container-xl: 36rem;      /* 576px */
  --container-2xl: 42rem;     /* 672px */
  --container-3xl: 48rem;     /* 768px */
  --container-4xl: 56rem;     /* 896px */
  --container-5xl: 64rem;     /* 1024px */
  --container-6xl: 72rem;     /* 1152px */
  --container-7xl: 80rem;     /* 1280px */
  --container-full: 100%;

  /* ===== Z-INDEX TOKENS ===== */

  --z-index-hide: -1;
  --z-index-auto: auto;
  --z-index-base: 0;
  --z-index-docked: 10;
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-banner: 1030;
  --z-index-overlay: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-skip-link: 1070;
  --z-index-toast: 1080;
  --z-index-tooltip: 1090;

  /* ===== COMPONENT-SPECIFIC TOKENS ===== */

  /* Button Tokens */
  --button-height-xs: 1.75rem;      /* 28px */
  --button-height-sm: 2rem;         /* 32px */
  --button-height-md: 2.5rem;       /* 40px */
  --button-height-lg: 3rem;         /* 48px */
  --button-height-xl: 3.5rem;       /* 56px */

  --button-padding-x-xs: 0.75rem;   /* 12px */
  --button-padding-x-sm: 1rem;      /* 16px */
  --button-padding-x-md: 1.5rem;    /* 24px */
  --button-padding-x-lg: 2rem;      /* 32px */
  --button-padding-x-xl: 2.5rem;    /* 40px */

  --button-font-size-xs: var(--font-size-xs);
  --button-font-size-sm: var(--font-size-sm);
  --button-font-size-md: var(--font-size-base);
  --button-font-size-lg: var(--font-size-md);
  --button-font-size-xl: var(--font-size-lg);

  /* Card Tokens */
  --card-padding-xs: var(--space-2);
  --card-padding-sm: var(--space-3);
  --card-padding-md: var(--space-4);
  --card-padding-lg: var(--space-6);
  --card-padding-xl: var(--space-8);

  --card-border-radius: var(--radius-lg);
  --card-shadow: var(--shadow-sm);
  --card-shadow-hover: var(--shadow-md);

  /* Form/Input Tokens */
  --input-height: 2.5rem;            /* 40px */
  --input-padding-x: 0.75rem;        /* 12px */
  --input-padding-y: 0.5rem;         /* 8px */
  --input-border-width: 1px;
  --input-border-radius: var(--radius-md);
  --input-font-size: var(--font-size-base);

  --input-focus-border-width: 2px;
  --input-focus-ring-width: 3px;
  --input-focus-ring-color: rgba(27, 77, 62, 0.1);

  /* Modal/Dialog Tokens */
  --modal-padding: var(--space-6);
  --modal-border-radius: var(--radius-xl);
  --modal-shadow: var(--shadow-2xl);
  --modal-backdrop: rgba(0, 0, 0, 0.5);
  --modal-max-width-sm: 20rem;       /* 320px */
  --modal-max-width-md: 28rem;       /* 448px */
  --modal-max-width-lg: 32rem;       /* 512px */
  --modal-max-width-xl: 36rem;       /* 576px */

  /* Navigation Tokens */
  --nav-height: 4rem;                /* 64px */
  --nav-padding-x: var(--space-4);
  --nav-item-spacing: var(--space-6);
  --nav-border-width: 1px;

  /* ===== ACCESSIBILITY TOKENS ===== */

  /* Focus Indicators */
  --focus-ring-width: 3px;
  --focus-ring-style: solid;
  --focus-ring-color: var(--color-primary-green);
  --focus-ring-offset: 2px;

  /* High Contrast Mode */
  --high-contrast-border-width: 2px;
  --high-contrast-focus-ring-width: 4px;

  /* Reduced Motion */
  --reduced-motion-duration: 0ms;
  --reduced-motion-easing: linear;

  /* Color Contrast Ratios */
  --min-contrast-ratio-normal: 4.5;
  --min-contrast-ratio-large: 3;

  /* Touch Targets */
  --min-touch-target: 2.75rem;       /* 44px */
  --comfortable-touch-target: 3rem;  /* 48px */

  /* ===== GRID SYSTEM ===== */

  --grid-columns: 12;
  --grid-gutter-xs: var(--space-2);
  --grid-gutter-sm: var(--space-3);
  --grid-gutter-md: var(--space-4);
  --grid-gutter-lg: var(--space-6);
  --grid-gutter-xl: var(--space-8);

  /* ===== UTILITY TOKENS ===== */

  /* Aspect Ratios */
  --aspect-square: 1;
  --aspect-video: 16 / 9;
  --aspect-portrait: 3 / 4;
  --aspect-landscape: 4 / 3;

  /* Opacity Levels */
  --opacity-0: 0;
  --opacity-5: 0.05;
  --opacity-10: 0.1;
  --opacity-20: 0.2;
  --opacity-25: 0.25;
  --opacity-30: 0.3;
  --opacity-40: 0.4;
  --opacity-50: 0.5;
  --opacity-60: 0.6;
  --opacity-70: 0.7;
  --opacity-75: 0.75;
  --opacity-80: 0.8;
  --opacity-90: 0.9;
  --opacity-95: 0.95;
  --opacity-100: 1;
}

/* ===== DARK MODE TOKENS ===== */

@media (prefers-color-scheme: dark) {
  :root {
    /* Neutral Colors - Dark Mode */
    --color-background: #121212;
    --color-background-alt: #1a1a1a;
    --color-surface: #1e1e1e;
    --color-surface-alt: #2a2a2a;
    --color-text-primary: #ffffff;
    --color-text-secondary: #bbbbbb;
    --color-text-disabled: #666666;
    --color-text-inverse: #121212;
    --color-border-light: #333333;
    --color-border-medium: #555555;
    --color-border-dark: #777777;
    --color-divider: #333333;

    /* Overlay Adjustments */
    --color-overlay: rgba(255, 255, 255, 0.1);
    --color-overlay-light: rgba(255, 255, 255, 0.05);
    --color-overlay-dark: rgba(255, 255, 255, 0.2);

    /* Shadow Adjustments for Dark Mode */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

    /* Focus Ring Adjustments */
    --focus-ring-color: var(--color-primary-gold);
    --input-focus-ring-color: rgba(212, 167, 116, 0.2);
  }
}

/* ===== HIGH CONTRAST MODE ===== */

@media (prefers-contrast: high) {
  :root {
    --color-primary-green: #000000;
    --color-primary-gold: #ffd700;
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-background: #ffffff;
    --color-surface: #ffffff;
    --color-border-light: #000000;
    --color-border-medium: #000000;
    --color-border-dark: #000000;
    --color-divider: #000000;

    --high-contrast-border-width: 2px;
    --high-contrast-focus-ring-width: 4px;
    --focus-ring-color: #000000;
  }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: var(--reduced-motion-duration);
    --duration-normal: var(--reduced-motion-duration);
    --duration-slow: var(--reduced-motion-duration);
    --duration-slower: var(--reduced-motion-duration);

    --easing-standard: var(--reduced-motion-easing);
    --easing-decelerate: var(--reduced-motion-easing);
    --easing-accelerate: var(--reduced-motion-easing);
    --easing-bounce: var(--reduced-motion-easing);
    --easing-elastic: var(--reduced-motion-easing);
  }
}

/* ===== RESPONSIVE BREAKPOINT UTILITIES ===== */

@media (min-width: 360px) {
  :root {
    --container-mobile: var(--container-xs);
  }
}

@media (min-width: 414px) {
  :root {
    --container-mobile-large: var(--container-sm);
  }
}

@media (min-width: 768px) {
  :root {
    --container-tablet: var(--container-md);
  }
}

@media (min-width: 1024px) {
  :root {
    --container-tablet-large: var(--container-lg);
  }
}

@media (min-width: 1280px) {
  :root {
    --container-desktop: var(--container-xl);
  }
}

@media (min-width: 1440px) {
  :root {
    --container-desktop-large: var(--container-2xl);
  }
}

@media (min-width: 1920px) {
  :root {
    --container-desktop-xl: var(--container-3xl);
  }
}

/* ===== RTL SUPPORT UTILITIES ===== */

[dir="rtl"] {
  /* Text Direction */
  --text-direction: rtl;

  /* Margin/Padding Swaps */
  --margin-start: margin-right;
  --margin-end: margin-left;
  --padding-start: padding-right;
  --padding-end: padding-left;

  /* Border Swaps */
  --border-start: border-right;
  --border-end: border-left;
  --border-start-width: border-right-width;
  --border-end-width: border-left-width;

  /* Position Swaps */
  --left: right;
  --right: left;

  /* Transform Adjustments */
  --transform-scale-x: -1;
}

/* Arabic Font Family for RTL */
[dir="rtl"] {
  --font-family-primary: var(--font-family-arabic);
}

/* Latin Font Family for LTR */
[dir="ltr"] {
  --font-family-primary: var(--font-family-latin);
}

/* ===== COMPONENT CLASSES ===== */

/* Button Variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-medium);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-colors);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--color-primary-green);
  color: var(--color-text-inverse);
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x-md);
  font-size: var(--button-font-size-md);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-green-hover);
}

.btn-secondary {
  background-color: var(--color-primary-gold);
  color: var(--color-text-primary);
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x-md);
  font-size: var(--button-font-size-md);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-primary-gold-hover);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary-green);
  border: 1px solid var(--color-primary-green);
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x-md);
  font-size: var(--button-font-size-md);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-primary-green);
  color: var(--color-text-inverse);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  height: var(--button-height-md);
  padding: 0 var(--button-padding-x-md);
  font-size: var(--button-font-size-md);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--color-surface-alt);
  color: var(--color-text-primary);
}

/* Button Sizes */
.btn-sm {
  height: var(--button-height-sm);
  padding: 0 var(--button-padding-x-sm);
  font-size: var(--button-font-size-sm);
}

.btn-lg {
  height: var(--button-height-lg);
  padding: 0 var(--button-padding-x-lg);
  font-size: var(--button-font-size-lg);
}

/* Card Component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--card-border-radius);
  box-shadow: var(--card-shadow);
  padding: var(--card-padding-md);
  transition: var(--transition-all-normal);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

/* Form Components */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding-y) var(--input-padding-x);
  font-family: var(--font-family-primary);
  font-size: var(--input-font-size);
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  border: var(--input-border-width) solid var(--color-border-light);
  border-radius: var(--input-border-radius);
  transition: var(--transition-colors);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary-green);
  border-width: var(--input-focus-border-width);
  box-shadow: 0 0 0 var(--input-focus-ring-width) var(--input-focus-ring-color);
}

.form-input::placeholder {
  color: var(--color-text-disabled);
}

/* Container System */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 360px) {
  .container {
    max-width: var(--container-mobile, var(--container-xs));
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-tablet, var(--container-md));
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-desktop, var(--container-lg));
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: var(--container-desktop-large, var(--container-xl));
  }
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--grid-gutter-md);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* Flexbox Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

/* Spacing Utilities */
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }

/* Text Utilities */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-info { color: var(--color-info); }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-light { font-weight: var(--font-weight-light); }
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semi-bold { font-weight: var(--font-weight-semi-bold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* Background Utilities */
.bg-primary { background-color: var(--color-primary-green); }
.bg-secondary { background-color: var(--color-primary-gold); }
.bg-surface { background-color: var(--color-surface); }
.bg-background { background-color: var(--color-background); }
.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-error { background-color: var(--color-error); }
.bg-info { background-color: var(--color-info); }

/* Border Utilities */
.border-light { border-color: var(--color-border-light); }
.border-medium { border-color: var(--color-border-medium); }
.border-primary { border-color: var(--color-primary-green); }
.border-secondary { border-color: var(--color-primary-gold); }

/* Shadow Utilities */
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }
.shadow-inner { box-shadow: var(--shadow-inner); }

/* Border Radius Utilities */
.rounded-xs { border-radius: var(--radius-xs); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* Focus Management */
*:focus-visible {
  outline: var(--focus-ring-width) var(--focus-ring-style) var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* High Contrast Focus */
@media (prefers-contrast: high) {
  *:focus-visible {
    outline-width: var(--high-contrast-focus-ring-width);
    outline-color: var(--focus-ring-color);
  }
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary-green);
  color: var(--color-text-inverse);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: var(--z-index-skip-link);
  transition: var(--transition-all-fast);
}

.skip-link:focus {
  top: 6px;
}

/* Screen Reader Only Content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Will Change for Animations */
.animate-transform {
  will-change: transform;
}

.animate-opacity {
  will-change: opacity;
}

/* Content Visibility for Performance */
.content-visible {
  content-visibility: auto;
  contain-intrinsic-size: 200px;
}

/* ===== PRINT STYLES ===== */

@media print {
  :root {
    --color-background: #ffffff;
    --color-surface: #ffffff;
    --color-text-primary: #000000;
    --color-border-light: #cccccc;
  }

  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--color-border-light);
  }
}

/* ===== LEGACY BROWSER SUPPORT ===== */

/* Fallback for CSS clamp() */
@supports not (font-size: clamp(1rem, 2vw, 3rem)) {
  :root {
    --font-size-xs: 0.875rem;
    --font-size-sm: 1rem;
    --font-size-base: 1.125rem;
    --font-size-md: 1.25rem;
    --font-size-lg: 1.375rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 1.625rem;
    --font-size-3xl: 1.75rem;
    --font-size-4xl: 2rem;
    --font-size-5xl: 2.5rem;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
  }
}

/* ===== UTILITY CLASSES FOR RAPID DEVELOPMENT ===== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }

.z-auto { z-index: var(--z-index-auto); }
.z-base { z-index: var(--z-index-base); }
.z-dropdown { z-index: var(--z-index-dropdown); }
.z-sticky { z-index: var(--z-index-sticky); }
.z-modal { z-index: var(--z-index-modal); }
.z-tooltip { z-index: var(--z-index-tooltip); }

/* ===== COMPONENT VARIANTS ===== */

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.badge-success {
  background-color: var(--color-success-light);
  color: var(--color-success-dark);
}

.badge-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.badge-error {
  background-color: var(--color-error-light);
  color: var(--color-error-dark);
}

.badge-info {
  background-color: var(--color-info-light);
  color: var(--color-info-dark);
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--color-border-light);
  border-radius: var(--radius-full);
  border-top-color: var(--color-primary-green);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== END OF DESIGN TOKENS ===== */