@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   Design Tokens & CSS Variables
   ========================================================================== */
:root {
    /* Color Scales (HSL Model) */
    --primary-h: 224;
    --primary-s: 82%;
    --primary-l: 56%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-hover: hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);

    --accent-h: 262;
    --accent-s: 80%;
    --accent-l: 62%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-light: hsl(var(--accent-h), var(--accent-s), 95%);

    --success: hsl(142, 70%, 45%);
    --success-light: hsla(142, 70%, 45%, 0.1);
    --warning: hsl(37, 90%, 50%);
    --warning-light: hsla(37, 90%, 50%, 0.1);
    --danger: hsl(347, 84%, 54%);
    --danger-light: hsla(347, 84%, 54%, 0.1);
    --info: hsl(199, 89%, 48%);
    --info-light: hsla(199, 89%, 48%, 0.1);

    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Theme defaults: Light Mode */
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    
    --border-color: #e2e8f0;
    --border-card: #f1f5f9;
    --border-sidebar: #e2e8f0;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --text-sidebar: #334155;
    --text-sidebar-muted: #64748b;
    --sidebar-hover-bg: rgba(37, 99, 235, 0.08);
    --sidebar-hover-color: var(--primary);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 10px 25px -5px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout Sizes */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
}

/* Theme overrides: Dark Mode */
[data-theme="dark"] {
    --bg-app: #0b0f19;
    --bg-card: #121826;
    --bg-sidebar: #121826;
    --bg-header: rgba(18, 24, 38, 0.85);
    
    --border-color: #1e293b;
    --border-card: #1f293d;
    --border-sidebar: #1e293b;
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    --text-sidebar: #cbd5e1;
    --text-sidebar-muted: #64748b;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-hover-color: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 10px 25px -5px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
    
    --primary-light: hsl(var(--primary-h), var(--primary-s), 15%);
    --accent-light: hsl(var(--accent-h), var(--accent-s), 15%);
}

/* ==========================================================================
   Base Resets
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--bg-app);
    overflow-x: hidden;
    scroll-behavior: smooth;
    transition: background-color var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-main);
}

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

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: transparent;
    border: none;
    outline: none;
}

ul {
    list-style: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.m-0 { margin: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.pointer { cursor: pointer; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }

/* Backdrop Blur Glass Utilities */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Hidden utilities */
.hidden { display: none !important; }
