/* ============ Reset ============ */

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

/* ============ CSS Custom Properties ============ */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --primary-subtle: rgba(99, 102, 241, 0.08);
    --accent: #06b6d4;
    --accent-light: #ecfeff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --error: #ef4444;
    --error-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
    --sidebar-width: 260px;
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
}

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

/* ============ Loading Screen ============ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--text-secondary);
    gap: 0.5rem;
}

.loading__text {
    font-size: 0.9375rem;
    font-weight: 500;
}

.loading__sub {
    font-size: 0.8125rem;
    opacity: 0.6;
}

.loading__spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
    .loading__spinner {
        animation: spin 0.8s linear infinite;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============ Blazor Error UI ============ */

#blazor-error-ui {
    display: none;
    background: var(--error-light);
    color: var(--error);
    padding: 0.75rem 1.25rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    text-align: center;
    font-size: 0.875rem;
}

#blazor-error-ui .reload {
    margin-left: 0.5rem;
    color: var(--error);
    font-weight: 600;
}

/* ============ Utilities ============ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.gap-sm { gap: 0.375rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-sm { font-size: 0.8125rem; }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.w-full { width: 100%; }
