/* Base Styles - Variables, Typography, and Core Styles */

:root {
  /* Color Palette - Modern and Vibrant */
  --accent-color: #6366f1;
  --accent-dark: #4f46e5;
  --accent-light: #818cf8;
  --secondary-color: #ec4899;
  --secondary-dark: #db2777;
  --secondary-light: #f472b6;
  --tertiary-color: #14b8a6;
  --tertiary-dark: #0d9488;
  --tertiary-light: #2dd4bf;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-gradient-start: #f8fafc;
  --bg-gradient-end: #e0e7ff;
  --border-color: #e2e8f0;
  --focus-ring: rgba(99, 102, 241, 0.5);
  --accent-bg-hover: rgba(99, 102, 241, 0.08);
  --accent-bg-active-start: rgba(99, 102, 241, 0.1);
  --accent-bg-active-end: rgba(99, 102, 241, 0.05);
  --accent-border-active: rgba(99, 102, 241, 0.2);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);
  
  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Font Sizes */
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --h1-size: 2.5rem;
  --h2-size: 2rem;
  --h3-size: 1.75rem;
  --h4-size: 1.5rem;
  --h5-size: 1.25rem;
  --h6-size: 1rem;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  
  /* Layout */
  --max-width: 1200px;
  --border-radius: 0.375rem;
  --border-radius-sm: 0.25rem;
  --border-radius-lg: 0.5rem;
  
  /* Transitions */
  --transition-base: all 0.2s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(to bottom, #ffffff 0%, var(--bg-secondary) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

h3 {
  font-size: var(--h3-size);
}

h4 {
  font-size: var(--h4-size);
}

h5 {
  font-size: var(--h5-size);
}

h6 {
  font-size: var(--h6-size);
}

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

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition-base);
  position: relative;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

a:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

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

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

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

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

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

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

.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-4 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
.py-5 { padding-top: var(--spacing-xxl); padding-bottom: var(--spacing-xxl); }

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 var(--border-radius) 0;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Responsive Typography */
@media (max-width: 767px) {
  :root {
    --h1-size: 2rem;
    --h2-size: 1.75rem;
    --h3-size: 1.5rem;
    --h4-size: 1.25rem;
    --h5-size: 1.125rem;
  }
}
