/**
 * Design System - Global CSS Custom Properties
 *
 * This file defines all design tokens used throughout the application.
 * Inspired by Clerk.com's modern, professional aesthetic.
 *
 * Usage: Use CSS variables instead of hardcoded colors/spacing
 * Example: background-color: var(--color-primary);
 */

:root {
  /* ============================================
     COLOR PALETTE - Fireart Studio Inspired
     ============================================ */

  /* Primary Brand Colors - Modern Navy with Vibrant Orange Accent */
  --color-primary: #FF6B35;           /* Vibrant orange - main accent */
  --color-primary-hover: #E55A2B;     /* Darker orange on hover */
  --color-primary-active: #CC4922;    /* Even darker on active */
  --color-primary-light: #FFF4ED;     /* Light orange background */

  --color-secondary: #1A1A2E;         /* Deep navy - secondary */
  --color-secondary-hover: #0F3460;   /* Dark blue on hover */
  --color-secondary-light: #F0F1F5;   /* Light background */

  /* Semantic Colors */
  --color-success: #2ECC71;           /* Green - positive, verified */
  --color-success-hover: #27AE60;
  --color-success-light: #EAFAF1;

  --color-warning: #F39C12;           /* Amber - caution, pending */
  --color-warning-hover: #D68910;
  --color-warning-light: #FEF5E7;

  --color-danger: #E74C3C;            /* Red - errors, locked */
  --color-danger-hover: #C0392B;
  --color-danger-light: #FADBD8;

  --color-info: var(--color-gray-600);      /* Gray - neutral information */
  --color-info-hover: var(--color-gray-500);
  --color-info-light: var(--color-gray-100);

  /* Neutral Grays - Modern palette */
  --color-gray-50: #F8F9FA;           /* Lightest, backgrounds */
  --color-gray-100: #F1F3F5;          /* Very light, card backgrounds */
  --color-gray-200: #E9ECEF;          /* Light, borders */
  --color-gray-300: #DEE2E6;          /* Medium-light, subtle borders */
  --color-gray-400: #ADB5BD;          /* Medium, secondary text */
  --color-gray-500: #868E96;          /* Medium-dark */
  --color-gray-600: #495057;          /* Dark, secondary text */
  --color-gray-700: #343A40;          /* Darker, body text */
  --color-gray-800: #23282D;          /* Very dark */
  --color-gray-900: #1A1D20;          /* Darkest, headings */

  /* ============================================
     TEXT & FOREGROUND COLORS
     ============================================ */

  --text-primary: var(--color-gray-900);          /* Headings, strong text */
  --text-secondary: var(--color-gray-700);        /* Body text */
  --text-tertiary: var(--color-gray-600);         /* Secondary labels */
  --text-quaternary: var(--color-gray-400);       /* Disabled, placeholder */
  --text-inverse: #FFFFFF;                      /* Text on dark backgrounds */

  /* ============================================
     BACKGROUND COLORS
     ============================================ */

  --bg-primary: #FFFFFF;                        /* Main background */
  --bg-secondary: var(--color-gray-50);           /* Secondary background */
  --bg-tertiary: var(--color-gray-100);           /* Card backgrounds */
  --bg-disabled: var(--color-gray-100);           /* Disabled elements */
  --bg-inverse: var(--color-gray-700);            /* Dark background */
  --overlay-dark: rgba(0, 0, 0, 0.5);           /* Dark overlay for modals */
  --overlay-light: rgba(255, 255, 255, 0.5);    /* Light overlay */

  /* ============================================
     BORDER COLORS
     ============================================ */

  --border-light: var(--color-gray-200);          /* Subtle borders */
  --border-default: var(--color-gray-300);        /* Standard borders */
  --border-focus: var(--color-primary);           /* Focus state borders */

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

  /* Font Family */
  --font-family-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  --font-family-mono: 'Menlo', 'Monaco', 'Courier New', monospace;

  /* Font Sizes */
  --font-size-xs: 11px;               /* Micro labels, badges */
  --font-size-sm: 12px;               /* Small labels, helpers */
  --font-size-base: 14px;             /* Default body text */
  --font-size-lg: 16px;               /* Large body, important text */
  --font-size-xl: 18px;               /* Small headings */
  --font-size-2xl: 20px;              /* Heading 4 */
  --font-size-3xl: 28px;              /* Heading 2 */
  --font-size-4xl: 32px;              /* Heading 1 */

  /* Font Weights */
  --font-weight-regular: 400;         /* Normal text */
  --font-weight-medium: 500;          /* Emphasized text, labels */
  --font-weight-semibold: 600;        /* Subheadings */
  --font-weight-bold: 700;            /* Main headings */

  /* Line Heights */
  --line-height-tight: 1.2;           /* Headings */
  --line-height-snug: 1.3;            /* Subheadings */
  --line-height-normal: 1.4;          /* Small text */
  --line-height-relaxed: 1.5;         /* Body text standard */
  --line-height-loose: 1.6;           /* Large body text */

  /* Letter Spacing */
  --letter-spacing-tight: -0.5px;
  --letter-spacing-normal: 0px;
  --letter-spacing-wide: 0.5px;

  /* ============================================
     SPACING SCALE (8px Grid System)
     ============================================ */

  --spacing-0: 0;
  --spacing-1: 4px;                   /* xs - Micro spacing */
  --spacing-2: 8px;                   /* sm - Small spacing */
  --spacing-3: 12px;                  /* Extra small */
  --spacing-4: 16px;                  /* md - Standard spacing */
  --spacing-6: 24px;                  /* lg - Large spacing */
  --spacing-8: 32px;                  /* xl - Extra large */
  --spacing-10: 40px;                 /* 2xl - Very large */
  --spacing-12: 48px;                 /* 3xl - Section spacing */
  --spacing-16: 64px;                 /* Major section spacing */

  /* ============================================
     BORDER RADIUS
     ============================================ */

  --radius-none: 0;
  --radius-sm: 4px;                   /* Small, badges, tags */
  --radius-md: 6px;                   /* Medium, buttons, inputs */
  --radius-lg: 8px;                   /* Large, cards, modals */
  --radius-xl: 12px;                  /* Extra large */
  --radius-full: 9999px;              /* Fully rounded, pills */

  /* ============================================
     SHADOWS
     ============================================ */

  --shadow-none: none;
  --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);

  /* Focus shadows for accessibility */
  --shadow-focus: 0 0 0 3px rgba(255, 107, 53, 0.15);
  --shadow-focus-primary: 0 0 0 0.25rem rgba(255, 107, 53, 0.25);
  --shadow-focus-soft: 0 0 0 3px rgba(255, 107, 53, 0.1);
  --border-overlay-light: rgba(255, 255, 255, 0.3);

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

  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;

  --timing-function-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --timing-function-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --timing-function-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

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

  --container-max-width: 1400px;
  --container-padding: var(--spacing-6);      /* 24px */
  --container-padding-mobile: var(--spacing-4);  /* 16px */

  --grid-gap-column: var(--spacing-6);        /* 24px */
  --grid-gap-row: var(--spacing-4);           /* 16px */

  /* ============================================
     COMPONENTS - Common Values
     ============================================ */

  /* Buttons */
  --button-height-sm: 32px;
  --button-height-md: 40px;
  --button-height-lg: 48px;

  --button-padding-sm: 8px 12px;
  --button-padding-md: 10px 16px;
  --button-padding-lg: 12px 20px;

  --button-font-size: var(--font-size-base);
  --button-font-weight: var(--font-weight-medium);
  --button-border-radius: var(--radius-md);
  --button-transition: var(--transition-fast);

  /* Form Controls */
  --form-input-height: 40px;
  --form-input-padding: 10px 12px;
  --form-input-font-size: var(--font-size-base);
  --form-input-border-radius: var(--radius-md);
  --form-input-border-color: var(--border-default);
  --form-input-focus-border-color: var(--border-focus);

  --form-label-font-size: var(--font-size-base);
  --form-label-font-weight: var(--font-weight-medium);
  --form-label-margin-bottom: var(--spacing-2);

  /* Cards */
  --card-padding: var(--spacing-6);   /* 24px */
  --card-background: var(--bg-primary);
  --card-border-color: var(--border-light);
  --card-border-radius: var(--radius-lg);
  --card-shadow: var(--shadow-base);

  /* Tables */
  --table-row-height: 48px;
  --table-cell-padding: 12px;
  --table-header-background: var(--color-gray-100);
  --table-header-font-weight: var(--font-weight-semibold);
  --table-border-color: var(--border-light);
  --table-hover-background: var(--color-gray-50);

  /* Badges */
  --badge-padding: 4px 12px;
  --badge-font-size: var(--font-size-xs);
  --badge-font-weight: var(--font-weight-medium);
  --badge-border-radius: var(--radius-sm);

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

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

}

