/*
 * ═══════════════════════════════════════════════════════
 *  LOCAL ISSUE TRACKER — Design System
 *  Core variables, typography, and utilities
 * ═══════════════════════════════════════════════════════
 */

/* ─── Google Fonts ───────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Custom Properties (Dark Mode Default) ──────── */
:root {
    /* Brand */
    --color-brand: #818cf8;
    --color-brand-light: #a5b4fc;
    --color-brand-dark: #6366f1;
    --color-brand-glow: rgba(129, 140, 248, 0.15);

    /* Surfaces */
    --color-bg-root: #0f1117;
    --color-bg-primary: #161822;
    --color-bg-secondary: #1e2030;
    --color-bg-tertiary: #252840;
    --color-bg-elevated: #1e2030;
    --color-bg-glass: rgba(30, 32, 48, 0.75);

    /* Borders */
    --color-border: rgba(255, 255, 255, 0.06);
    --color-border-hover: rgba(255, 255, 255, 0.12);
    --color-border-active: var(--color-brand);

    /* Text */
    --color-text-primary: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-text-tertiary: #64748b;
    --color-text-inverse: #0f1117;

    /* Status colours */
    --color-success: #34d399;
    --color-warning: #fbbf24;
    --color-error: #f87171;
    --color-info: #60a5fa;

    /* Priority colours */
    --color-priority-low: #94a3b8;
    --color-priority-medium: #60a5fa;
    --color-priority-high: #fb923c;
    --color-priority-urgent: #f87171;

    /* Status badge colours */
    --color-status-new: #818cf8;
    --color-status-progress: #60a5fa;
    --color-status-waiting: #fbbf24;
    --color-status-resolved: #34d399;
    --color-status-closed: #64748b;

    /* Category colours (matching DB seed) */
    --cat-highways: #ef4444;
    --cat-planning: #f59e0b;
    --cat-environment: #22c55e;
    --cat-housing: #3b82f6;
    --cat-social: #8b5cf6;
    --cat-footpaths: #14b8a6;
    --cat-city-centre: #ec4899;
    --cat-car-parks: #64748b;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px var(--color-brand-glow);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --container-max: 1200px;
}

/* ─── Light Mode ─────────────────────────────────────── */
[data-theme="light"] {
    --color-bg-root: #f1f5f9;
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8fafc;
    --color-bg-tertiary: #e2e8f0;
    --color-bg-elevated: #ffffff;
    --color-bg-glass: rgba(255, 255, 255, 0.85);

    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-hover: rgba(0, 0, 0, 0.15);

    --color-text-primary: #1e293b;
    --color-text-secondary: #475569;
    --color-text-tertiary: #94a3b8;
    --color-text-inverse: #ffffff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-bg-root);
    min-height: 100vh;
}

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

a:hover {
    color: var(--color-brand);
}

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

/* ─── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-mono { font-family: var(--font-mono); }

/* ─── Scrollbar Styling ──────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-tertiary);
}

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