/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Sora:wght@400;500;600;700&family=Barlow:wght@400;500;600;700&display=swap');

/**
 * ITS Design System Tokens
 * Version 2.0.0
 *
 * Modern, minimal, stunning design tokens for consistent UI
 * Supports multiple themes via [data-theme] attribute
 */

:root,
[data-theme="default"] {
  /* ===== COLOR PALETTE ===== */

  /* Background Layers */
  --surface-base: #0A0A0B;
  --surface-raised: #141416;
  --surface-overlay: #1C1C1F;
  --surface-hover: #232327;

  /* Borders & Dividers */
  --border-subtle: #26262B;
  --border-default: #35353A;
  --border-emphasis: #4A4A50;

  /* Text Hierarchy */
  --text-primary: #FFFFFF;
  --text-secondary: #B4B4B8;
  --text-tertiary: #6E6E73;
  --text-disabled: #48484D;

  /* ===== BRAND COLOR SYSTEM V2 (Brand Primary) ===== */
  /* Two-color brand system with complementary accents (ITS-P0-045) */
  --brand-a: #7900C9;  /* Brand Purple (primary) */
  --brand-b: #0088FF;  /* Brand Blue (secondary) */

  /* Complementary Accents - Lighter vivid variants for borders, highlights, contrast */
  --complement-purple: #9b51e0;  /* Vivid Purple - lighter accent */
  --complement-cyan: #0693e3;    /* Vivid Cyan - bright accent */

  /* Primary Brand (GitKraken Purple) - Generated from --brand-a (#7900C9) */
  --primary-50: #F3E6FC;
  --primary-100: #E7CDF9;
  --primary-200: #D09DF3;
  --primary-300: #B86CED;
  --primary-400: #9D36E2;
  --primary-500: #7900C9;
  --primary-600: #6C00BA;
  --primary-700: #5B00A3;
  --primary-800: #49008C;
  --primary-900: #360070;

  /* Success (Emerald) */
  --success-400: #34D399;
  --success-500: #10B981;
  --success-600: #059669;

  /* Warning (Amber) */
  --warning-400: #FBBF24;
  --warning-500: #F59E0B;
  --warning-600: #D97706;

  /* Danger (Red) */
  --danger-400: #F87171;
  --danger-500: #EF4444;
  --danger-600: #DC2626;

  /* Info (GitKraken Blue) - Generated from --brand-b (#0088FF) */
  --info-400: #3DA5FF;
  --info-500: #0088FF;
  --info-600: #0076E8;

  /* Political Party Colors */
  --party-democrat: #3B82F6;
  --party-republican: #EF4444;
  --party-independent: #94A3B8;

  /* Accent (Secondary Brand) - Derived from --brand-a */
  --accent-400: #9D36E2;
  --accent-500: #7900C9;
  --accent-600: #6C00BA;

  /* Hero Gradient (for headline text) - GitKraken Style: Purple → Blue */
  --hero-gradient-start: #7900C9;  /* GitKraken Purple (brand-a) */
  --hero-gradient-end: #0088FF;    /* GitKraken Blue (brand-b) */
  --hero-gradient-angle: 302deg;

  /* GitKraken-Style Gradients (Theme-Aware) */
  --gradient-button-start: var(--brand-b);  /* #0088FF Blue */
  --gradient-button-end: var(--brand-a);    /* #7900C9 Purple */
  --gradient-button: linear-gradient(302deg, var(--brand-b) -118.6%, var(--brand-a) 58.3%);
  --gradient-button-hover: linear-gradient(302deg, var(--info-600) -118.6%, var(--primary-600) 58.3%);
  --gradient-border: linear-gradient(301.69deg, var(--brand-b) -118.6%, var(--brand-a) 58.3%);

  /* Semantic Complementary Color Uses */
  --border-accent: var(--complement-purple);     /* Borders that need pop */
  --border-accent-hover: var(--complement-cyan); /* Hover state contrast */
  --text-accent: var(--complement-purple);       /* Highlighted text */
  --badge-accent: var(--complement-cyan);        /* Badge backgrounds */
  --pill-border: var(--complement-purple);       /* Pill/chip borders */
  --focus-ring-alt: var(--complement-cyan);      /* Alternate focus states */

  /* Chart Palette - Optimized for dark backgrounds */
  --chart-primary: #8E1AD6;        /* Brighter variant of GitKraken purple */
  --chart-buy: #10B981;            /* Fixed: Emerald (never themed) */
  --chart-sell: #EF4444;           /* Fixed: Red (never themed) */
  --chart-neutral: #6B7280;        /* Fixed: Gray */
  --chart-grid: #26262B;
  --chart-axis: #48484D;

  /* Chart Bar Fill - GitKraken purple → Complementary purple gradient */
  --chart-bar-fill-start: #7900C9;  /* GitKraken Purple (brand-a) */
  --chart-bar-fill-end: #9b51e0;    /* Complementary purple (lighter) */

  /* ===== RGB DECOMPOSITIONS (for opacity support) ===== */
  /* These allow rgba(var(--color-rgb), opacity) syntax for theme-aware transparency */
  --primary-500-rgb: 121, 0, 201;      /* GitKraken Purple */
  --primary-300-rgb: 184, 108, 237;    /* Lighter purple */
  --primary-400-rgb: 157, 54, 226;     /* Medium purple */
  --surface-base-rgb: 10, 10, 11;      /* Base background */
  --surface-raised-rgb: 20, 20, 22;    /* Raised surface */
  --surface-overlay-rgb: 28, 28, 31;   /* Overlay surface */
  --text-primary-rgb: 255, 255, 255;   /* White text */
  --text-secondary-rgb: 180, 180, 184; /* Secondary gray text */
  --text-tertiary-rgb: 110, 110, 115;  /* Tertiary gray text */
  --border-default-rgb: 53, 53, 58;    /* Default border */
  --border-subtle-rgb: 38, 38, 43;     /* Subtle border */

  /* ===== TYPOGRAPHY ===== */

  /* Font Families */
  --font-display: 'Nulshock', system-ui, sans-serif; /* Display font: Hero titles, logo, big headings */
  --font-sans: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif; /* Body font: Subtitles, paragraphs, UI */
  --font-mono: "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono", monospace;

  /* Type Scale - Display Tier (Heroes, large titles) */
  --text-4xl: 2.25rem;    /* 36px */
  --text-3xl: 1.875rem;   /* 30px */

  /* Type Scale - Content Tier (Headers, body, UI) */
  --text-3xl-content: 1.875rem; /* 30px - content version for h2 */
  --text-2xl: 1.5rem;     /* 24px */
  --text-xl: 1.25rem;     /* 20px */
  --text-lg: 1.125rem;    /* 18px */
  --text-base: 0.9375rem; /* 15px */

  /* Type Scale - Small Tier */
  --text-sm: 0.875rem;      /* 14px */
  --text-xs: 0.8125rem;     /* 13px */
  --text-2xs: 0.75rem;      /* 12px */

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

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.4;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Letter Spacing */
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;

  /* Hero Text Sizes (extra large, responsive) */
  --text-hero-sm: 2.55rem;  /* 40.8px */
  --text-hero-md: 3rem;     /* 48px */
  --text-hero-lg: 3.75rem;  /* 60px */
  --text-hero-xl: 4.5rem;   /* 72px */

  /* Heading Text Sizes (semantic heading scale) */
  --text-heading-4xl: 2.25rem;  /* 36px - h1 large */
  --text-heading-3xl: 1.875rem; /* 30px - h1 */
  --text-heading-2xl: 1.5rem;   /* 24px - h2 */
  --text-heading-xl: 1.25rem;   /* 20px - h3 */
  --text-heading-lg: 1.125rem;  /* 18px - h4 */
  --text-heading-md: 1rem;      /* 16px - h5 */
  --text-heading-sm: 0.875rem;  /* 14px - h6 */

  /* ===== UI TEXT SCALE SYSTEM ===== */
  /* For interface elements: card titles, buttons, forms, tables */

  /* UI Text Sizes */
  --text-ui-lg: 1.125rem;     /* 18px - large card titles */
  --text-ui-base: 0.9375rem;  /* 15px - card titles, nav items */
  --text-ui-sm: 0.875rem;     /* 14px - button text, form inputs */
  --text-ui-xs: 0.8125rem;    /* 13px - table headers, labels */

  /* Small Text Scale (metadata, captions, helpers) */
  --text-small-base: 0.75rem;    /* 12px - timestamps, captions */
  --text-small-xs: 0.6875rem;   /* 11px - tiny helper text */

  /* ===== SPACING SYSTEM ===== */

  --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 */

  /* ===== BORDER RADIUS ===== */

  --radius-sm: 0.25rem;  /* 4px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-full: 9999px;

  /* ===== SHADOWS & ELEVATION ===== */

  --shadow-none: none;

  --shadow-sm:
    0 1px 2px 0 rgba(0, 0, 0, 0.2),
    0 1px 3px 0 rgba(0, 0, 0, 0.15);

  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.25),
    0 2px 4px -1px rgba(0, 0, 0, 0.15);

  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.2);

  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.35),
    0 10px 10px -5px rgba(0, 0, 0, 0.2);

  --shadow-focus-primary: 0 0 0 3px rgba(139, 92, 246, 0.3);
  --shadow-focus-danger: 0 0 0 3px rgba(239, 68, 68, 0.3);

  /* ===== MOTION & ANIMATION ===== */

  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;

  --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);

  /* ===== BREAKPOINTS ===== */

  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* ===== TA BLUE/GOLD THEME ===== */
