/**
 * ==========================================================================
 * DESIGN TOKENS - Single Source of Truth
 * UGC Creator Analytics Platform
 * ==========================================================================
 *
 * This file contains all design tokens used throughout the application.
 * Import this file FIRST in your CSS to ensure consistent styling.
 *
 * Organization:
 * 1. Color Palette
 * 2. Typography
 * 3. Spacing
 * 4. Borders & Shadows
 * 5. Component-Specific Tokens
 * 6. Animation & Transitions
 * 7. Responsive Breakpoints (documented)
 */

/* ==========================================================================
   1. COLOR PALETTE - Light Theme (Default)
   ========================================================================== */
:root {
    /* ------------------------------------------------------------------
       Primary Brand Colors - Neo-Brutalist Palette
       ------------------------------------------------------------------ */
    --color-primary: #FF3366;
    --color-primary-hover: #E62958;
    --color-primary-light: #FF5C85;
    --color-primary-dark: #CC2952;

    --color-secondary: #6366F1;
    --color-secondary-hover: #4F46E5;
    --color-secondary-light: #8B8CFA;

    /* ------------------------------------------------------------------
       Accent Colors - High Impact
       ------------------------------------------------------------------ */
    --color-accent-yellow: #FFBE0B;
    --color-accent-cyan: #00F5FF;
    --color-accent-lime: #A7FF00;
    --color-accent-purple: #9D4EDD;

    /* ------------------------------------------------------------------
       Semantic Colors - Status & Feedback
       ------------------------------------------------------------------ */
    --color-success: #00E676;
    --color-success-hover: #00C853;
    --color-success-light: rgba(0, 230, 118, 0.15);

    --color-warning: #FFB300;
    --color-warning-hover: #FFA000;
    --color-warning-light: rgba(255, 179, 0, 0.15);

    --color-danger: #FF3366;
    --color-danger-hover: #E62958;
    --color-danger-light: rgba(255, 51, 102, 0.15);

    --color-info: #3B82F6;
    --color-info-hover: #2563EB;
    --color-info-light: rgba(59, 130, 246, 0.15);

    /* ------------------------------------------------------------------
       Background Colors
       ------------------------------------------------------------------ */
    --bg-primary: #FAFAFA;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #EBEBEB;
    --bg-navbar: #0A0A0A;
    --bg-footer: #0A0A0A;
    --bg-card: #FFFFFF;
    --bg-overlay: rgba(10, 10, 10, 0.85);

    /* ------------------------------------------------------------------
       Text Colors
       ------------------------------------------------------------------ */
    --text-primary: #0A0A0A;
    --text-secondary: #525252;
    --text-tertiary: #737373;
    --text-muted: #9CA3AF;
    --text-inverse: #FAFAFA;

    /* ------------------------------------------------------------------
       Border Colors
       ------------------------------------------------------------------ */
    --border-primary: #0A0A0A;
    --border-secondary: #262626;
    --border-light: #E5E5E5;
    --border-focus: #FF3366;

    /* ------------------------------------------------------------------
       Shadow Definitions
       ------------------------------------------------------------------ */
    --shadow-sm: 2px 2px 0px rgba(0, 0, 0, 0.1);
    --shadow-md: 4px 4px 0px rgba(0, 0, 0, 0.15);
    --shadow-lg: 8px 8px 0px rgba(0, 0, 0, 1);
    --shadow-xl: 12px 12px 0px rgba(0, 0, 0, 1);
    --shadow-hover: 12px 12px 0px rgba(255, 51, 102, 0.4), 12px 12px 0px rgba(0, 0, 0, 1);
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.1);

    /* ------------------------------------------------------------------
       Input & Form
       ------------------------------------------------------------------ */
    --input-bg: #FFFFFF;
    --input-border: #0A0A0A;
    --input-focus-shadow: 0 0 0 3px rgba(255, 51, 102, 0.2);
    --input-placeholder: #737373;
    --input-error-bg: rgba(255, 51, 102, 0.05);

    /* ------------------------------------------------------------------
       Table
       ------------------------------------------------------------------ */
    --table-bg: #FFFFFF;
    --table-header-bg: #0A0A0A;
    --table-row-hover: #FFF5F7;
    --table-row-alt: #FAFAFA;
    --table-border: #0A0A0A;

    /* ------------------------------------------------------------------
       Badge Colors
       ------------------------------------------------------------------ */
    --badge-success-bg: #00E676;
    --badge-success-text: #0A0A0A;
    --badge-warning-bg: #FFBE0B;
    --badge-warning-text: #0A0A0A;
    --badge-danger-bg: #FF3366;
    --badge-danger-text: #FFFFFF;
    --badge-info-bg: #6366F1;
    --badge-info-text: #FFFFFF;
}

