/* ==========================================================================
   Base Styles - Variables, Reset, Typography
   ========================================================================== */

/* CSS Variables */
:root {
  /* Colors */
  --color-primary: #667eea;
  --color-primary-dark: #764ba2;
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-secondary: #6c757d;

  /* Neutrals */
  --color-white: #ffffff;
  --color-gray-100: #f8f9fa;
  --color-gray-200: #f5f6fa;
  --color-gray-300: #e9ecef;
  --color-gray-400: #dee2e6;
  --color-gray-500: #adb5bd;
  --color-gray-600: #666;
  --color-gray-700: #495057;
  --color-gray-800: #333;
  --color-gray-900: #212529;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 2px 10px rgba(0,0,0,0.1);

  /* Typography */
  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.8rem;
  --font-size-base: 0.9rem;
  --font-size-lg: 1rem;
  --font-size-xl: 1.2rem;
  --font-size-2xl: 2rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
}

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

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

body {
  font-family: var(--font-family);
  background: var(--color-gray-200);
  color: var(--color-gray-800);
  line-height: 1.5;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-gray-800);
}

h1 { font-size: var(--font-size-xl); }
h2 { font-size: var(--font-size-lg); }
h3 { font-size: var(--font-size-base); }

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

a:hover {
  color: var(--color-primary-dark);
}

/* Code */
code, pre {
  font-family: 'Consolas', 'Monaco', monospace;
  background: var(--color-gray-100);
  border-radius: var(--radius-sm);
}

code {
  padding: 0.125rem 0.25rem;
  font-size: 0.875em;
}

pre {
  padding: var(--spacing-md);
  overflow-x: auto;
}

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

/* Selection */
::selection {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Alpine.js cloak - hide elements until Alpine initializes */
[x-cloak] {
  display: none !important;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base);
}

.animate-slide-in {
  animation: slideIn var(--transition-base);
}

/* Focus states for accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 100;
  transition: top var(--transition-fast);
}

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

/* Screen reader only */
.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;
}