[data-theme="blue-gold"] {
  /* Background Layers - Slightly warmer blacks with blue undertones */
  --surface-base: #0A0C0F;
  --surface-raised: #12141A;
  --surface-overlay: #1A1D26;
  --surface-hover: #222632;

  /* Borders & Dividers - Blue-tinted grays */
  --border-subtle: #252A38;
  --border-default: #323848;
  --border-emphasis: #47516B;

  /* Text Hierarchy - Unchanged for readability */
  --text-primary: #FFFFFF;
  --text-secondary: #B4B4B8;
  --text-tertiary: #6E6E73;
  --text-disabled: #48484D;

  /* ===== BRAND COLOR SYSTEM V2 ===== */
  --brand-a: #1F3A5F;  /* TA Navy (Logo Dark Navy) - Primary brand */
  --brand-b: #C4922A;  /* TA Gold (Logo Gold) - Secondary brand */

  /* Primary Brand (TA Navy Blue from logo) - Generated from --brand-a */
  --primary-50: #F0F4F8;
  --primary-100: #D9E2EC;
  --primary-200: #BCCCDC;
  --primary-300: #9FB3C8;
  --primary-400: #627A9D;
  --primary-500: #1F3A5F;  /* Logo Dark Navy (brand-a) */
  --primary-600: #1A3152;
  --primary-700: #152845;
  --primary-800: #0F1F38;
  --primary-900: #0A152B;

  /* Accent (TA Gold from logo) - Derived from --brand-b */
  --accent-400: #D4A645;
  --accent-500: #C4922A;  /* brand-b */
  --accent-600: #A67C23;

  /* Hero Gradient (for headline text) - Brand B → Brand A */
  --hero-gradient-start: #C4922A;  /* TA Gold (brand-b) */
  --hero-gradient-end: #5B9BD5;    /* Logo Light Blue (info-400) */

  /* Success (Emerald) - Unchanged */
  --success-400: #34D399;
  --success-500: #10B981;
  --success-600: #059669;

  /* Warning (TA Gold) */
  --warning-400: #D4A645;
  --warning-500: #C4922A;
  --warning-600: #A67C23;

  /* Danger (Red) - Unchanged */
  --danger-400: #F87171;
  --danger-500: #EF4444;
  --danger-600: #DC2626;

  /* Info (Logo Light Blue - Swoosh) */
  --info-400: #5B9BD5;  /* Logo Light Blue */
  --info-500: #4A86C7;
  --info-600: #3971B8;

  /* Political Party Colors */
  --party-democrat: #3B82F6;
  --party-republican: #EF4444;
  --party-independent: #94A3B8;

  /* Chart Palette - TA Navy primary */
  --chart-primary: #3E5D8F;        /* Slightly brighter brand-a for visibility */
  --chart-buy: #10B981;            /* Fixed: Emerald (never themed) */
  --chart-sell: #EF4444;           /* Fixed: Red (never themed) */
  --chart-neutral: #6B7280;        /* Fixed: Gray */
  --chart-grid: #252A38;
  --chart-axis: #47516B;

  /* Chart Bar Fill - Gold gradient */
  --chart-bar-fill-start: #C4922A;  /* TA Gold (brand-b) */
  --chart-bar-fill-end: #D4A645;    /* Lighter Gold */

  /* ===== RGB DECOMPOSITIONS (for opacity support) ===== */
  --primary-500-rgb: 31, 58, 95;       /* TA Navy */
  --primary-300-rgb: 159, 179, 200;    /* Lighter navy */
  --primary-400-rgb: 98, 122, 157;     /* Medium navy */
  --surface-base-rgb: 10, 12, 15;      /* Base background (blue-tinted) */
  --surface-raised-rgb: 18, 20, 26;    /* Raised surface (blue-tinted) */
  --surface-overlay-rgb: 26, 29, 38;   /* Overlay surface (blue-tinted) */
  --text-primary-rgb: 255, 255, 255;   /* White text */
  --text-secondary-rgb: 180, 180, 184; /* Secondary gray text */
  --text-tertiary-rgb: 110, 110, 115;  /* Tertiary gray text */
  --border-default-rgb: 50, 56, 72;    /* Default border (blue-tinted) */
  --border-subtle-rgb: 37, 42, 56;     /* Subtle border (blue-tinted) */
}

  /* ===== CUSTOM FONTS ===== */

