/* Theme Variables */
:root {
  /* Colors mapped from club theme with fallbacks */
  --primary: var(--club-primary, #1e3a8a); /* blue-800 */
  --primary-light: color-mix(in srgb, var(--primary) 85%, #ffffff);
  --secondary: var(--club-secondary, #0ea5a4); /* teal-500 */
  --accent: var(--club-accent, #2563eb); /* blue-600 */
  --white: #ffffff;
  --off-white: #f7fafc;
  --light-gray: #e2e8f0;
  --dark-gray: #4a5568;
  --card-border: color-mix(in srgb, var(--primary) 12%, var(--light-gray));
  --ring: color-mix(in srgb, var(--primary) 30%, transparent);
  --bg-soft: color-mix(in srgb, var(--primary) 3%, #ffffff);
  
  /* Dark mode colors */
  --dark-bg: #1a1d25;
  --dark-bg-elevated: #242831;
  --dark-bg-card: #2d323d;
  --dark-text: #e8eaf0;
  --dark-text-muted: #9ca3af;
  --dark-border: rgba(255, 255, 255, 0.12);
  
  /* Spacing */
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Typography - These are overridden dynamically by useFontLoader */
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-heading: 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

/* Dark mode is controlled by Chakra UI (.chakra-ui-dark class) */
/* System preference (prefers-color-scheme) is intentionally not used */

/* Base Styles */
body {
  font-family: var(--font-body, var(--font-sans));
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Ensure dark mode applies to body without CSS var conflicts */
.chakra-ui-dark body {
  background: #0f1115 !important;
  color: #e8eaf0 !important;
}

/* Better text selection styling */
::selection {
  background: var(--secondary);
  color: var(--club-text-on-secondary, #111);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading) !important;
  font-weight: 700;
  margin: 0 0 var(--space-md) 0;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--ring);
}

/* Cards */
.card {
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

/* Dark mode for all elements - controlled by Chakra UI */
.chakra-ui-dark {
  --bg-soft: #1a1f29;
  --light-gray: rgba(255, 255, 255, 0.12);
  --dark-gray: #a0aec0;
  --card-border: rgba(255, 255, 255, 0.12);
  --ring: rgba(255, 255, 255, 0.10);
}

.chakra-ui-dark .card {
  background: var(--dark-bg-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: var(--dark-text);
}

.chakra-ui-dark h1,
.chakra-ui-dark h2,
.chakra-ui-dark h3,
.chakra-ui-dark h4,
.chakra-ui-dark h5,
.chakra-ui-dark h6 {
  color: var(--dark-text);
}

.chakra-ui-dark .btn-primary {
  background: var(--primary);
  color: white;
}

.chakra-ui-dark ::selection {
  background: var(--secondary);
  color: var(--dark-text);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-sm);
  }
}