/* ==========================================================================
   1b. COLOR PALETTE - Dark Theme
   ========================================================================== */
[data-theme="dark"] {
    /* Primary Brand Colors */
    --color-primary: #FF3366;
    --color-primary-hover: #FF5C85;
    --color-primary-light: #FF7AA3;
    --color-primary-dark: #CC2952;

    --color-secondary: #8B8CFA;
    --color-secondary-hover: #A5A6FB;
    --color-secondary-light: #B5B6FB;

    /* Accent Colors - Vivid Dark Mode */
    --color-accent-yellow: #FFD60A;
    --color-accent-cyan: #00F5FF;
    --color-accent-lime: #C8FF00;
    --color-accent-purple: #BB6BD9;

    /* Status Colors */
    --color-success: #00E676;
    --color-success-hover: #00FF8A;
    --color-warning: #FFBE0B;
    --color-warning-hover: #FFD60A;
    --color-danger: #FF3366;
    --color-danger-hover: #FF5C85;

    /* Background Colors */
    --bg-primary: #0A0A0A;
    --bg-secondary: #141414;
    --bg-tertiary: #1F1F1F;
    --bg-navbar: #000000;
    --bg-footer: #000000;
    --bg-card: #141414;
    --bg-overlay: rgba(0, 0, 0, 0.95);

    /* Text Colors */
    --text-primary: #FAFAFA;
    --text-secondary: #A3A3A3;
    --text-tertiary: #737373;
    --text-muted: #6B7280;
    --text-inverse: #0A0A0A;

    /* Border Colors */
    --border-primary: #FAFAFA;
    --border-secondary: #525252;
    --border-light: #262626;
    --border-focus: #FF3366;

    /* Shadow Definitions */
    --shadow-sm: 2px 2px 0px rgba(255, 255, 255, 0.03);
    --shadow-md: 4px 4px 0px rgba(255, 255, 255, 0.05);
    --shadow-lg: 8px 8px 0px rgba(255, 255, 255, 0.05);
    --shadow-xl: 12px 12px 0px rgba(255, 255, 255, 0.1);
    --shadow-hover: 12px 12px 0px rgba(255, 51, 102, 0.3), 12px 12px 0px rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.5);

    /* Input & Form */
    --input-bg: #1F1F1F;
    --input-border: #525252;
    --input-focus-shadow: 0 0 0 3px rgba(255, 51, 102, 0.3);
    --input-placeholder: #737373;
    --input-error-bg: rgba(255, 51, 102, 0.1);

    /* Table */
    --table-bg: #141414;
    --table-header-bg: #0A0A0A;
    --table-row-hover: #1F1F1F;
    --table-row-alt: #141414;
    --table-border: #525252;

    /* Badge Colors */
    --badge-success-bg: #00E676;
    --badge-success-text: #0A0A0A;
    --badge-warning-bg: #FFBE0B;
    --badge-warning-text: #0A0A0A;
    --badge-danger-bg: #FF3366;
    --badge-danger-text: #FFFFFF;
    --badge-info-bg: #8B8CFA;
    --badge-info-text: #0A0A0A;
}

/* ==========================================================================
   2. TYPOGRAPHY SCALE
   ========================================================================== */
:root {
    /* Font Families */
    --font-heading: 'Epilogue', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Monaco', 'Consolas', 'Courier New', 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.5rem;      /* 40px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.5rem;      /* 56px */

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

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

    /* Letter Spacing */
    --tracking-tighter: -0.04em;
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
}

/* ==========================================================================
   3. SPACING SCALE
   ========================================================================== */