@font-face {
  font-family: 'Nulshock';
  src: url('/Nulshock Bd.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap; /* Prevent FOUT (Flash of Unstyled Text) */
}

/* ===== GLOBAL BASE STYLES ===== */

* {
  box-sizing: border-box;
}

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

/* ===== UTILITY CLASSES ===== */

/* Surface Backgrounds */
.surface-base { background-color: var(--surface-base); }
.surface-raised { background-color: var(--surface-raised); }
.surface-overlay { background-color: var(--surface-overlay); }
.surface-hover { background-color: var(--surface-hover); }

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-disabled { color: var(--text-disabled); }

/* Border Colors */
.border-subtle { border-color: var(--border-subtle); }
.border-default { border-color: var(--border-default); }
.border-emphasis { border-color: var(--border-emphasis); }

/* Transitions */
.transition-fast { transition-duration: var(--duration-fast); }
.transition-normal { transition-duration: var(--duration-normal); }
.transition-slow { transition-duration: var(--duration-slow); }

/* Focus Ring */
.focus-ring:focus {
  outline: none;
  box-shadow: var(--shadow-focus-primary);
}

.focus-ring-danger:focus {
  outline: none;
  box-shadow: var(--shadow-focus-danger);
}

/* ===== ANIMATION KEYFRAMES ===== */

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

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

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.animate-fade-out {
  animation: fadeOut var(--duration-normal) var(--ease-in);
}

.animate-slide-in-right {
  animation: slideInRight var(--duration-normal) var(--ease-out);
}

.animate-slide-in-left {
  animation: slideInLeft var(--duration-normal) var(--ease-out);
}

.animate-scale-in {
  animation: scaleIn var(--duration-fast) var(--ease-out);
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

/* ===== SCANNER-SPECIFIC TOKENS ===== */

  /* Scanner Input Heights */
  --scanner-input-height: 2.75rem;     /* 44px - Touch-friendly */
  --scanner-stepper-size: 2.25rem;     /* 36px - Compact stepper buttons */
  --scanner-stepper-icon: 0.75rem;     /* 12px - Icon size */

  /* Scanner Chip Styles */
  --chip-padding-x: 0.75rem;           /* 12px */
  --chip-padding-y: 0.375rem;          /* 6px */
  --chip-gap: 0.5rem;                  /* 8px */

  /* Scanner Touch Targets */
  --touch-target-min: 2.75rem;         /* 44px minimum */

/* ===== COMPONENT PATTERNS ===== */

/* Card Base */
.card {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.card-interactive {
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
}

.card-interactive:hover {
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Button Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary-600);
  color: var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-700);
}

.btn-primary:active:not(:disabled) {
  background-color: var(--primary-800);
}

.btn-secondary {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--surface-hover);
  border-color: var(--border-emphasis);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--surface-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--danger-600);
  color: var(--text-primary);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-700);
}

