import type { Config } from 'tailwindcss';
import tailwindcssAnimate from 'tailwindcss-animate';

const config: Config = {
  darkMode: ['class'],
  content: ['./app/**/*.{ts,tsx}', './components/**/*.{ts,tsx}', './lib/**/*.{ts,tsx}'],
  theme: {
    extend: {
      fontFamily: {
        sans: ['var(--font-inter)', 'system-ui', 'sans-serif'],
        mono: ['var(--font-jetbrains-mono)', 'ui-monospace', 'SFMono-Regular', 'monospace'],
      },
      fontSize: {
        ticker: ['0.8125rem', { lineHeight: '1', letterSpacing: '0.01em' }],
        'data-sm': ['0.75rem', { lineHeight: '1.2' }],
        'data-md': ['0.875rem', { lineHeight: '1.3' }],
        'data-lg': ['1.25rem', { lineHeight: '1.2' }],
        'heading-xs': ['0.75rem', { lineHeight: '1rem', letterSpacing: '0.08em' }],
        'heading-sm': ['0.875rem', { lineHeight: '1.25rem' }],
        'heading-md': ['1.125rem', { lineHeight: '1.5rem' }],
        'heading-lg': ['1.5rem', { lineHeight: '1.875rem' }],
        'heading-xl': ['1.875rem', { lineHeight: '2.25rem' }],
      },
      spacing: {
        cell: '0.5rem',
        row: '2.25rem',
        'row-compact': '2rem',
        'row-roomy': '2.75rem',
        'ticker-bar': '2rem',
        'header-compact': '3rem',
        sidebar: '15rem',
        'sidebar-collapsed': '3.5rem',
      },
      colors: {
        border: 'hsl(var(--border))',
        'border-strong': 'hsl(var(--border-strong))',
        input: 'hsl(var(--input))',
        ring: 'hsl(var(--ring))',
        background: {
          DEFAULT: 'hsl(var(--background))',
          elevated: 'hsl(var(--background-elevated))',
          surface: 'hsl(var(--background-surface))',
        },
        foreground: {
          DEFAULT: 'hsl(var(--foreground))',
          muted: 'hsl(var(--foreground-muted))',
          dim: 'hsl(var(--foreground-dim))',
        },
        primary: {
          DEFAULT: 'hsl(var(--primary))',
          foreground: 'hsl(var(--primary-foreground))',
          hover: 'hsl(var(--primary-hover))',
        },
        secondary: {
          DEFAULT: 'hsl(var(--secondary))',
          foreground: 'hsl(var(--secondary-foreground))',
        },
        destructive: {
          DEFAULT: 'hsl(var(--destructive))',
          foreground: 'hsl(var(--destructive-foreground))',
        },
        muted: {
          DEFAULT: 'hsl(var(--muted))',
          foreground: 'hsl(var(--muted-foreground))',
        },
        accent: {
          DEFAULT: 'hsl(var(--accent))',
          foreground: 'hsl(var(--accent-foreground))',
          blue: 'hsl(var(--accent-blue))',
          purple: 'hsl(var(--accent-purple))',
        },
        card: {
          DEFAULT: 'hsl(var(--card))',
          foreground: 'hsl(var(--card-foreground))',
        },
        signal: {
          up: 'hsl(var(--signal-up))',
          'up-bg': 'hsl(var(--signal-up-bg) / 0.1)',
          down: 'hsl(var(--signal-down))',
          'down-bg': 'hsl(var(--signal-down-bg) / 0.1)',
          neutral: 'hsl(var(--signal-neutral))',
          'neutral-bg': 'hsl(var(--signal-neutral-bg) / 0.1)',
        },
        success: 'hsl(var(--success))',
        warning: 'hsl(var(--warning))',
        chart: {
          1: 'hsl(var(--chart-1))',
          2: 'hsl(var(--chart-2))',
          3: 'hsl(var(--chart-3))',
          4: 'hsl(var(--chart-4))',
          5: 'hsl(var(--chart-5))',
          6: 'hsl(var(--chart-6))',
        },
      },
      borderRadius: {
        lg: 'var(--radius)',
        md: 'calc(var(--radius) - 2px)',
        sm: 'calc(var(--radius) - 4px)',
        pill: '9999px',
      },
      boxShadow: {
        'elevation-0': 'none',
        'elevation-1': '0 1px 2px rgba(0,0,0,.30), 0 0 0 1px hsl(var(--border))',
        'elevation-2': '0 4px 12px rgba(0,0,0,.40)',
        'elevation-3': '0 12px 32px rgba(0,0,0,.50)',
        'glow-up': '0 0 0 1px hsl(var(--signal-up) / .4), 0 0 12px hsl(var(--signal-up) / .25)',
        'glow-down': '0 0 0 1px hsl(var(--signal-down) / .4), 0 0 12px hsl(var(--signal-down) / .25)',
      },
      transitionTimingFunction: {
        standard: 'cubic-bezier(.2,0,0,1)',
        emphasized: 'cubic-bezier(.3,0,0,1)',
      },
      transitionDuration: {
        '80': '80ms',
        '240': '240ms',
      },
      zIndex: {
        'sticky-header': '30',
        'app-header': '40',
        ticker: '45',
        dropdown: '50',
        modal: '60',
        toast: '70',
      },
    },
  },
  plugins: [tailwindcssAnimate],
};

export default config;
