/* ========================================
   CSS Custom Properties (Variables)
   ======================================== */

:root {
  /* ====== Core Color Palette ====== */
  
  /* Primary Colors */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;
  --primary-950: #082f49;

  /* Neutral Colors */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;

  /* Accent Colors */
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;

  /* ====== Semantic Colors ====== */
  
  /* Success */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  /* Warning */
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  /* Error */
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;

  /* Info */
  --info-50: #f0f9ff;
  --info-100: #e0f2fe;
  --info-500: #3b82f6;
  --info-600: #2563eb;
  --info-700: #1d4ed8;

  /* ====== Application Colors ====== */
  
  /* Main Brand Colors */
  --primary-color: var(--primary-600);
  --primary-light: var(--primary-50);
  --primary-dark: var(--primary-700);
  --primary-rgb: 2, 132, 199;

  /* Background Colors */
  --white: #ffffff;
  --background-color: var(--neutral-50);
  --surface-color: var(--white);
  --surface-hover: var(--neutral-100);
  --surface-active: var(--neutral-200);

  /* Text Colors */
  --text-color: var(--neutral-800);
  --text-secondary: var(--neutral-600);
  --text-muted: var(--neutral-500);
  --text-light: var(--neutral-400);
  --text-inverse: var(--white);

  /* Border Colors */
  --border-color: var(--neutral-200);
  --border-light: var(--neutral-100);
  --border-focus: var(--primary-500);

  /* ====== Typography ====== */
  
  /* Font Families */
  --font-sans: var(--font-sans, 'Plus Jakarta Sans'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', Menlo, Courier, monospace;

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

  /* Font Sizes */
  --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 */

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* ====== Spacing ====== */
  
  --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 */

  /* ====== Border Radius ====== */
  
  --radius-none: 0;
  --radius-sm: 0.125rem;   /* 2px */
  --radius-base: 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;

  /* ====== Shadows ====== */
  
  --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 0 rgba(0, 0, 0, 0.06);
  --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);

  /* ====== Z-Index ====== */
  
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-navbar: 1040;
  --z-index-modal-backdrop: 1050;
  --z-index-modal: 1055;
  --z-index-popover: 1070;
  --z-index-tooltip: 1080;

  /* ====== Transitions ====== */
  
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  --transition-colors: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
  --transition-opacity: opacity var(--transition-fast);
  --transition-transform: transform var(--transition-fast);
  --transition-all: all var(--transition-fast);

  /* ====== Breakpoints (for reference in CSS) ====== */
  
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;

  /* ====== Component-specific Variables ====== */
  
  /* Navbar */
  --navbar-height: 4rem;
  --navbar-bg: var(--white);
  --navbar-border: var(--border-light);
  --navbar-shadow: var(--shadow-sm);
  
  /* Buttons */
  --btn-padding-x: var(--space-4);
  --btn-padding-y: var(--space-2);
  --btn-border-radius: var(--radius-md);
  
  /* Cards */
  --card-bg: var(--white);
  --card-border: var(--border-color);
  --card-border-radius: var(--radius-lg);
  --card-shadow: var(--shadow-base);
  
  /* Forms */
  --input-bg: var(--white);
  --input-border: var(--border-color);
  --input-border-focus: var(--border-focus);
  --input-border-radius: var(--radius-md);
  --input-padding-x: var(--space-3);
  --input-padding-y: var(--space-2);
}

/* ====== Dark Mode Support ====== */

[data-bs-theme="dark"] {
  --background-color: var(--neutral-900);
  --surface-color: var(--neutral-800);
  --surface-hover: var(--neutral-700);
  --surface-active: var(--neutral-600);
  
  --text-color: var(--neutral-100);
  --text-secondary: var(--neutral-300);
  --text-muted: var(--neutral-400);
  --text-light: var(--neutral-500);
  
  --border-color: var(--neutral-700);
  --border-light: var(--neutral-800);
  
  --navbar-bg: var(--neutral-900);
  --card-bg: var(--neutral-800);
  --input-bg: var(--neutral-800);
}

/* ====== Base Styles ====== */

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-color);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Overrides */
:root {
  --font-serif: var(--font-primary, 'Instrument Serif'), Georgia, serif;
}

h1, h2, h3, h4, h5, h6, 
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.font-serif {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.font-sans {
  font-family: var(--font-sans);
}