/* ===== GRADIENT BUTTON UTILITIES ===== */
/* Reusable gradient button classes using CSS variables for theme-awareness */

/* Base Gradient Button - GitKraken Blue→Purple */
.btn-gradient {
  background: var(--gradient-button);
  color: white;
  font-weight: 600;
  transition: all 200ms ease-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-gradient:hover:not(:disabled) {
  background: var(--gradient-button-hover);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.btn-gradient:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-gradient:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Alternative Gradient Variants */
.btn-gradient-purple {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  transition: all 200ms ease-out;
}

.btn-gradient-purple:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 10px 15px -3px rgba(121, 0, 201, 0.4);
}

.btn-gradient-blue {
  background: linear-gradient(135deg, var(--info-500), var(--info-600));
  color: white;
  transition: all 200ms ease-out;
}

.btn-gradient-blue:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--info-600), var(--primary-500));
  box-shadow: 0 10px 15px -3px rgba(0, 136, 255, 0.4);
}

/* Button Size Variants */
.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.625rem;
  line-height: 1rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.btn-md {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Button Rounding Variants */
.btn-rounded-default {
  border-radius: 0.5rem;
}

.btn-rounded-lg {
  border-radius: 0.5rem;
}

.btn-rounded-xl {
  border-radius: 0.75rem;
}

.btn-rounded-2xl {
  border-radius: 1rem;
}

.btn-rounded-full {
  border-radius: 9999px;
}

/* Icon-only Buttons */
.btn-icon {
  aspect-ratio: 1;
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-sm {
  aspect-ratio: 1;
  padding: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-lg {
  aspect-ratio: 1;
  padding: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Gradient Border Button - Dark background with gradient border */
.btn-gradient-border {
  position: relative;
  background: var(--surface-overlay);
  color: white;
  font-weight: 600;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all 200ms ease-out;
}

.btn-gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--gradient-button);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: all 200ms ease-out;
}

.btn-gradient-border:hover:not(:disabled) {
  background: rgba(var(--brand-a-rgb), 0.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.btn-gradient-border:hover:not(:disabled)::before {
  background: var(--gradient-button-hover);
}

.btn-gradient-border:active:not(:disabled) {
  transform: translateY(0);
}

.btn-gradient-border:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* State-Specific Gradient Variants */
.btn-gradient-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  transition: all 200ms ease-out;
}

.btn-gradient-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-gradient-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  transition: all 200ms ease-out;
}

.btn-gradient-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4);
}

