/**
 * FundStat Design System
 * Core variables, resets, and base styles
 */

/* ============================================================================
   CSS Variables
   ========================================================================= */

:root {
    /* Purple Color Palette */
    --purple-50: #faf7fc;
    --purple-100: #f0e9f7;
    --purple-200: #deccec;
    --purple-300: #c5a8dd;
    --purple-400: #a881c9;
    --purple-500: #8b5fb8;
    --purple-600: #6d459a;
    --purple-700: #533375;
    --purple-800: #3d2658;
    --purple-900: #2a1a3d;

    /* Semantic Colors */
    --color-primary: var(--purple-500);
    --color-primary-dark: var(--purple-700);
    --color-text: var(--purple-900);
    --color-text-light: var(--purple-700);
    --color-text-muted: var(--purple-600);

    /* Status Colors */
    --green: #00C853;
    --red: #FF1744;
    --color-positive: var(--green);
    --color-negative: var(--red);

    /* Gray Colors */
    --gray-400: #c0c0c0;
    --gray-600: #6e6e6e;

    /* Background Colors */
    --bg-body: linear-gradient(135deg, var(--purple-50) 0%, #ffffff 100%);
    --bg-card: #ffffff;
    --bg-input: var(--purple-50);
    --bg-hover: var(--purple-50);

    /* Border Colors */
    --border-light: var(--purple-100);
    --border-medium: var(--purple-200);
    --border-strong: var(--purple-300);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(107, 69, 154, 0.05);
    --shadow-md: 0 2px 8px rgba(107, 69, 154, 0.08), 0 0 0 1px var(--purple-100);
    --shadow-lg: 0 8px 24px rgba(107, 69, 154, 0.15), 0 0 0 1px var(--purple-200);
    --shadow-hover: 0 8px 16px rgba(107, 69, 154, 0.25);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Spacing Scale */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */

    /* Typography */
    --font-body: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Font Sizes */
    --text-xs: 0.6875rem;  /* 11px */
    --text-sm: 0.75rem;    /* 12px */
    --text-base: 0.875rem; /* 14px */
    --text-md: 0.9375rem;  /* 15px */
    --text-lg: 1rem;       /* 16px */
    --text-xl: 1.125rem;   /* 18px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 2rem;      /* 32px */
    --text-4xl: 2.5rem;    /* 40px */

    /* Font Weights */
    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-index Scale */
    --z-dropdown: 50;
    --z-sticky: 100;
    --z-modal: 1000;
    --z-tooltip: 1100;

    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1400px;
    --container-2xl: 1600px;
}

/* ============================================================================
   CSS Reset & Base Styles
   ========================================================================= */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    background: var(--bg-body);
    color: var(--color-text);
    min-height: 100vh;
    font-size: var(--text-md);
    line-height: var(--leading-normal);
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    color: var(--color-text);
    line-height: var(--leading-tight);
}

h1 {
    font-size: var(--text-4xl);
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--text-3xl);
    letter-spacing: -0.02em;
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-md);
}

p {
    margin-bottom: var(--space-md);
}

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

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

/* Monospace elements */
.mono,
code,
pre,
.font-mono {
    font-family: var(--font-mono);
}

/* ============================================================================
   Utility Classes
   ========================================================================= */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-2xl);
}

@media (max-width: 768px) {
    .container {
        padding: 1.25rem;
    }
}

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.text-positive { color: var(--color-positive); }
.text-negative { color: var(--color-negative); }

/* Spacing Utilities */
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox Utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ============================================================================
   Animations
   ========================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out backwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Staggered Animation Delays */
.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }
.animate-delay-5 { animation-delay: 0.25s; }
.animate-delay-6 { animation-delay: 0.3s; }

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

@media (max-width: 768px) {
    .mobile-hidden { display: none; }
    .desktop-hidden { display: block; }
}

@media (min-width: 769px) {
    .mobile-hidden { display: block; }
    .desktop-hidden { display: none; }
}
