/* ==========================================================================
   PROJECT BOO BOO KITTY - Design System
   Base styles, CSS variables, reset, and typography
   ========================================================================== */

/* CSS Custom Properties (Design Tokens) */
:root {
    /* Brand Colors */
    --color-primary: #667eea;
    --color-primary-dark: #5a6fd6;
    --color-secondary: #764ba2;
    --color-accent: #f093fb;

    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #e9ecef;
    --color-gray-200: #dee2e6;
    --color-gray-300: #ced4da;
    --color-gray-400: #adb5bd;
    --color-gray-500: #6c757d;
    --color-gray-600: #495057;
    --color-gray-700: #343a40;
    --color-gray-800: #212529;
    --color-gray-900: #0a0a0a;
    --color-black: #000000;

    /* Semantic Colors */
    --color-success: #00b894;
    --color-warning: #fdcb6e;
    --color-error: #d63031;
    --color-info: #0984e3;

    /* Theme Colors (Pages) */
    --color-arcade: #f5576c;
    --color-halloween: #ff6b35;
    --color-trivia: #667eea;
    --color-jfk: #c9a227;
    --color-news: #16213e;
    --color-orioles: #df4601;
    --color-commanders: #773141;
    --color-commanders-accent: #ffb612;
    --color-xfiles: #00ff00;
    --color-xfiles-dark: #0a0a0a;
    --color-jurassicpark: #f4a020;
    --color-jurassicpark-dark: #1a2f1a;
    --color-jurassicpark-accent: #2d4a2d;
    --color-wizardofoz: #e63946;
    --color-wizardofoz-emerald: #50c878;
    --color-wizardofoz-ruby: #9b1b30;

    /* Enhanced Glow Effects */
    --glow-primary: 0 0 20px rgba(102, 126, 234, 0.4);
    --glow-accent: 0 0 20px rgba(240, 147, 251, 0.4);
    --glow-success: 0 0 20px rgba(0, 184, 148, 0.4);
    --glow-warning: 0 0 20px rgba(253, 203, 110, 0.4);
    --glow-jurassic: 0 0 25px rgba(244, 160, 32, 0.5);
    --glow-ruby: 0 0 25px rgba(230, 57, 70, 0.5);
    --glow-emerald: 0 0 25px rgba(80, 200, 120, 0.5);

    /* Typography */
    --font-primary: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 60px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-slower: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Z-Index Scale */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-popover: 500;
    --z-tooltip: 600;

    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 900px;
    --container-xl: 1200px;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Accessibility: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: inherit;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--space-4);
}

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

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

/* Focus styles for accessibility - Enhanced for visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 3px;
    box-shadow: var(--glow-primary);
    border-radius: var(--radius-sm);
}

/* Enhanced focus for game cards */
.game-card:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
    box-shadow: var(--glow-accent), var(--shadow-2xl);
}

/* Remove default focus outline when using mouse */
:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --color-gray-50: #1a1a2e;
        --color-gray-100: #16213e;
        --color-gray-200: #1f3a5f;
        --color-gray-700: #e0e0e0;
        --color-gray-800: #f0f0f0;
    }
}

/* Manual dark mode toggle class */
.dark-mode {
    --color-gray-50: #1a1a2e;
    --color-gray-100: #16213e;
    --color-gray-200: #1f3a5f;
    --color-gray-700: #e0e0e0;
    --color-gray-800: #f0f0f0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* 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;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-gray-900);
    color: var(--color-white);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

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

/* Color utilities */
.text-white { color: var(--color-white); }
.text-muted { color: var(--color-gray-500); }
.text-primary { color: var(--color-primary); }

/* Spacing utilities */
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-5);
    padding-right: var(--space-5);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* Page wrapper - standard page layout */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Mobile first approach */
/* sm: 640px, md: 768px, lg: 1024px, xl: 1280px */

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 1.875rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
    }

    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
    }
}