.btn-gradient-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  transition: all 200ms ease-out;
}

.btn-gradient-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.4);
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  cursor: wait;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid white;
  border-radius: 50%;
  border-top-color: transparent;
  animation: btn-loading-spin 0.6s linear infinite;
}

@keyframes btn-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Focus States - Enhanced Accessibility */
.btn-gradient:focus-visible,
.btn-gradient-purple:focus-visible,
.btn-gradient-blue:focus-visible,
.btn-gradient-border:focus-visible,
.btn-gradient-success:focus-visible,
.btn-gradient-danger:focus-visible,
.btn-gradient-warning:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
}

/* Icon Spacing Helper */
.btn-gradient > i:first-child,
.btn-gradient-purple > i:first-child,
.btn-gradient-blue > i:first-child,
.btn-gradient-border > i:first-child,
.btn-gradient-success > i:first-child,
.btn-gradient-danger > i:first-child,
.btn-gradient-warning > i:first-child {
  margin-right: 0.5rem;
}

.btn-gradient > i:last-child:not(:first-child),
.btn-gradient-purple > i:last-child:not(:first-child),
.btn-gradient-blue > i:last-child:not(:first-child),
.btn-gradient-border > i:last-child:not(:first-child),
.btn-gradient-success > i:last-child:not(:first-child),
.btn-gradient-danger > i:last-child:not(:first-child),
.btn-gradient-warning > i:last-child:not(:first-child) {
  margin-left: 0.5rem;
}