:root {
    /* Spacing - 8px Base Grid */
    --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 */

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

/* ==========================================================================
   4. BORDERS & RADII
   ========================================================================== */
:root {
    /* Border Widths */
    --border-0: 0;
    --border-1: 1px;
    --border-2: 2px;
    --border-3: 3px;
    --border-4: 4px;
    --border-6: 6px;

    /* Border Radii - Neo-Brutalist uses 0 mostly */
    --radius-none: 0;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --radius-full: 9999px;
}

/* ==========================================================================
   5. COMPONENT-SPECIFIC TOKENS
   ========================================================================== */
:root {
    /* Button Sizes */
    --btn-padding-sm: 0.375rem 0.75rem;
    --btn-padding-md: 0.75rem 1.5rem;
    --btn-padding-lg: 1rem 2rem;
    --btn-font-size-sm: 0.8125rem;
    --btn-font-size-md: 0.875rem;
    --btn-font-size-lg: 1rem;

    /* Card Properties */
    --card-padding: 2rem;
    --card-border-width: 4px;

    /* Modal Properties */
    --modal-max-width: 600px;
    --modal-padding: 1.5rem;

    /* Toast Properties */
    --toast-max-width: 420px;
    --toast-min-width: 320px;

    /* Touch Target Minimum (WCAG 2.5.5) */
    --touch-target-min: 44px;

    /* Form Control Heights */
    --input-height-sm: 32px;
    --input-height-md: 40px;
    --input-height-lg: 48px;
}

/* ==========================================================================
   6. ANIMATION & TRANSITIONS
   ========================================================================== */
:root {
    /* Transition Durations */
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 700ms;

    /* Easing Functions */
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ==========================================================================
   7. RESPONSIVE BREAKPOINTS (Reference)
   ==========================================================================
   These are documented here for reference but should be used via media queries.

   --breakpoint-sm: 640px    Small devices (phones)
   --breakpoint-md: 768px    Medium devices (tablets)
   --breakpoint-lg: 1024px   Large devices (laptops)
   --breakpoint-xl: 1200px   Extra large devices (desktops)
   --breakpoint-2xl: 1400px  Extra extra large devices
   ========================================================================== */

/* ==========================================================================
   LEGACY VARIABLE ALIASES
   These map old variable names to the new design tokens for backwards compatibility.
   Gradually migrate away from these in favor of the new token names.
   ========================================================================== */
:root {
    /* Map legacy variables to new tokens */
    --primary-color: var(--color-primary);
    --primary-hover: var(--color-primary-hover);
    --primary-light: var(--color-primary-light);
    --secondary-color: var(--color-secondary);
    --secondary-hover: var(--color-secondary-hover);

    --success-color: var(--color-success);
    --success-hover: var(--color-success-hover);
    --warning-color: var(--color-warning);
    --warning-hover: var(--color-warning-hover);
    --danger-color: var(--color-danger);
    --danger-hover: var(--color-danger-hover);

    --accent-yellow: var(--color-accent-yellow);
    --accent-cyan: var(--color-accent-cyan);
    --accent-lime: var(--color-accent-lime);
    --accent-purple: var(--color-accent-purple);

    --card-bg: var(--bg-card);
    --card-shadow: var(--shadow-lg);
    --card-shadow-hover: var(--shadow-hover);
    --card-shadow-subtle: var(--shadow-md);
    --modal-overlay: var(--bg-overlay);
}

/* Dark theme legacy variable overrides */
[data-theme="dark"] {
    --card-shadow: var(--shadow-lg);
    --card-shadow-hover: var(--shadow-hover);
    --card-shadow-subtle: var(--shadow-md);
}

/* ==========================================================================
   HIGH CONTRAST MODE SUPPORT
   ========================================================================== */
@media (prefers-contrast: high) {
    :root {
        --border-primary: #000000;
        --border-focus: #0000FF;
        --color-success: #008800;
        --color-danger: #CC0000;
        --color-warning: #CC6600;
    }

    [data-theme="dark"] {
        --border-primary: #FFFFFF;
        --border-focus: #FFFF00;
    }
}

/* ==========================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-fast: 0.01ms;
        --duration-normal: 0.01ms;
        --duration-slow: 0.01ms;
        --duration-slower: 0.01ms;
    }
}
