/* ===========================================
   Base Styles
   Variables, resets, typography, dark mode
   =========================================== */

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

:root {
    /* Core colors */
    --color-bg: #f8f9fa;
    --color-text: #1a1a1a;
    --color-text-muted: #5b6370;
    --color-accent: #2563eb;
    --color-accent-light: #dbeafe;
    --color-border: #e5e7eb;
    --color-card-bg: #ffffff;
    --color-control-bg: #f3f4f6;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-accent-hover: #1d4ed8;
    --color-success-hover: #059669;

    /* Additional color variants for consistency */
    --color-accent-medium: #3b82f6;
    --color-error-hover: #dc2626;
    --color-warning-hover: #d97706;
    --color-dark-bg: #0a0a0a;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Layout */
    --max-width: 1400px;

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

    /* Shadows */
    --shadow-sm: 0 1px 2px 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);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;

    /* Breakpoints (reference for media queries):
     * Mobile: 640px
     * Tablet: 1024px
     * Wide: 1400px
     */
}

/* Dark mode theme */
[data-theme="dark"] {
    --color-bg: #111827;
    --color-text: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-accent: #bfdbfe;
    --color-accent-light: rgba(191, 219, 254, 0.15);
    --color-border: #374151;
    --color-card-bg: #1f2937;
    --color-control-bg: #374151;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}

body {
    font-family: var(--font-family);
    background:
        radial-gradient(ellipse at 15% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 45%),
        var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

[data-theme="dark"] body {
    background:
        radial-gradient(ellipse at 15% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 45%),
        var(--color-bg);
}

/* Hero section */
.hero {
    margin-bottom: var(--spacing-xl);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.hero .subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
}

/* Page header */
.page-header {
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-xs);
    color: var(--color-text);
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

/* Status indicator */
.status {
    margin-top: var(--spacing-lg);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #f59e0b;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-to-content:focus {
    top: 0;
    opacity: 1;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-xl: 3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }
}
