/* ========================================
   Core CSS - Variables, Reset, Typography, Utilities
   Generated: 2025-08-16
   Part of modular CSS architecture
   ======================================== */

/* Box Sizing Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* CSS Variables - Light Theme (Default) */
:root {
  /* Primary Colors */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-dark: #1e40af;
  --secondary-color: #64748b;
  --secondary-hover: #475569;
  
  /* Text Colors - Improved contrast */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-accent: #ffffff;
  --text-on-dark: #f8fafc;
  
  /* Background Colors - Better contrast between layers */
  --background-primary: #f5f5f7;
  --background-secondary: #ebebed;
  --background-hover: #e0e0e2;
  --background-selected: #ddd6fe;
  --background-elevated: #ffffff;
  --background-subtle: #f8f8fa;
  --bg-surface: #f5f5f7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  
  /* Dark Mode Backgrounds (kept for reference) */
  --background-primary-dark: #1f2937;
  --background-secondary-dark: #111827;
  --bg-surface-dark: #1f2937;
  --bg-card-dark: #374151;
  --bg-input-dark: #374151;
  
  /* Border Colors - More visible */
  --border-default: #c6c6ca;
  --border-subtle: #d8d8dc;
  --border-focus: #2563eb;
  --border-error: #dc2626;
  
  /* Status Colors - Slightly adjusted for better visibility */
  --success: #059669;
  --success-hover: #047857;
  --error: #dc2626;
  --error-hover: #b91c1c;
  --warning: #d97706;
  --warning-hover: #b45309;
  --info: #2563eb;
  --info-hover: #1d4ed8;
  
  /* Shadows - More pronounced for better depth */
  --shadow-sm: 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);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Z-index layers */
  --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;
}

/* Light Mode Enhancement - Explicit light theme for better UX */
[data-theme="light"],
.theme-light,
body.theme-light {
  /* Ensure light theme variables are applied */
  --background-primary: #f5f5f7;
  --bg-surface: #f5f5f7;
  --bg-card: #ffffff;
}

/* Dark Mode Variables - Works with both data-theme attribute and theme-dark class */
[data-theme="dark"],
.theme-dark,
body.theme-dark {
  /* Text Colors - Light text on dark backgrounds */
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --text-on-accent: #ffffff;
  --text-on-dark: #f3f4f6;
  
  /* Background Colors - Dark backgrounds */
  --background-primary: #111827;
  --background-secondary: #1f2937;
  --background-hover: #374151;
  --background-selected: #4b5563;
  --background-elevated: #1f2937;
  --background-subtle: #1f2937;
  --bg-surface: #111827;
  --bg-card: #1f2937;
  --bg-input: #374151;
  
  /* Keep dark mode specific variables */
  --bg-surface-dark: #111827;
  --bg-card-dark: #1f2937;
  --bg-input-dark: #374151;
  
  /* Border Colors - Subtle borders for dark mode */
  --border-default: #374151;
  --border-subtle: #1f2937;
  --border-focus: #60a5fa;
  --border-error: #f87171;
  
  /* Status Colors - Slightly lighter for dark backgrounds */
  --success: #34d399;
  --success-hover: #10b981;
  --error: #f87171;
  --error-hover: #ef4444;
  --warning: #fbbf24;
  --warning-hover: #f59e0b;
  --info: #60a5fa;
  --info-hover: #3b82f6;
  
  /* Shadows - More subtle in dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background-primary);
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

/* Lists */
ul, ol {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-xl);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
}

th, td {
  padding: var(--spacing-sm);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

th {
  font-weight: 600;
  background-color: var(--background-secondary);
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Flexbox utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* Spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: var(--spacing-xs); }
.m-2 { margin: var(--spacing-sm); }
.m-3 { margin: var(--spacing-md); }
.m-4 { margin: var(--spacing-lg); }
.m-5 { margin: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Cursors */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-wait { cursor: wait; }