/* Input Base */
.input {
  width: 100%;
  padding: 0.625rem var(--space-3);
  background-color: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:hover:not(:disabled) {
  border-color: var(--border-emphasis);
}

.input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-2);
  font-size: var(--text-2xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  border: 1px solid;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success-400);
  border-color: rgba(16, 185, 129, 0.2);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning-400);
  border-color: rgba(245, 158, 11, 0.2);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-400);
  border-color: rgba(239, 68, 68, 0.2);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--info-400);
  border-color: rgba(59, 130, 246, 0.2);
}

/* ===== CHART STYLES ===== */

.chart-container {
  background-color: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
}

.chart-tooltip {
  background-color: var(--surface-overlay) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  padding: var(--space-3) !important;
  color: var(--text-primary) !important;
  font-size: var(--text-sm) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ===== RESPONSIVE UTILITIES ===== */

@media (max-width: 768px) {
  :root {
    --text-4xl: 1.875rem;  /* 30px */
    --text-3xl: 1.5rem;    /* 24px */
    --text-2xl: 1.25rem;   /* 20px */
  }

  .card {
    padding: var(--space-4);
  }
}

/* ===== ACCESSIBILITY ===== */

/* Focus visible for keyboard navigation only */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
/* Exception: Loading spinners (.animate-spin) should always animate for usability */
@media (prefers-reduced-motion: reduce) {
  *:not(.animate-spin),
  *::before:not(.animate-spin),
  *::after:not(.animate-spin) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border-default: #6E6E73;
    --border-emphasis: #B4B4B8;
  }
}

/* ===== ACCENT COLOR UTILITIES ===== */

/* Accent Backgrounds */
.bg-accent-400 { background-color: var(--accent-400); }
.bg-accent-500 { background-color: var(--accent-500); }
.bg-accent-600 { background-color: var(--accent-600); }

/* Accent Text */
.text-accent-400 { color: var(--accent-400); }
.text-accent-500 { color: var(--accent-500); }
.text-accent-600 { color: var(--accent-600); }

/* Accent Borders */
.border-accent-400 { border-color: var(--accent-400); }
.border-accent-500 { border-color: var(--accent-500); }
.border-accent-600 { border-color: var(--accent-600); }

/* Accent Ring (Focus) */
.ring-accent-500 { --tw-ring-color: var(--accent-500); }

/* ===== HERO GRADIENT UTILITIES ===== */

