/* ============================================================
   ImpactMate v2 — Design System
   Single source of truth for design tokens
   ============================================================ */

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

/* ─── Root Design Tokens ─── */
:root {
    /* ── Brand Colors ── */
    --primary:          #6256CA;
    --primary-dark:     #4A3FB0;
    --primary-darker:   #3A3196;
    --primary-light:    #7B71D4;
    --primary-lighter:  #E8E5F8;
    --primary-subtle:   #F4F3FC;

    /* ── Secondary ── */
    --secondary:        #0F1F3E;
    --secondary-light:  #1A2E54;
    --secondary-lighter:#2A4270;

    /* ── Accent ── */
    --accent:           #FBB041;
    --accent-dark:      #E89D2E;
    --accent-light:     #FCC370;
    --accent-lighter:   #FFF3E0;

    /* ── Semantic Colors ── */
    --success:          #10B981;
    --success-light:    #D1FAE5;
    --warning:          #F59E0B;
    --warning-light:    #FEF3C7;
    --danger:           #EF4444;
    --danger-light:     #FEE2E2;
    --info:             #3B82F6;
    --info-light:       #DBEAFE;

    /* ── Neutral / Gray Scale ── */
    --gray-50:          #F9FAFB;
    --gray-100:         #F3F4F6;
    --gray-200:         #E5E7EB;
    --gray-300:         #D1D5DB;
    --gray-400:         #9CA3AF;
    --gray-500:         #6B7280;
    --gray-600:         #4B5563;
    --gray-700:         #374151;
    --gray-800:         #1F2937;
    --gray-900:         #111827;

    /* ── Text Colors ── */
    --text-primary:     #111827;
    --text-secondary:   #4B5563;
    --text-tertiary:    #9CA3AF;
    --text-inverse:     #FFFFFF;
    --text-link:        var(--primary);
    --text-link-hover:  var(--primary-dark);

    /* ── Background Colors ── */
    --bg-body:          #F9FAFB;
    --bg-white:         #FFFFFF;
    --bg-surface:       #FFFFFF;
    --bg-surface-hover: #F3F4F6;
    --bg-overlay:       rgba(17, 24, 39, 0.5);

    /* ── Typography ── */
    --font-heading:     'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes — modular scale (1.25 ratio) */
    --text-xs:          0.75rem;    /* 12px */
    --text-sm:          0.875rem;   /* 14px */
    --text-base:        1rem;       /* 16px */
    --text-lg:          1.125rem;   /* 18px */
    --text-xl:          1.25rem;    /* 20px */
    --text-2xl:         1.5rem;     /* 24px */
    --text-3xl:         1.875rem;   /* 30px */
    --text-4xl:         2.25rem;    /* 36px */
    --text-5xl:         3rem;       /* 48px */

    /* Font Weights */
    --font-light:       300;
    --font-regular:     400;
    --font-medium:      500;
    --font-semibold:    600;
    --font-bold:        700;
    --font-extrabold:   800;

    /* Line Heights */
    --leading-none:     1;
    --leading-tight:    1.25;
    --leading-snug:     1.375;
    --leading-normal:   1.5;
    --leading-relaxed:  1.625;
    --leading-loose:    2;

    /* ── Spacing Scale ── */
    --space-0:          0;
    --space-1:          0.25rem;    /* 4px */
    --space-2:          0.5rem;     /* 8px */
    --space-3:          0.75rem;    /* 12px */
    --space-4:          1rem;       /* 16px */
    --space-5:          1.25rem;    /* 20px */
    --space-6:          1.5rem;     /* 24px */
    --space-8:          2rem;       /* 32px */
    --space-10:         2.5rem;     /* 40px */
    --space-12:         3rem;       /* 48px */
    --space-16:         4rem;       /* 64px */
    --space-20:         5rem;       /* 80px */
    --space-24:         6rem;       /* 96px */

    /* ── Border Radius ── */
    --radius-sm:        0.25rem;    /* 4px */
    --radius-md:        0.5rem;     /* 8px */
    --radius-lg:        0.75rem;    /* 12px */
    --radius-xl:        1rem;       /* 16px */
    --radius-2xl:       1.5rem;     /* 24px */
    --radius-full:      9999px;

    /* ── Box Shadows ── */
    --shadow-xs:        0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --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);
    --shadow-xl:        0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl:       0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner:     inset 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-primary:   0 4px 14px rgba(98, 86, 202, 0.35);

    /* ── 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);
    --transition-spring:    500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ── Z-Index Scale ── */
    --z-dropdown:       1000;
    --z-sticky:         1020;
    --z-fixed:          1030;
    --z-modal-backdrop: 1040;
    --z-modal:          1050;
    --z-popover:        1060;
    --z-tooltip:        1070;

    /* ── Layout ── */
    --container-max:    1400px;
    --sidebar-width:    250px;
    --sidebar-collapsed:70px;
    --topbar-height:    70px;
}


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

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-top: 0;
}

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

p {
    margin-top: 0;
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

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

a:hover {
    color: var(--text-link-hover);
}

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

/* ─── Focus Styles (Accessibility) ─── */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ─── Selection ─── */
::selection {
    background-color: var(--primary-lighter);
    color: var(--primary-dark);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