/* ============================================
   UTILITY CLASSES - Spacing
   ============================================ */

.p-0 { padding: var(--spacing-0); }
.p-1 { padding: var(--spacing-1); }
.p-2 { padding: var(--spacing-2); }
.p-3 { padding: var(--spacing-3); }
.p-4 { padding: var(--spacing-4); }
.p-6 { padding: var(--spacing-6); }
.p-8 { padding: var(--spacing-8); }

.px-4 { padding-left: var(--spacing-4); padding-right: var(--spacing-4); }
.px-6 { padding-left: var(--spacing-6); padding-right: var(--spacing-6); }
.py-4 { padding-top: var(--spacing-4); padding-bottom: var(--spacing-4); }
.py-6 { padding-top: var(--spacing-6); padding-bottom: var(--spacing-6); }

.m-0 { margin: var(--spacing-0); }
.m-1 { margin: var(--spacing-1); }
.m-2 { margin: var(--spacing-2); }
.m-4 { margin: var(--spacing-4); }
.m-6 { margin: var(--spacing-6); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: var(--spacing-4); margin-bottom: var(--spacing-4); }
.my-6 { margin-top: var(--spacing-6); margin-bottom: var(--spacing-6); }

/* ============================================
   UTILITY CLASSES - Typography
   ============================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-quaternary); }

.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-lg { font-size: var(--font-size-lg); }

.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ============================================
   UTILITY CLASSES - Shadows
   ============================================ */

.shadow-none { box-shadow: var(--shadow-none); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-base); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ============================================
   UTILITY CLASSES - Rounded Corners
   ============================================ */

.rounded-none { border-radius: var(--radius-none); }
.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-full { border-radius: var(--radius-full); }

/* ============================================
   UTILITY CLASSES - Transitions
   ============================================ */

.transition-fast { transition: all var(--transition-fast); }
.transition-base { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }

/* ============================================
   BASE ELEMENT STYLING
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-system);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
  background-color: var(--bg-primary);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-4);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}

h4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Paragraphs */
p {
  margin-bottom: var(--spacing-4);
}

/* Code */
code, pre {
  font-family: var(--font-family-mono);
  background-color: var(--bg-secondary);
  padding: var(--spacing-1) var(--spacing-2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: var(--spacing-6) 0;
}

/* ============================================
   RESPONSIVE - Medium Screens (768px+)
   ============================================ */

@media (min-width: 768px) {
  :root {
    /* Adjust container padding for tablets */
    --container-padding: var(--spacing-6);
  }
}

/* ============================================
   RESPONSIVE - Large Screens (1024px+)
   ============================================ */

@media (min-width: 1024px) {
  /* Container remains at max width */
  body {
    padding: 0;
  }
}
