/*
 * BrainBoost - Base Stylesheet
 * Contains design tokens, typography, global utilities, and resets
 * Version: 2.0
 * Last Updated: 2026-02-01
 */

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Colors - Primary Palette */
    --bb-primary: #2f56ff;
    --bb-primary-hover: #2447e8;
    --bb-primary-light: #e6ecff;
    --bb-accent: #f4b740;

    /* Colors - Secondary */
    --bb-secondary: #0f766e;
    --bb-secondary-hover: #0b5f59;

    /* Colors - Neutral */
    --bb-gray-50: #f8fafc;
    --bb-gray-100: #f1f5f9;
    --bb-gray-200: #e2e8f0;
    --bb-gray-300: #cbd5e1;
    --bb-gray-400: #94a3b8;
    --bb-gray-500: #64748b;
    --bb-gray-600: #475569;
    --bb-gray-700: #334155;
    --bb-gray-800: #1f2937;
    --bb-gray-900: #0f172a;

    /* Colors - Semantic */
    --bb-success: #16a34a;
    --bb-warning: #f59e0b;
    --bb-error: #ef4444;
    --bb-info: #0ea5e9;

    /* Surfaces */
    --bb-surface: #ffffff;
    --bb-surface-muted: #f5f7fb;
    --bb-surface-strong: #eef2ff;

    /* Typography */
    --bb-font-sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --bb-font-display: 'Fraunces', 'Times New Roman', serif;
    --bb-font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

    /* Font Sizes */
    --bb-text-xs: 0.75rem;      /* 12px */
    --bb-text-sm: 0.875rem;     /* 14px */
    --bb-text-base: 1rem;       /* 16px */
    --bb-text-lg: 1.125rem;     /* 18px */
    --bb-text-xl: 1.25rem;      /* 20px */
    --bb-text-2xl: 1.5rem;      /* 24px */
    --bb-text-3xl: 1.875rem;    /* 30px */
    --bb-text-4xl: 2.375rem;    /* 38px */
    --bb-text-5xl: 3rem;        /* 48px */

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

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

    /* Border Radius */
    --bb-radius-sm: 10px;
    --bb-radius: 18px;
    --bb-radius-lg: 28px;
    --bb-radius-full: 9999px;

    /* Shadows */
    --bb-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --bb-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    --bb-shadow-md: 0 10px 28px rgba(15, 23, 42, 0.12);
    --bb-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.16);
    --bb-shadow-xl: 0 28px 60px rgba(15, 23, 42, 0.2);

    /* Transitions */
    --bb-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --bb-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --bb-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --bb-page-max: 1200px;
    --bb-hero-gradient: linear-gradient(135deg, #2435c2 0%, #2f56ff 45%, #3aa1ff 100%);
    --bb-card-border: 1px solid rgba(15, 23, 42, 0.08);

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

/* ========================================
   Global Resets & Base Styles
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--bb-font-sans);
    font-size: var(--bb-text-base);
    font-weight: var(--bb-font-normal);
    line-height: 1.6;
    color: var(--bb-gray-900);
    background-color: var(--bb-surface-muted);
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--bb-space-4);
    font-weight: var(--bb-font-bold);
    line-height: 1.2;
    color: var(--bb-gray-900);
    font-family: var(--bb-font-display);
}

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

h2 {
    font-size: var(--bb-text-3xl);
}

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

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

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

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

p {
    margin-top: 0;
    margin-bottom: var(--bb-space-4);
    color: var(--bb-gray-700);
}

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

a:hover {
    color: var(--bb-primary-hover);
    text-decoration: underline;
}

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

/* Spacing Utilities */
.mt-1 { margin-top: var(--bb-space-1); }
.mt-2 { margin-top: var(--bb-space-2); }
.mt-3 { margin-top: var(--bb-space-3); }
.mt-4 { margin-top: var(--bb-space-4); }
.mt-6 { margin-top: var(--bb-space-6); }
.mt-8 { margin-top: var(--bb-space-8); }

.mb-1 { margin-bottom: var(--bb-space-1); }
.mb-2 { margin-bottom: var(--bb-space-2); }
.mb-3 { margin-bottom: var(--bb-space-3); }
.mb-4 { margin-bottom: var(--bb-space-4); }
.mb-6 { margin-bottom: var(--bb-space-6); }
.mb-8 { margin-bottom: var(--bb-space-8); }

.p-2 { padding: var(--bb-space-2); }
.p-3 { padding: var(--bb-space-3); }
.p-4 { padding: var(--bb-space-4); }
.p-6 { padding: var(--bb-space-6); }

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

.text-sm { font-size: var(--bb-text-sm); }
.text-base { font-size: var(--bb-text-base); }
.text-lg { font-size: var(--bb-text-lg); }
.text-xl { font-size: var(--bb-text-xl); }

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

.text-gray-500 { color: var(--bb-gray-500); }
.text-gray-600 { color: var(--bb-gray-600); }
.text-gray-700 { color: var(--bb-gray-700); }
.text-gray-900 { color: var(--bb-gray-900); }

.text-primary { color: var(--bb-primary); }
.text-success { color: var(--bb-success); }
.text-warning { color: var(--bb-warning); }
.text-error { color: var(--bb-error); }

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

/* Flexbox Utilities */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: var(--bb-space-2); }
.gap-3 { gap: var(--bb-space-3); }
.gap-4 { gap: var(--bb-space-4); }

/* Border Radius Utilities */
.rounded { border-radius: var(--bb-radius); }
.rounded-sm { border-radius: var(--bb-radius-sm); }
.rounded-lg { border-radius: var(--bb-radius-lg); }
.rounded-full { border-radius: var(--bb-radius-full); }

/* Shadow Utilities */
.shadow { box-shadow: var(--bb-shadow); }
.shadow-sm { box-shadow: var(--bb-shadow-sm); }
.shadow-md { box-shadow: var(--bb-shadow-md); }
.shadow-lg { box-shadow: var(--bb-shadow-lg); }

/* Background Utilities */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: var(--bb-gray-50); }
.bg-gray-100 { background-color: var(--bb-gray-100); }
.bg-primary { background-color: var(--bb-primary); }
.bg-success { background-color: var(--bb-success); }

/* Hover Effects */
.hover-lift {
    transition: transform var(--bb-transition-base), box-shadow var(--bb-transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--bb-shadow-lg);
}

/* Container */
.container-custom {
    width: 100%;
    max-width: var(--bb-page-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--bb-space-4);
    padding-right: var(--bb-space-4);
}

/* Page helpers */
.bb-page {
    padding-top: 2.5rem;
}

.bb-section {
    padding: var(--bb-space-12) 0;
}

.bb-surface {
    background-color: var(--bb-surface);
    border: var(--bb-card-border);
    border-radius: var(--bb-radius-lg);
    box-shadow: var(--bb-shadow-sm);
}

.bb-gradient-text {
    background: var(--bb-hero-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

@media (min-width: 768px) {
    .container-custom {
        padding-left: var(--bb-space-6);
        padding-right: var(--bb-space-6);
    }
}