/* Hero Gradient for headline text - theme-aware */
.hero-gradient {
  background: linear-gradient(to right, var(--hero-gradient-start), var(--hero-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Tailwind-compatible gradient color utilities */
.from-hero-start {
  --tw-gradient-from: var(--hero-gradient-start) var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

/* ===== CHART BAR GRADIENT UTILITIES ===== */

/* Chart bar gradient - theme-aware (violet for Default, gold for TA Blue/Gold) */
.chart-bar-gradient {
  background: linear-gradient(to top, var(--chart-bar-fill-start), var(--chart-bar-fill-end));
}

/* Chart bar gradient with opacity variants */
.chart-bar-gradient-30 {
  background: linear-gradient(to top,
    color-mix(in srgb, var(--chart-bar-fill-start) 30%, transparent),
    color-mix(in srgb, var(--chart-bar-fill-end) 10%, transparent)
  );
}

.to-hero-end {
  --tw-gradient-to: var(--hero-gradient-end) var(--tw-gradient-to-position);
}

/* ===== SCANNER COMPONENT UTILITIES ===== */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Filter Chip Animations */
@keyframes filter-chip-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes filter-chip-out {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.animate-chip-in {
  animation: filter-chip-in 150ms var(--ease-out);
}

.animate-chip-out {
  animation: filter-chip-out 100ms var(--ease-in);
}

/* Number Input Stepper Styles */
.filter-number-input input[type="number"]::-webkit-inner-spin-button,
.filter-number-input input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.filter-number-input input[type="number"] {
  -moz-appearance: textfield;
}

/* ===== GRADIENT BORDER BUTTON (GitKraken Style) ===== */

/* Gradient border effect like GitKraken's "Explore Insights" button
 * Creates a gradient border with transparent background
 * Usage: Add class="gradient-border-btn" to any button
 */
.gradient-border-btn {
  position: relative;
  background: var(--surface-base);
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all var(--duration-normal) var(--ease-out);
}

.gradient-border-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: var(--gradient-border);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.gradient-border-btn:hover::before {
  opacity: 0.8;
}

/* Variant with filled gradient background on hover */
.gradient-border-btn-fill {
  position: relative;
  background: var(--surface-base);
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: all var(--duration-normal) var(--ease-out);
}

.gradient-border-btn-fill::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: var(--gradient-border);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

.gradient-border-btn-fill:hover {
  background: var(--gradient-button);
  color: white;
}

/* ===== FILTER CHIP UTILITIES ===== */

.bg-primary-10 {
  background-color: rgba(var(--primary-500-rgb), 0.1); /* primary-500 at 10% opacity - theme-aware */
}

.bg-primary-20 {
  background-color: rgba(var(--primary-500-rgb), 0.2); /* primary-500 at 20% opacity - theme-aware */
}

.border-primary-20 {
  border-color: rgba(var(--primary-500-rgb), 0.2); /* primary-500 at 20% opacity - theme-aware */
}

.hover\:bg-primary-20:hover {
  background-color: rgba(var(--primary-500-rgb), 0.2); /* theme-aware */
}

/* Additional opacity utilities */
.bg-surface-overlay-50 {
  background-color: rgba(var(--surface-overlay-rgb), 0.5);
}

.bg-surface-overlay-80 {
  background-color: rgba(var(--surface-overlay-rgb), 0.8);
}

.text-secondary-70 {
  color: rgba(var(--text-secondary-rgb), 0.7);
}

/* ===== NULSHOCK TYPOGRAPHY UTILITIES ===== */

/* ===== TYPOGRAPHY HIERARCHY ===== */

/* Display font (Nulshock): Hero titles, logo, big statements */
h1,
.hero-title,
.brand-text,
.font-display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em; /* Wider spacing for Nulshock's bold presence */
  /* Note: h1 font-size set by .text-hero-* utility classes */
}

/* Section Headers - use content scale multiplier for consistency with h3-h6 */
h2 {
  font-family: var(--font-sans);
  font-size: var(--text-3xl-content); /* 1.875rem * content-scale */
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: var(--leading-tight);
}

h3 {
  font-family: var(--font-sans);
  font-size: var(--text-2xl); /* 1.5rem * scale */
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: var(--leading-snug);
}

/* Smaller Headings - use display scale multiplier */
h4 {
  font-family: var(--font-sans);
  font-size: var(--text-xl); /* 1.25rem * scale */
  font-weight: 500;
  line-height: var(--leading-snug);
}

h5 {
  font-family: var(--font-sans);
  font-size: var(--text-lg); /* Body scale */
  font-weight: 500;
  line-height: var(--leading-normal);
}

h6 {
  font-family: var(--font-sans);
  font-size: var(--text-base); /* Body scale */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: var(--leading-normal);
}

.heading {
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Body text (Space Grotesk): Paragraphs, descriptions */
body, p, .text-body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
}

/* UI elements (Space Grotesk): Buttons, labels, filters, tables */
button,
.button,
label,
.filter-label,
.table-cell,
.badge {
  font-family: var(--font-sans);
  font-weight: 500;
}

/* Special cases: Big numbers/metrics can optionally use Nulshock */
.stat-number,
.metric-value {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ===== SEMANTIC COLOR UTILITIES ===== */

/* Text utilities */
.text-secondary {
  color: var(--text-secondary);
}

.text-tertiary {
  color: var(--text-tertiary);
}

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

/* Background utilities */
.bg-surface-overlay {
  background-color: var(--surface-overlay);
}

.bg-surface-raised {
  background-color: var(--surface-raised);
}

.bg-surface-base {
  background-color: var(--surface-base);
}

.bg-surface-hover {
  background-color: var(--surface-hover);
}

/* Border utilities */
.border-default {
  border-color: var(--border-default);
}

.border-subtle {
  border-color: var(--border-subtle);
}

.border-emphasis {
  border-color: var(--border-emphasis);
}

/* ===== HERO TEXT UTILITIES ===== */
/* Responsive hero font sizes that scale with --text-display-scale */

.text-hero-sm {
  font-size: var(--text-hero-sm); /* 36px base * scale */
}

.text-hero-md {
  font-size: var(--text-hero-md); /* 48px base * scale */
}

.text-hero-lg {
  font-size: var(--text-hero-lg); /* 60px base * scale */
}

.text-hero-xl {
  font-size: var(--text-hero-xl); /* 72px base * scale */
}

/* Responsive breakpoints */
@media (min-width: 640px) {
  .sm\:text-hero-sm {
    font-size: var(--text-hero-sm);
  }

  .sm\:text-hero-md {
    font-size: var(--text-hero-md);
  }

  .sm\:text-hero-lg {
    font-size: var(--text-hero-lg);
  }

  .sm\:text-hero-xl {
    font-size: var(--text-hero-xl);
  }
}

@media (min-width: 1024px) {
  .lg\:text-hero-sm {
    font-size: var(--text-hero-sm);
  }

  .lg\:text-hero-md {
    font-size: var(--text-hero-md);
  }

  .lg\:text-hero-lg {
    font-size: var(--text-hero-lg);
  }

  .lg\:text-hero-xl {
    font-size: var(--text-hero-xl);
  }
}

/* ===== UI TEXT UTILITIES ===== */
/* For interface elements: card titles, buttons, forms, tables */

.text-ui-lg {
  font-size: var(--text-ui-lg); /* 18px base * scale */
}

.text-ui-base {
  font-size: var(--text-ui-base); /* 15px base * scale */
}

.text-ui-sm {
  font-size: var(--text-ui-sm); /* 14px base * scale */
}

.text-ui-xs {
  font-size: var(--text-ui-xs); /* 13px base * scale */
}

/* Small Text Utilities (metadata, captions, helpers) */
.text-small {
  font-size: var(--text-small-base); /* 12px base * scale */
}

.text-small-xs {
  font-size: var(--text-small-xs); /* 11px base * scale */
}

/* Body Text Utilities (paragraphs, content) */
.text-body-base {
  font-size: var(--text-base); /* Uses existing body text scale */
}

.text-body-sm {
  font-size: var(--text-sm); /* Uses existing body text scale */
}

.text-body-xs {
  font-size: var(--text-xs); /* Uses existing body text scale */
}

/* ===== STANDARD TEXT SIZE UTILITIES ===== */
/* Content-tier utilities (scale with --text-content-scale) */
.text-3xl {
  font-size: var(--text-3xl-content); /* 30px base * content-scale */
}

.text-2xl {
  font-size: var(--text-2xl); /* 24px base * content-scale */
}

.text-xl {
  font-size: var(--text-xl); /* 20px base * content-scale */
}

.text-lg {
  font-size: var(--text-lg); /* 18px base * content-scale */
}

.text-base {
  font-size: var(--text-base); /* 15px base * content-scale */
}

/* Small-tier utilities (scale with --text-small-scale) */
.text-sm {
  font-size: var(--text-sm); /* 14px base * small-scale */
}

.text-xs {
  font-size: var(--text-xs); /* 13px base * small-scale */
}

.text-2xs {
  font-size: var(--text-2xs); /* 12px base * small-scale */
}

/* ===== RESPONSIVE VARIANTS ===== */
@media (min-width: 640px) {
  .sm\:text-3xl {
    font-size: var(--text-3xl-content);
  }

  .sm\:text-2xl {
    font-size: var(--text-2xl);
  }

  .sm\:text-xl {
    font-size: var(--text-xl);
  }

  .sm\:text-lg {
    font-size: var(--text-lg);
  }

  .sm\:text-base {
    font-size: var(--text-base);
  }
}

@media (min-width: 1024px) {
  .lg\:text-3xl {
    font-size: var(--text-3xl-content);
  }

  .lg\:text-2xl {
    font-size: var(--text-2xl);
  }

  .lg\:text-xl {
    font-size: var(--text-xl);
  }

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

  .lg\:text-base {
    font-size: var(--text-base);
  }
}

