:root {
  /* Enhanced Primitive Color Tokens - WCAG AA Compliant */
  --color-white: rgba(255, 255, 255, 1);
  --color-black: rgba(0, 0, 0, 1);
  --color-cream-50: rgba(252, 252, 249, 1);
  --color-cream-100: rgba(255, 255, 253, 1);
  
  /* Light Mode Text Colors - Enhanced Contrast */
  --color-gray-200: rgba(245, 245, 245, 1);
  --color-gray-300: rgba(167, 169, 169, 1);
  --color-gray-400: rgba(119, 124, 124, 1);
  --color-slate-500: rgba(98, 108, 113, 1);
  --color-slate-600: rgba(75, 85, 90, 1); /* New - better contrast */
  --color-brown-600: rgba(94, 82, 64, 1);
  
  /* Dark Mode Background Colors - Enhanced Contrast */
  --color-charcoal-700: rgba(31, 33, 33, 1);
  --color-charcoal-800: rgba(25, 27, 27, 1); /* Darker for better contrast */
  --color-slate-900: rgba(19, 52, 59, 1);
  
  /* Accent Colors - Enhanced for Accessibility */
  --color-teal-300: rgba(50, 184, 198, 1);
  --color-teal-400: rgba(45, 166, 178, 1);
  --color-teal-500: rgba(33, 128, 141, 1);
  --color-teal-600: rgba(29, 116, 128, 1);
  --color-teal-700: rgba(26, 104, 115, 1);
  --color-teal-800: rgba(41, 150, 161, 1);
  
  /* Status Colors - Enhanced for Accessibility */
  --color-red-400: rgba(255, 84, 89, 1);
  --color-red-500: rgba(192, 21, 47, 1);
  --color-orange-400: rgba(230, 129, 97, 1);
  --color-orange-500: rgba(168, 75, 47, 1);
  --color-green-400: rgba(50, 180, 110, 1); /* New - for success states */
  --color-green-500: rgba(30, 140, 90, 1); /* New - for success states */

  /* RGB versions for opacity control */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-teal-300-rgb: 50, 184, 198;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-500-rgb: 98, 108, 113;
  --color-slate-600-rgb: 75, 85, 90;
  --color-red-500-rgb: 192, 21, 47;
  --color-red-400-rgb: 255, 84, 89;
  --color-orange-500-rgb: 168, 75, 47;
  --color-orange-400-rgb: 230, 129, 97;
  --color-green-400-rgb: 50, 180, 110;
  --color-green-500-rgb: 30, 140, 90;
  --color-gray-400-rgb: 119, 124, 124;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;

  /* Background color tokens (Light Mode) */
  --color-bg-1: rgba(59, 130, 246, 0.08); /* Light blue */
  --color-bg-2: rgba(245, 158, 11, 0.08); /* Light yellow */
  --color-bg-3: rgba(34, 197, 94, 0.08); /* Light green */
  --color-bg-4: rgba(239, 68, 68, 0.08); /* Light red */
  --color-bg-5: rgba(147, 51, 234, 0.08); /* Light purple */
  --color-bg-6: rgba(249, 115, 22, 0.08); /* Light orange */
  --color-bg-7: rgba(236, 72, 153, 0.08); /* Light pink */
  --color-bg-8: rgba(6, 182, 212, 0.08); /* Light cyan */

  /* Semantic Color Tokens (Light Mode) - WCAG AA Compliant */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900); /* 12:1 contrast ratio */
  --color-text-secondary: var(--color-slate-600); /* 7:1 contrast ratio - WCAG AAA */
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.15); /* Increased opacity for better contrast */
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.35);
  --color-border: rgba(var(--color-brown-600-rgb), 0.3); /* Increased opacity for better contrast */
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.2); /* Increased opacity for better contrast */
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.2);
  --color-error: var(--color-red-500);
  --color-success: var(--color-green-500); /* Changed to green for better semantic meaning */
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-600); /* Updated for better contrast */
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);
  --color-border-secondary: rgba(var(--color-brown-600-rgb), 0.25);

  /* Theme Transition Properties - NEW */
  --theme-transition-duration: 300ms;
  --theme-transition-timing: ease-out;

  /* Common style patterns - WCAG Enhanced */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for opacity control */
  --color-success-rgb: 33, 128, 141;
  --color-error-rgb: 192, 21, 47;
  --color-warning-rgb: 168, 75, 47;
  --color-info-rgb: 98, 108, 113;

  /* Typography */
  --font-family-base: "FKGroteskNeue", "Geist", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-mono: "Berkeley Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 30px;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 550;
  --font-weight-bold: 600;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --letter-spacing-tight: -0.01em;

  /* Spacing */
  --space-0: 0;
  --space-1: 1px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-10: 10px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04),
    0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);

  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    /* RGB versions for opacity control (Dark Mode) */
    --color-cream-300-rgb: 167, 169, 169;
    --color-cream-50-rgb: 245, 245, 245;
    --color-teal-400-rgb: 45, 166, 178;
    --color-teal-300-rgb: 50, 184, 198;
    --color-gray-400-rgb: 119, 124, 124;
    --color-gray-300-rgb: 167, 169, 169;
    --color-gray-200-rgb: 245, 245, 245;

    /* Background color tokens (Dark Mode) */
    --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
    --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
    --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
    --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
    --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
    --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
    --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
    --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */
    
    /* Semantic Color Tokens (Dark Mode) - WCAG AA Compliant */
    --color-background: var(--color-slate-900);
    --color-surface: var(--color-charcoal-800);
    --color-text: var(--color-cream-50); /* 12:1 contrast ratio */
    --color-text-secondary: var(--color-cream-300); /* 7:1 contrast ratio - WCAG AAA */
    --color-primary: var(--color-teal-400); /* Lighter in dark mode for better contrast */
    --color-primary-hover: var(--color-teal-300);
    --color-primary-active: var(--color-teal-200);
    --color-secondary: rgba(var(--color-cream-300-rgb), 0.15); /* Increased opacity for better contrast */
    --color-secondary-hover: rgba(var(--color-cream-300-rgb), 0.25);
    --color-secondary-active: rgba(var(--color-cream-300-rgb), 0.35);
    --color-border: rgba(var(--color-cream-300-rgb), 0.3); /* Increased opacity for better contrast */
    --color-btn-primary-text: var(--color-slate-900);
    --color-card-border: rgba(var(--color-cream-300-rgb), 0.2); /* Increased opacity for better contrast */
    --color-card-border-inner: rgba(var(--color-cream-300-rgb), 0.2);
    --color-error: var(--color-red-400); /* Lighter in dark mode for better visibility */
    --color-success: var(--color-green-400); /* Lighter in dark mode for better visibility */
    --color-warning: var(--color-orange-400); /* Lighter in dark mode for better visibility */
    --color-info: var(--color-cream-300); /* Updated for better contrast */
    --color-focus-ring: rgba(var(--color-teal-400-rgb), 0.5); /* Increased opacity for better visibility */
    --color-select-caret: rgba(var(--color-cream-50-rgb), 0.8);
    --color-border-secondary: rgba(var(--color-cream-300-rgb), 0.25);
    --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
      inset 0 -1px 0 rgba(0, 0, 0, 0.15);

    /* Theme Transition Properties */
    --theme-transition-duration: 300ms;
    --theme-transition-timing: ease-out;

    /* Common style patterns - updated for dark mode - WCAG Enhanced */
    --focus-ring: 0 0 0 3px var(--color-focus-ring);
    --focus-outline: 2px solid var(--color-primary);
    --status-bg-opacity: 0.15;
    --status-border-opacity: 0.25;
    --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

    /* RGB versions for dark mode */
    --color-success-rgb: var(--color-green-400-rgb);
    --color-error-rgb: var(--color-red-400-rgb);
    --color-warning-rgb: var(--color-orange-400-rgb);
    --color-info-rgb: var(--color-cream-300-rgb);
  }
}

/* Data attribute for manual theme switching */
[data-color-scheme="dark"] {
  /* RGB versions for opacity control (Dark Mode) */
  --color-cream-300-rgb: 167, 169, 169;
  --color-cream-50-rgb: 245, 245, 245;
  --color-teal-400-rgb: 45, 166, 178;
  --color-teal-300-rgb: 50, 184, 198;
  --color-gray-400-rgb: 119, 124, 124;
  --color-gray-300-rgb: 167, 169, 169;
  --color-gray-200-rgb: 245, 245, 245;
  --color-green-400-rgb: 50, 180, 110;

  /* Colorful background palette - Dark Mode */
  --color-bg-1: rgba(29, 78, 216, 0.15); /* Dark blue */
  --color-bg-2: rgba(180, 83, 9, 0.15); /* Dark yellow */
  --color-bg-3: rgba(21, 128, 61, 0.15); /* Dark green */
  --color-bg-4: rgba(185, 28, 28, 0.15); /* Dark red */
  --color-bg-5: rgba(107, 33, 168, 0.15); /* Dark purple */
  --color-bg-6: rgba(194, 65, 12, 0.15); /* Dark orange */
  --color-bg-7: rgba(190, 24, 93, 0.15); /* Dark pink */
  --color-bg-8: rgba(8, 145, 178, 0.15); /* Dark cyan */
  
  /* Semantic Color Tokens (Dark Mode) - WCAG AA Compliant */
  --color-background: var(--color-slate-900);
  --color-surface: var(--color-charcoal-800);
  --color-text: var(--color-cream-50); /* 12:1 contrast ratio */
  --color-text-secondary: var(--color-cream-300); /* 7:1 contrast ratio - WCAG AAA */
  --color-primary: var(--color-teal-400); /* Lighter in dark mode for better contrast */
  --color-primary-hover: var(--color-teal-300);
  --color-primary-active: var(--color-teal-200);
  --color-secondary: rgba(var(--color-cream-300-rgb), 0.15); /* Increased opacity for better contrast */
  --color-secondary-hover: rgba(var(--color-cream-300-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-cream-300-rgb), 0.35);
  --color-border: rgba(var(--color-cream-300-rgb), 0.3); /* Increased opacity for better contrast */
  --color-btn-primary-text: var(--color-slate-900);
  --color-card-border: rgba(var(--color-cream-300-rgb), 0.2); /* Increased opacity for better contrast */
  --color-card-border-inner: rgba(var(--color-cream-300-rgb), 0.2);
  --color-error: var(--color-red-400); /* Lighter in dark mode for better visibility */
  --color-success: var(--color-green-400); /* Lighter in dark mode for better visibility */
  --color-warning: var(--color-orange-400); /* Lighter in dark mode for better visibility */
  --color-info: var(--color-cream-300); /* Updated for better contrast */
  --color-focus-ring: rgba(var(--color-teal-400-rgb), 0.5); /* Increased opacity for better visibility */
  --color-select-caret: rgba(var(--color-cream-50-rgb), 0.8);
  --color-border-secondary: rgba(var(--color-cream-300-rgb), 0.25);
  --shadow-inset-sm: inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);

  /* Theme Transition Properties */
  --theme-transition-duration: 300ms;
  --theme-transition-timing: ease-out;
  
  /* Common style patterns - updated for dark mode - WCAG Enhanced */
  --focus-ring: 0 0 0 3px var(--color-focus-ring);
  --focus-outline: 2px solid var(--color-primary);
  --status-bg-opacity: 0.15;
  --status-border-opacity: 0.25;
  --select-caret-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23134252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --select-caret-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* RGB versions for dark mode */
  --color-success-rgb: var(--color-green-400-rgb);
  --color-error-rgb: var(--color-red-400-rgb);
  --color-warning-rgb: var(--color-orange-400-rgb);
  --color-info-rgb: var(--color-cream-300-rgb);
}

[data-color-scheme="light"] {
  /* RGB versions for opacity control (light mode) */
  --color-brown-600-rgb: 94, 82, 64;
  --color-teal-500-rgb: 33, 128, 141;
  --color-slate-900-rgb: 19, 52, 59;
  --color-slate-600-rgb: 75, 85, 90;
  --color-green-500-rgb: 30, 140, 90;
  
  /* Semantic Color Tokens (Light Mode) - WCAG AA Compliant */
  --color-background: var(--color-cream-50);
  --color-surface: var(--color-cream-100);
  --color-text: var(--color-slate-900); /* 12:1 contrast ratio */
  --color-text-secondary: var(--color-slate-600); /* 7:1 contrast ratio - WCAG AAA */
  --color-primary: var(--color-teal-500);
  --color-primary-hover: var(--color-teal-600);
  --color-primary-active: var(--color-teal-700);
  --color-secondary: rgba(var(--color-brown-600-rgb), 0.15); /* Increased opacity for better contrast */
  --color-secondary-hover: rgba(var(--color-brown-600-rgb), 0.25);
  --color-secondary-active: rgba(var(--color-brown-600-rgb), 0.35);
  --color-border: rgba(var(--color-brown-600-rgb), 0.3); /* Increased opacity for better contrast */
  --color-btn-primary-text: var(--color-cream-50);
  --color-card-border: rgba(var(--color-brown-600-rgb), 0.2); /* Increased opacity for better contrast */
  --color-card-border-inner: rgba(var(--color-brown-600-rgb), 0.2);
  --color-error: var(--color-red-500);
  --color-success: var(--color-green-500); /* Changed to green for better semantic meaning */
  --color-warning: var(--color-orange-500);
  --color-info: var(--color-slate-600); /* Updated for better contrast */
  --color-focus-ring: rgba(var(--color-teal-500-rgb), 0.4);
  --color-select-caret: rgba(var(--color-slate-900-rgb), 0.8);
  --color-border-secondary: rgba(var(--color-brown-600-rgb), 0.25);

  /* Theme Transition Properties */
  --theme-transition-duration: 300ms;
  --theme-transition-timing: ease-out;

  /* RGB versions for light mode */
  --color-success-rgb: var(--color-green-500-rgb);
  --color-error-rgb: var(--color-red-500-rgb);
  --color-warning-rgb: var(--color-orange-500-rgb);
  --color-info-rgb: var(--color-slate-600-rgb);
}

/* Base styles */
html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: 
    radial-gradient(circle at 10% 20%, rgba(0, 40, 83, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(6, 20, 40, 0.5) 0%, transparent 50%),
    linear-gradient(135deg, #0a192f 0%, #020c1b 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  transition: color var(--theme-transition-duration) var(--theme-transition-timing),
              background-color var(--theme-transition-duration) var(--theme-transition-timing);
}

/* Apply transitions to common elements for smooth theme switching */
button, a, input, select, textarea, .form-control, .card, .glass-panel, .status, 
.btn, .analyze-btn, .hero-title, .panel-title, .value-display, .analyze-button,
.method-tab-content, .component-input, .component-select, .modal-content {
  transition: color var(--theme-transition-duration) var(--theme-transition-timing),
              background-color var(--theme-transition-duration) var(--theme-transition-timing),
              border-color var(--theme-transition-duration) var(--theme-transition-timing),
              box-shadow var(--theme-transition-duration) var(--theme-transition-timing);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: 1;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

@keyframes glow {
  0% { box-shadow: 0 0 20px rgba(0, 150, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(0, 150, 255, 0.5); }
  100% { box-shadow: 0 0 20px rgba(0, 150, 255, 0.3); }
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
}
h2 {
  font-size: var(--font-size-3xl);
}
h3 {
  font-size: var(--font-size-2xl);
}
h4 {
  font-size: var(--font-size-xl);
}
h5 {
  font-size: var(--font-size-lg);
}
h6 {
  font-size: var(--font-size-md);
}

p {
  margin: 0 0 var(--space-16) 0;
}

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

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

code,
pre {
  font-family: var(--font-family-mono);
  font-size: calc(var(--font-size-base) * 0.95);
  background-color: var(--color-secondary);
  border-radius: var(--radius-sm);
}

code {
  padding: var(--space-1) var(--space-4);
}

pre {
  padding: var(--space-16);
  margin: var(--space-16) 0;
  overflow: auto;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-base);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-standard);
  border: none;
  text-decoration: none;
  position: relative;
}

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

.btn--primary {
  background: linear-gradient(135deg, 
    var(--color-primary) 0%,
    rgba(0, 150, 255, 0.8) 100%
  );
  color: var(--color-btn-primary-text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 4px 15px rgba(0, 150, 255, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn--primary::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  z-index: -1;
  transform: translateX(-100%);
  animation: btnShine 3s ease-in-out infinite;
}

.btn--primary:hover {
  background: linear-gradient(135deg,
    var(--color-primary-hover) 0%,
    rgba(0, 180, 255, 0.9) 100%
  );
  transform: translateY(-1px);
  box-shadow: 
    0 6px 20px rgba(0, 150, 255, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.3);
}

.btn--primary:active {
  background: linear-gradient(135deg,
    var(--color-primary-active) 0%,
    rgba(0, 120, 255, 0.8) 100%
  );
  transform: translateY(1px);
  box-shadow: 
    0 2px 10px rgba(0, 150, 255, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.1);
}

@keyframes btnShine {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); } 
  100% { transform: translateX(100%); }
}

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

.btn--secondary:hover {
  background: var(--color-secondary-hover);
}

.btn--secondary:active {
  background: var(--color-secondary-active);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-secondary);
}

.btn--sm {
  padding: var(--space-4) var(--space-12);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: var(--space-10) var(--space-20);
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

.btn--full-width {
  width: 100%;
}

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

/* Form elements */
.form-control {
  display: block;
  width: 100%;
  padding: var(--space-8) var(--space-12);
  font-size: var(--font-size-md);
  line-height: 1.5;
  color: var(--color-text);
  background: rgba(0, 20, 40, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-base);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  box-shadow: 
      inset 0 2px 4px rgba(0, 0, 0, 0.1),
      0 0 0 transparent;
}

.form-control:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
      inset 0 2px 4px rgba(0, 0, 0, 0.1),
      0 0 10px rgba(0, 150, 255, 0.1);
}

.form-control:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 
      inset 0 2px 4px rgba(0, 0, 0, 0.1),
      0 0 0 2px rgba(0, 150, 255, 0.2);
  background-color: rgba(0, 20, 40, 0.4);
}

/* Ensure select dropdown arrows are preserved on focus */
select.form-control:focus {
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25em auto;
}

@media (prefers-color-scheme: dark) {
  select.form-control:focus {
    background-image: var(--select-caret-dark);
  }
}

[data-color-scheme="dark"] select.form-control:focus {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control:focus {
  background-image: var(--select-caret-light);
}

textarea.form-control {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
}

/* CSS Fix for single dropdown arrow on form controls:
 * - Ensures consistent single chevron in custom selects
 * - Prevents tiling or duplication of SVG background
 * - Compatible with theme switching and cross-browser
 */
select.form-control {
  padding: var(--space-8) var(--space-12);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-caret-light);
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25em auto;
  padding-right: 2.5em;
}

/* Add a dark mode specific caret */
@media (prefers-color-scheme: dark) {
  select.form-control {
    background-image: var(--select-caret-dark);
  }
}

/* Also handle data-color-scheme */
[data-color-scheme="dark"] select.form-control {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] select.form-control {
  background-image: var(--select-caret-light);
}

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.form-group {
  margin-bottom: var(--space-16);
}

/* Card component */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card__body {
  padding: var(--space-16);
}

.card__header,
.card__footer {
  padding: var(--space-16);
  border-bottom: 1px solid var(--color-card-border-inner);
}

/* Status indicators - simplified with CSS variables */
.status {
  display: inline-flex;
  align-items: center;
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
}

.status--success {
  background-color: rgba(
    var(--color-success-rgb, 33, 128, 141),
    var(--status-bg-opacity)
  );
  color: var(--color-success);
  border: 1px solid
    rgba(var(--color-success-rgb, 33, 128, 141), var(--status-border-opacity));
}

.status--error {
  background-color: rgba(
    var(--color-error-rgb, 192, 21, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-error);
  border: 1px solid
    rgba(var(--color-error-rgb, 192, 21, 47), var(--status-border-opacity));
}

.status--warning {
  background-color: rgba(
    var(--color-warning-rgb, 168, 75, 47),
    var(--status-bg-opacity)
  );
  color: var(--color-warning);
  border: 1px solid
    rgba(var(--color-warning-rgb, 168, 75, 47), var(--status-border-opacity));
}

.status--info {
  background-color: rgba(
    var(--color-info-rgb, 98, 108, 113),
    var(--status-bg-opacity)
  );
  color: var(--color-info);
  border: 1px solid
    rgba(var(--color-info-rgb, 98, 108, 113), var(--status-border-opacity));
}

/* Hero Section */
.hero-section {
  padding: var(--space-48) 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-bg-3), transparent);
  margin-top: var(--space-24);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(0, 150, 255, 0.1),
    transparent 70%
  );
  animation: rotateBg 20s linear infinite;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-32);
  position: relative;
  z-index: 2;
}

.hero-copy {
  flex: 1;
  max-width: 600px;
  animation: float 6s ease-in-out infinite;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-16);
  background: linear-gradient(135deg, var(--color-primary), #4FACFE);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(79, 172, 254, 0.3);
}

.hero-sub {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-24);
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  gap: var(--space-16);
  justify-content: center;
}

.hero-visual {
  position: relative;
  flex: 1;
  min-height: 400px;
  animation: float 6s ease-in-out infinite;
  animation-delay: -3s;
}

.glass-card {
  position: absolute;
  padding: var(--space-16);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px rgba(255, 255, 255, 0.1);
  animation: float 6s ease-in-out infinite;
}

.glass-card.small {
  top: 20%;
  left: 10%;
  animation-delay: -1s;
}

.glass-card.medium {
  top: 40%;
  right: 15%;
  animation-delay: -2s;
}

.glass-card.large {
  bottom: 15%;
  left: 25%;
  animation-delay: -3s;
}

.glow-orbit {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle at center,
    rgba(0, 150, 255, 0.1),
    transparent 70%
  );
  animation: orbitGlow 8s linear infinite;
}

@keyframes orbitGlow {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Container layout */
.container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--space-16);
    padding-left: var(--space-16);
    max-width: 1280px;
}

@media (min-width: 640px) {
    .container {
        padding-right: var(--space-24);
        padding-left: var(--space-24);
    }
}
@media (min-width: 768px) {
    .container {
        padding-right: var(--space-32);
        padding-left: var(--space-32);
    }
}
@media (min-width: 1024px) {
    .container {
        padding-right: var(--space-32);
        padding-left: var(--space-32);
    }
}
@media (min-width: 1280px) {
    .container {
        padding-right: var(--space-32);
        padding-left: var(--space-32);
    }
}/* Utility classes */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-4 {
  gap: var(--space-4);
}
.gap-8 {
  gap: var(--space-8);
}
.gap-16 {
  gap: var(--space-16);
}

.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: var(--space-8);
}
.mb-8 {
  margin-bottom: var(--space-8);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.p-0 {
  padding: 0;
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}
.py-16 {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
.px-16 {
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.block {
  display: block;
}
.hidden {
  display: none;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all var(--theme-transition-duration) var(--theme-transition-timing);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-toggle-icon {
  font-size: 18px;
  transition: transform var(--theme-transition-duration) var(--theme-transition-timing);
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(15deg);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .theme-toggle:hover .theme-toggle-icon,
  .analyze-btn:hover .analyze-icon,
  .btn--primary:hover,
  .glass-panel:hover,
  .card:hover,
  .hazards-list li:hover,
  .failure-list li:hover,
  .recommendations-list li:hover,
  .analysis-card:hover {
    transform: none !important;
  }
  
  .analyze-button::before,
  .btn--primary::before,
  .glass-panel::before,
  .hero-section::before,
  .component-analysis-panel::before,
  .asil-badge::before,
  .hazards-list li::before,
  .failure-list li::before,
  .recommendations-list li::before {
    animation: none !important;
  }
}

.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #005fa3;
    --color-primary-hover: #004b82;
    --color-error: #d00000;
    --color-success: #006e00;
    --color-warning: #af5700;
    --color-info: #2f3c48;
    --color-text: #000000;
    --color-text-secondary: #333333;
    --color-background: #ffffff;
    --color-surface: #f8f8f8;
    --color-border: #444444;
    --color-focus-ring: #005fa3;
    --focus-outline: 3px solid #005fa3;
    
    /* Ensure buttons have strong contrast */
    --color-btn-primary-text: #ffffff;
    
    /* Component specific */
    --color-card-border: #444444;
    --color-card-border-inner: #444444;
  }
  
  [data-color-scheme="dark"] {
    --color-primary: #4facfe;
    --color-primary-hover: #70bdff;
    --color-error: #ff5a5a;
    --color-success: #4caf50;
    --color-warning: #ffab40;
    --color-info: #bbbbbb;
    --color-text: #ffffff;
    --color-text-secondary: #dddddd;
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-border: #ffffff;
    --color-focus-ring: #ffffff;
    --focus-outline: 3px solid #ffffff;
    
    /* Ensure buttons have strong contrast */
    --color-btn-primary-text: #000000;
    
    /* Component specific */
    --color-card-border: #ffffff;
    --color-card-border-inner: #ffffff;
  }
  
  /* Increase contrast for form elements */
  .form-control,
  .component-select,
  .parameter-select,
  .adjustment-select,
  .component-input,
  button,
  .btn {
    border-width: 2px;
  }
  
  /* Stronger focus states */
  .btn:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  a:focus-visible,
  .method-tab input[type="radio"]:focus-visible + .method-tab-content,
  .method-toggle-button input[type="radio"]:focus-visible + .method-toggle-content {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
  }
  
  /* Add borders to important UI elements */
  .glass-panel,
  .card,
  .input-card,
  .parameters-card,
  .parameter-item,
  .analysis-card,
  .asil-result,
  .asil-badge {
    border: 2px solid var(--color-border);
  }
  
  /* Remove subtle effects that might reduce contrast */
  .btn::before,
  .analyze-button::before,
  .glass-panel::before,
  .hero-section::before,
  .component-analysis-panel::before,
  .asil-badge::before,
  .hazards-list li::before,
  .failure-list li::before,
  .recommendations-list li::before {
    display: none;
  }
  
  /* Simplify backgrounds */
  body {
    background: var(--color-background);
  }
  
  /* Ensure text has sufficient contrast */
  h1, h2, h3, h4, h5, h6, p, span, div {
    color: var(--color-text);
  }
  
  .text-secondary,
  .subtitle,
  .panel-subtitle,
  .section-subtitle,
  .input-helper {
    color: var(--color-text-secondary);
  }
  
  /* Remove backdrop blur which can reduce contrast */
  .glass-panel,
  .modal-backdrop,
  .error-banner {
    backdrop-filter: none;
  }
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-8) var(--space-16);
  z-index: 100;
  transition: top 0.3s;
  text-decoration: none;
  border-bottom-right-radius: var(--radius-base);
}

.skip-to-content:focus {
  top: 0;
  outline: var(--focus-outline);
  outline-offset: 0;
}

/* Additional accessibility improvements */
.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;
}

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

/* Dark mode specifics */
[data-color-scheme="dark"] .btn--outline {
  border: 1px solid var(--color-border-secondary);
}

@font-face {
  font-family: 'FKGroteskNeue';
  src: url('https://r2cdn.perplexity.ai/fonts/FKGroteskNeue.woff2')
    format('woff2');
}

/* END PERPLEXITY DESIGN SYSTEM */
/* Additional styles for ISO 26262 ASIL Calculator v16 */

/* Glassmorphism base styles */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: all 0.8s ease;
}

.glass-panel:hover::before {
    left: 100%;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px rgba(255, 255, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
    .glass-panel {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
}

[data-color-scheme="dark"] .glass-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* App container */
.app-container {
    min-height: 100vh;
    background: var(--color-bg-1);
}

/* Header */
.header {
    padding: var(--space-32) 0;
    text-align: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, transparent 100%);
    position: relative;
    z-index: 2;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 150, 255, 0.1) 0%,
        rgba(0, 255, 200, 0.1) 50%,
        rgba(0, 150, 255, 0.1) 100%
    );
    animation: headerGlow 8s linear infinite;
}

@keyframes headerGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-8);
    background: linear-gradient(135deg, 
        var(--color-primary), 
        var(--color-teal-300),
        rgba(0, 150, 255, 1)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-shadow: 0 0 30px rgba(0, 150, 255, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

.title::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    background: linear-gradient(135deg,
        transparent,
        rgba(0, 150, 255, 0.4),
        transparent
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(8px);
    opacity: 0.5;
    animation: titleShimmer 6s linear infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 20px rgba(0, 150, 255, 0.3)); }
    50% { filter: brightness(1.2) drop-shadow(0 0 30px rgba(0, 150, 255, 0.5)); }
}

@keyframes titleShimmer {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(100%); }
}

.subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-24);
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
    flex-wrap: wrap;
}

.header-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
}

/* Dashboard Section */
.dashboard-section {
    padding: var(--space-32) 0;
    background: var(--color-bg-2);
    margin-top: var(--space-16);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-24);
    position: relative;
    z-index: 2;
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    padding: var(--space-24);
    border-radius: var(--radius-lg);
    text-align: center;
    background: rgba(0, 20, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: -2s; }
.stat-card:nth-child(3) { animation-delay: -4s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(0, 150, 255, 0.1),
        transparent 70%
    );
    animation: rotateBg 10s linear infinite;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat-card h3 {
    margin-bottom: var(--space-12);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

/* Main content */
.main {
    padding: 0 0 var(--space-32) 0;
    background: var(--color-bg-5);
}

/* Input section */
/* Main section container */
.input-section {
    max-width: 800px;
    width: 100%;
    margin: 0 auto var(--space-32);
    padding: var(--space-32) var(--space-24);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Content container with max-width for better readability */
.content-wrapper {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-32);
}

/* Header styling */
.section-header {
    text-align: center;
    margin-bottom: var(--space-32);
    padding: 0 var(--space-16);
    position: relative;
    isolation: isolate;
}

.section-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-12);
    background: linear-gradient(135deg,
        var(--color-primary),
        rgba(0, 150, 255, 1)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    position: relative;
}

.section-subtitle {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Method selection container */
.method-selection-container {
    width: 100%;
    margin-bottom: var(--space-32);
    position: relative;
}

.method-toggle-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 var(--space-16);
    position: relative;
}

.method-toggle-group {
    display: flex;
    justify-content: center;
    gap: var(--space-12);
    padding: var(--space-6);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    position: relative;
}

/* Toggle button styling */
.method-toggle-button {
    flex: 1;
    position: relative;
    isolation: isolate;
    min-width: 160px;
}

.method-toggle-button input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.method-toggle-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-10) var(--space-16);
    border-radius: var(--radius-base);
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.method-toggle-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Hover and active states */
.method-toggle-button:hover .method-toggle-content {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
}

.method-toggle-button input[type="radio"]:checked + .method-toggle-content {
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.1);
}

.method-toggle-button input[type="radio"]:checked + .method-toggle-content .method-toggle-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(var(--color-primary-rgb), 0.5));
}

/* Focus styles */
.method-toggle-button input[type="radio"]:focus-visible + .method-toggle-content {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .input-section {
        padding: var(--space-24) var(--space-16);
    }

    .method-toggle-group {
        flex-direction: column;
        gap: var(--space-8);
    }

    .method-toggle-button {
        min-width: 100%;
    }

    .section-title {
        font-size: var(--font-size-xl);
    }

    .section-subtitle {
        font-size: var(--font-size-sm);
    }
}

/* Component Analysis Panel Redesign */
.analysis-panel {
    max-width: 1024px;
    width: 100%;
    margin: 0 auto var(--space-32);
    padding: var(--space-32) var(--space-24);
    border-radius: var(--radius-lg);
    background: rgba(0, 20, 40, 0.2);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel-header {
    text-align: center;
    margin-bottom: var(--space-32);
    position: relative;
}

.panel-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-12);
    background: linear-gradient(135deg,
        var(--color-primary),
        rgba(0, 150, 255, 1)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    position: relative;
}

.panel-subtitle {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Method Tabs */
.method-tabs-container {
    margin: var(--space-24) auto var(--space-32);
    width: 100%;
    max-width: 600px;
}

.method-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    position: relative;
    gap: var(--space-4);
}

.method-tab {
    position: relative;
    cursor: pointer;
    width: 100%;
}

.method-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.method-tab-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-12) var(--space-8);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    text-align: center;
    height: 100%;
}

.tab-icon {
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.method-tab:hover .method-tab-content {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
}

.method-tab input[type="radio"]:checked + .method-tab-content {
    background: rgba(var(--color-primary-rgb), 0.15);
    color: var(--color-primary);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.1);
}

.method-tab input[type="radio"]:checked + .method-tab-content .tab-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(var(--color-primary-rgb), 0.5));
}

.method-tab input[type="radio"]:focus-visible + .method-tab-content {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Tab Content Container */
.tab-content-container {
    margin-top: var(--space-24);
    margin-bottom: var(--space-32);
}

.tab-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Input Card */
.input-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.input-card:hover {
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.input-header {
    padding: var(--space-24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.input-title {
    display: flex;
    align-items: flex-start;
    gap: var(--space-16);
}

.input-title h3 {
    margin: 0 0 var(--space-4) 0;
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.input-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.input-icon {
    flex-shrink: 0;
    color: var(--color-primary);
}

.input-body {
    padding: var(--space-24);
}

/* Component Textarea */
.component-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-16);
    background: rgba(0, 20, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-md);
    line-height: 1.6;
    resize: vertical;
    font-family: var(--font-family-base);
    transition: all 0.3s ease;
}

.component-textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.component-textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
    background: rgba(0, 20, 40, 0.4);
}

/* Component Select - CSS Fix for single dropdown arrow:
 * - Ensures consistent single chevron in custom selects
 * - Prevents tiling or duplication of SVG background
 * - Compatible with theme switching and cross-browser
 */
.select-container {
    position: relative;
}

.component-select {
    width: 100%;
    padding: var(--space-12) var(--space-16);
    background: rgba(0, 20, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-size-md);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: var(--select-caret-light);
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25em auto;
    padding-right: 2.5em;
}

.component-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.component-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
    background-color: rgba(0, 20, 40, 0.4);
    background-image: var(--select-caret-light);
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

/* Dark mode for component selects */
@media (prefers-color-scheme: dark) {
  .component-select {
    background-image: var(--select-caret-dark);
  }
  .component-select:focus {
    background-image: var(--select-caret-dark);
  }
}

[data-color-scheme="dark"] .component-select {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] .component-select {
  background-image: var(--select-caret-light);
}

/* Parameters Card */
.parameters-card {
    margin-top: var(--space-32);
    padding: var(--space-24);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.parameters-header {
    margin-bottom: var(--space-24);
    text-align: center;
}

.parameters-header h3 {
    margin: 0 0 var(--space-4) 0;
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.parameters-header p {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.parameters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-24);
}

.parameter-item {
    background: rgba(0, 20, 40, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-16);
    transition: all 0.3s ease;
}

.parameter-item:hover {
    background: rgba(0, 20, 40, 0.3);
    transform: translateY(-2px);
}

.parameter-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

.parameter-header h4 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-md);
    color: var(--color-text);
}

.parameter-header p {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin: 0;
}

.parameter-icon {
    flex-shrink: 0;
    color: var(--color-primary);
}

.parameter-control {
    position: relative;
}

.parameter-select {
    width: 100%;
    padding: var(--space-8) var(--space-12);
    background: rgba(0, 20, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: var(--select-caret-light);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em auto;
    padding-right: 2rem;
}

.parameter-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.parameter-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

/* Dark mode for parameter selects */
@media (prefers-color-scheme: dark) {
  .parameter-select {
    background-image: var(--select-caret-dark);
  }
}

[data-color-scheme="dark"] .parameter-select {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] .parameter-select {
  background-image: var(--select-caret-light);
}

/* Action Container */
.action-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.analyze-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-32);
    background: linear-gradient(135deg,
        var(--color-primary) 0%,
        rgba(0, 150, 255, 0.8) 100%
    );
    border: none;
    border-radius: var(--radius-full);
    color: #fff;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 220px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 150, 255, 0.2),
        inset 0 1px rgba(255, 255, 255, 0.2);
}

.analyze-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transform: translateX(-100%);
    animation: btnShine 3s ease-in-out infinite;
}

.analyze-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 12px 32px rgba(0, 150, 255, 0.3),
        inset 0 1px rgba(255, 255, 255, 0.3);
}

.analyze-button:active {
    transform: translateY(1px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(0, 150, 255, 0.2),
        inset 0 1px rgba(255, 255, 255, 0.2);
}

.analyze-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.analyze-button:hover .analyze-icon {
    transform: rotate(15deg);
}

.spinner {
    position: absolute;
    width: 24px;
    height: 24px;
    display: none;
}

.spinner.hidden {
    display: none;
}

.spinner:not(.hidden) {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes spinnerRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading and Animation States for Analyze Button */
.analyze-button.loading {
    opacity: 0.8;
    cursor: not-allowed;
    background: linear-gradient(135deg,
        rgba(var(--color-primary-rgb), 0.7) 0%,
        rgba(0, 150, 255, 0.6) 100%
    );
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 150, 255, 0.15),
        inset 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.analyze-button.loading span {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.analyze-button.loading::after {
    content: 'Analyzing...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseText 1.5s ease-in-out infinite;
}

.analyze-button.loading .analyze-icon {
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.analyze-button.loading .spinner {
    display: block;
    position: absolute;
    right: var(--space-20);
    width: 24px;
    height: 24px;
}

.analyze-button.error {
    background: linear-gradient(135deg,
        var(--color-error) 0%,
        rgba(255, 100, 100, 0.8) 100%
    );
    animation: buttonShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes buttonShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .analysis-panel {
        padding: var(--space-24) var(--space-16);
    }
    
    .method-tabs {
        flex-direction: column;
        max-width: 100%;
    }
    
    .method-tab-content {
        padding: var(--space-10) var(--space-12);
    }
    
    .parameters-grid {
        grid-template-columns: 1fr;
    }
    
    .input-header, .input-body {
        padding: var(--space-16);
    }
    
    .input-title {
        flex-direction: column;
        gap: var(--space-8);
        align-items: center;
        text-align: center;
    }
    
    .panel-title {
        font-size: var(--font-size-xl);
    }
    
    .panel-subtitle {
        font-size: var(--font-size-sm);
    }
}

/* Animation for Button Shine Effect */
@keyframes btnShine {
    0% { transform: translateX(-100%); }
    20%, 100% { transform: translateX(100%); }
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    cursor: pointer;
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-base);
    transition: background-color var(--duration-fast);
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.radio-option input[type="radio"] {
    margin: 0;
}

.input-panels {
    width: 100%;
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-24);
    margin-bottom: var(--space-24);
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px rgba(255, 255, 255, 0.1);
}

.input-header {
    margin-bottom: var(--space-16);
}

.input-label {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.label-text {
    line-height: 1.4;
}

.input-icon {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.input-helper {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-left: calc(20px + var(--space-8)); /* Align with text after icon */
    line-height: 1.5;
}

.input-container {
    position: relative;
}

.component-input {
    min-height: 120px;
    resize: vertical;
    font-size: var(--font-size-md);
    width: 100%;
    padding: var(--space-16);
    background: rgba(0, 20, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
    color: var(--color-text);
    transition: all 0.3s ease;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .glass-card {
        padding: var(--space-16);
    }
    
    .input-helper {
        margin-left: 0;
        margin-top: var(--space-4);
    }
    
    .input-label {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
}

.component-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.component-input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.select-wrapper {
    position: relative;
}

/* Note: Main component-select styling is already defined earlier.
   This redundant definition is removed to avoid conflicts. */

.sec-adjustments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-16);
}

.adjustment-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.adjustment-item label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.adjustment-select {
    width: 100%;
    padding: var(--space-10) var(--space-12);
    background-color: rgba(0, 20, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
    color: var(--color-text);
    font-size: var(--font-size-md);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: var(--select-caret-light);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em auto;
    padding-right: 2rem;
}

.adjustment-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(0, 20, 40, 0.5);
}

.adjustment-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.adjustment-select option {
    background: var(--color-background);
    color: var(--color-text);
    padding: var(--space-8);
}

/* Dark mode for adjustment selects */
@media (prefers-color-scheme: dark) {
  .adjustment-select {
    background-image: var(--select-caret-dark);
  }
}

[data-color-scheme="dark"] .adjustment-select {
  background-image: var(--select-caret-dark);
}

[data-color-scheme="light"] .adjustment-select {
  background-image: var(--select-caret-light);
}

.analyze-btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-32);
    padding: 0 var(--space-16);
}

.analyze-btn {
    width: 100%;
    max-width: 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-24);
    background: linear-gradient(135deg,
        var(--color-primary) 0%,
        rgba(0, 150, 255, 0.8) 100%
    );
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-btn-primary-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    transition: all 0.3s ease;
    overflow: hidden;
    min-height: 56px; /* Ensure consistent height */
}

.analyze-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    z-index: 1;
    transform: translateX(-100%);
    animation: btnShine 3s ease-in-out infinite;
}

.analyze-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(0, 150, 255, 0.3),
        0 4px 8px rgba(0, 150, 255, 0.2);
}

.analyze-btn:hover .analyze-icon {
    transform: rotate(15deg);
}

.analyze-btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 4px 16px rgba(0, 150, 255, 0.2),
        0 2px 4px rgba(0, 150, 255, 0.1);
}

.analyze-btn.loading {
    cursor: wait;
    opacity: 0.8;
}

.analyze-btn.loading .btn-text {
    opacity: 0;
}

.analyze-btn.loading .analyze-icon {
    display: none;
}

.analyze-btn.loading .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
    width: 24px;
    height: 24px;
}

.spinner-circle {
    animation: spin 1.5s linear infinite;
    transform-origin: center;
}

.spinner-circle circle {
    stroke-dasharray: 150;
    stroke-dashoffset: 0;
    transform-origin: center;
    animation: spinnerDash 1.5s ease-in-out infinite;
}

@keyframes spinnerDash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes btnShine {
    0% { transform: translateX(-100%); }
    20%, 100% { transform: translateX(100%); }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .analyze-button::before {
        animation: none;
    }
    
    .analyze-button.loading::after {
        animation: none;
    }
    
    .spinner-circle {
        animation: spin 2.5s linear infinite; /* Slower animation */
    }
    
    .spinner-circle circle {
        animation: spinnerDash 2.5s ease-in-out infinite; /* Slower animation */
    }
    
    @keyframes buttonShake {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(-1px); }
    }
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error banner */
.error-banner {
    margin-bottom: var(--space-24);
    padding: var(--space-16);
    background: rgba(var(--color-error-rgb), 0.1);
    border: 1px solid rgba(var(--color-error-rgb), 0.3);
    border-radius: var(--radius-base);
    backdrop-filter: blur(10px);
}

.error-content {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    color: var(--color-error);
    font-weight: var(--font-weight-medium);
}

/* Results section */
.results-section {
    margin-bottom: var(--space-32);
    display: grid;
    gap: var(--space-24);
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
}

.results-section .glass-panel {
    padding: var(--space-32);
    border-radius: var(--radius-lg);
}

.results-section h2 {
    margin-bottom: var(--space-32);
    text-align: center;
}

.results-section h3 {
    margin-bottom: var(--space-16);
    color: var(--color-primary);
}

/* Feature Details */
.feature-details {
    background: var(--color-bg-6);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-16);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-12);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.detail-item label {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.detail-item span {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

/* About Feature */
.about-feature {
    background: var(--color-bg-7);
}

.about-feature p {
    line-height: var(--line-height-normal);
    color: var(--color-text-secondary);
}

/* Visual highlight when AI updates the About panel (temporary) */
.about-update-highlight {
  background-color: rgba(var(--color-teal-500-rgb), 0.06);
  box-shadow: 0 0 0 3px rgba(var(--color-teal-500-rgb), 0.12);
  transition: background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

/* Analysis grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-24);
    margin-bottom: var(--space-32);
}

.analysis-card {
    padding: var(--space-24);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    text-align: center;
    backdrop-filter: blur(10px);
    transform: translateZ(0);
    transition: all 0.3s ease;
    position: relative;
}

.analysis-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at 50% 0%,
        rgba(255, 255, 255, 0.1),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.analysis-card:hover {
    transform: translateY(-5px) translateZ(0);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(0, 150, 255, 0.1);
}

.analysis-card:hover::before {
    opacity: 1;
}

.analysis-card h3 {
    margin-bottom: var(--space-16);
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
}

.value-display {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-12);
    color: var(--color-primary);
    text-shadow: 
        0 0 10px rgba(0, 150, 255, 0.3),
        0 0 20px rgba(0, 150, 255, 0.2);
    animation: valuePulse 2s ease-in-out infinite;
    position: relative;
}

.value-display::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--color-primary),
        transparent
    );
}

@keyframes valuePulse {
    0% { text-shadow: 0 0 10px rgba(0, 150, 255, 0.3); }
    50% { text-shadow: 0 0 20px rgba(0, 150, 255, 0.5); }
    100% { text-shadow: 0 0 10px rgba(0, 150, 255, 0.3); }
}

.description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-normal);
}

/* ASIL result */
.asil-result {
    text-align: center;
    padding: var(--space-32);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.asil-result h3 {
    margin-bottom: var(--space-24);
    font-size: var(--font-size-xl);
}

.asil-badge {
    display: inline-block;
    padding: var(--space-16) var(--space-32);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-16);
    background: linear-gradient(135deg, var(--color-primary), var(--color-teal-300));
    box-shadow: 
        0 4px 16px rgba(var(--color-primary-rgb, 33, 128, 141), 0.3),
        0 0 30px rgba(0, 150, 255, 0.3),
        inset 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    animation: badgePulse 3s ease-in-out infinite;
}

.asil-badge::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, 
        transparent 20%,
        rgba(255, 255, 255, 0.2),
        transparent 80%
    );
    border-radius: var(--radius-full);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

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

.asil-level {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-btn-primary-text);
}

.asil-badge.asil-a {
    background: linear-gradient(135deg, var(--color-success), var(--color-teal-300));
}

.asil-badge.asil-b {
    background: linear-gradient(135deg, var(--color-warning), var(--color-orange-400));
}

.asil-badge.asil-c {
    background: linear-gradient(135deg, var(--color-orange-500), var(--color-red-400));
}

.asil-badge.asil-d {
    background: linear-gradient(135deg, var(--color-error), var(--color-red-400));
}

.asil-badge.asil-qm {
    background: linear-gradient(135deg, var(--color-info), var(--color-slate-500));
}

.asil-explanation {
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Save ASIL section */
.save-asil-section {
    margin-top: var(--space-24);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-12);
}

.save-status {
    padding: var(--space-12) var(--space-16);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--duration-normal) var(--ease-standard);
}

.save-status.match {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.2);
}

.save-status.error {
    background: rgba(var(--color-error-rgb), 0.1);
    color: var(--color-error);
    border: 1px solid rgba(var(--color-error-rgb), 0.2);
}

.save-status.saved {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

/* NEW: 3-Column Safety Analysis Grid */
.safety-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-24);
    margin-bottom: var(--space-24);
}

.safety-analysis-grid .glass-panel {
    padding: var(--space-24);
    border-radius: var(--radius-lg);
}

/* Individual column backgrounds */
.hazards-section {
    background: var(--color-bg-4);
}

.failure-modes {
    background: var(--color-bg-8);
}

.safety-recommendations {
    background: var(--color-bg-3);
}

/* Lists */
.hazards-list,
.failure-list,
.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hazards-list li,
.failure-list li,
.recommendations-list li {
    padding: var(--space-12);
    margin-bottom: var(--space-8);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.hazards-list li:hover,
.failure-list li:hover,
.recommendations-list li:hover {
    transform: translateX(5px) translateZ(0);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(0, 150, 255, 0.1);
}

.hazards-list li::before,
.failure-list li::before,
.recommendations-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: all 0.6s ease;
}

.hazards-list li:hover::before,
.failure-list li:hover::before,
.recommendations-list li:hover::before {
    left: 100%;
}

/* Comparison Table */
.comparison-section {
    background: var(--color-bg-1);
}

.comparison-table-container {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.comparison-table th,
.comparison-table td {
    padding: var(--space-12);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.comparison-table td {
    color: var(--color-text-secondary);
}

.match-yes {
    color: var(--color-success);
    font-weight: var(--font-weight-semibold);
}

.match-no {
    color: var(--color-error);
    font-weight: var(--font-weight-semibold);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-16);
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
}

.database-modal-content {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-24);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    transition: background-color var(--duration-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: var(--space-24);
}

.form-actions {
    display: flex;
    gap: var(--space-12);
    margin-top: var(--space-24);
}

.form-actions .btn {
    flex: 1;
}

/* Key status */
.key-status {
    margin-top: var(--space-8);
    padding: var(--space-8);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.key-status.success {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
    border: 1px solid rgba(var(--color-success-rgb), 0.2);
}

.key-status.error {
    background: rgba(var(--color-error-rgb), 0.1);
    color: var(--color-error);
    border: 1px solid rgba(var(--color-error-rgb), 0.2);
}

.key-status.testing {
    background: rgba(var(--color-info-rgb), 0.1);
    color: var(--color-info);
    border: 1px solid rgba(var(--color-info-rgb), 0.2);
}

/* API instructions */
.api-instructions {
    margin-top: var(--space-32);
    padding-top: var(--space-24);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.api-instructions h4 {
    margin-bottom: var(--space-16);
    color: var(--color-text-secondary);
}

.provider-instructions {
    display: grid;
    gap: var(--space-16);
    margin-bottom: var(--space-16);
}

.instruction-item {
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.instruction-item strong {
    display: block;
    margin-bottom: var(--space-8);
    color: var(--color-primary);
}

.instruction-item p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.demo-note {
    padding: var(--space-12);
    background: var(--color-bg-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    margin: 0;
}

/* Database Controls */
.database-controls {
    display: flex;
    gap: var(--space-16);
    margin-bottom: var(--space-24);
    align-items: end;
}

.database-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

.database-actions {
    display: flex;
    gap: var(--space-12);
}

.search-input {
    min-width: 250px;
}

.category-filter {
    min-width: 150px;
}

/* Components Table */
.components-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
}

.components-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.components-table th,
.components-table td {
    padding: var(--space-12);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.components-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    position: sticky;
    top: 0;
}

.components-table td {
    color: var(--color-text-secondary);
}

.components-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table-actions {
    display: flex;
    gap: var(--space-8);
}

.btn-sm {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

/* ASIL Guide Content */
.asil-guide-content {
    max-height: 60vh;
    overflow-y: auto;
}

.guide-section {
    margin-bottom: var(--space-24);
    padding-bottom: var(--space-16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h3 {
    margin-bottom: var(--space-12);
    color: var(--color-primary);
}

.guide-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-section li {
    padding: var(--space-8);
    margin-bottom: var(--space-4);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

/* Component Form */
.sec-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-16);
}

/* Component Panel Styles */
.component-analysis-panel {
    padding: var(--space-24);
    border-radius: var(--radius-lg);
    background: linear-gradient(
        135deg,
        rgba(0, 40, 83, 0.8) 0%,
        rgba(6, 20, 40, 0.9) 100%
    );
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.component-analysis-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at center,
        rgba(0, 150, 255, 0.1),
        transparent 70%
    );
    animation: rotateBg 20s linear infinite;
    pointer-events: none;
}

.panel-header {
    text-align: center;
    margin-bottom: var(--space-32);
    position: relative;
}

.panel-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-8);
    background: linear-gradient(135deg,
        var(--color-primary),
        rgba(0, 150, 255, 1)
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.panel-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    max-width: 600px;
    margin: 0 auto;
}

.analysis-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-24);
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: var(--space-8);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.component-input {
    width: 100%;
    padding: var(--space-12);
    background: rgba(0, 20, 40, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-md);
    line-height: 1.6;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.component-input:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(0, 150, 255, 0.1);
}

.component-input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(0, 150, 255, 0.2);
    background: rgba(0, 20, 40, 0.4);
}

.radio-options {
    display: flex;
    justify-content: center;
    gap: var(--space-16);
    margin-bottom: var(--space-24);
}

.radio-option {
    position: relative;
    padding: var(--space-12) var(--space-20);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-option label {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
}

.radio-option .radio-circle {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + label .radio-circle {
    border-color: var(--color-primary);
    background: rgba(0, 150, 255, 0.1);
}

.radio-option input[type="radio"]:checked + label .radio-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: radioScale 0.3s ease;
}

@keyframes radioScale {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.radio-option input[type="radio"]:focus-visible + label {
    outline: var(--focus-outline);
    outline-offset: 2px;
}

.radio-option.selected {
    background: rgba(0, 150, 255, 0.05);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(0, 150, 255, 0.1);
}

/* Database Input Styles */
.adjustments-panel {
    margin-top: var(--space-32);
}

.adjustments-header {
    text-align: center;
    margin-bottom: var(--space-24);
}

.adjustments-title {
    font-size: var(--font-size-xl);
    color: var(--color-primary);
    margin-bottom: var(--space-8);
}

.adjustments-subtitle {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.adjustments-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-24);
}

@media (min-width: 768px) {
    .adjustments-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.adjustment-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.adjustment-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
}

.adjustment-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-8);
}

.severity-icon {
    color: var(--color-error);
    background: rgba(var(--color-error-rgb), 0.1);
}

.exposure-icon {
    color: var(--color-warning);
    background: rgba(var(--color-warning-rgb), 0.1);
}

.controllability-icon {
    color: var(--color-success);
    background: rgba(var(--color-success-rgb), 0.1);
}

.adjustment-label {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.adjustment-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-normal);
}

.adjustment-select {
    width: 100%;
    padding: var(--space-10) var(--space-12);
    background: rgba(0, 20, 40, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-base);
    color: var(--color-text);
    font-size: var(--font-size-md);
    appearance: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.adjustment-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 20, 40, 0.5);
}

.adjustment-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.2);
}

.adjustment-select option {
    background: var(--color-background);
    color: var(--color-text);
    padding: var(--space-8);
}

.adjustment-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 10px rgba(0, 150, 255, 0.1);
}

.adjustment-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 2px rgba(0, 150, 255, 0.2);
}

.adjustment-select option {
    background: var(--color-background);
    color: var(--color-text);
    padding: var(--space-8);
}

.analyze-btn-wrapper {
    margin-top: var(--space-24);
    text-align: center;
}

.analyze-btn {
    min-width: 200px;
    padding: var(--space-12) var(--space-24);
    position: relative;
    overflow: hidden;
}

.analyze-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    z-index: -1;
    transform: translateX(-100%);
    animation: btnShine 3s ease-in-out infinite;
}

/* Loading state styles for analyze button */
.analyze-btn.loading {
    cursor: wait;
    opacity: 0.8;
}

.analyze-btn.loading .btn-text {
    visibility: hidden;
}

.analyze-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-right-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s ease infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Button disabled state improvements */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    /* 3-column layout becomes single column on mobile */
    .safety-analysis-grid {
        grid-template-columns: 1fr;
        gap: var(--space-16);
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .title {
        font-size: var(--font-size-3xl);
    }
    
    .input-section,
    .results-section .glass-panel {
        padding: var(--space-24);
    }
    
    .header-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .database-controls {
        flex-direction: column;
    }
    
    .database-actions {
        flex-direction: column;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .sec-adjustments {
        grid-template-columns: 1fr;
    }
    
    .sec-inputs {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    /* On tablets, show 2 columns then 1 */
    .safety-analysis-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .safety-analysis-grid .safety-recommendations {
        grid-column: 1 / -1; /* Span both columns */
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: var(--space-12);
        padding-right: var(--space-12);
    }
    
    .modal {
        padding: var(--space-8);
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .database-modal-content {
        max-width: 100%;
    }
}

/* Integrated styles from component-panel.css and database-input.css */
/* Component Panel Styles */
.input-method-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 1024px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    margin-right: auto;
}

.input-method-label {
    text-align: center;
    display: block;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    font-weight: 600;
}

.radio-group {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 0.5rem;
}

.radio-card {
    position: relative;
    cursor: pointer;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    min-width: 200px;
    flex: 1;
    max-width: 280px;
    display: flex;
    justify-content: center;
}

.radio-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.radio-icon {
    font-size: 1.8rem;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin-bottom: 0.3rem;
}

.radio-text {
    font-size: 1.1rem;
    color: var(--color-text);
    text-align: center;
}

.radio-card input[type="radio"]:checked + .radio-content {
    color: var(--color-primary);
}

.radio-card input[type="radio"]:checked ~ .radio-content .radio-text {
    color: var(--color-primary);
}

.radio-card input[type="radio"]:checked ~ .radio-content .radio-icon {
    background: rgba(var(--color-primary-rgb), 0.15);
}

.radio-card input[type="radio"]:focus-visible + .radio-content {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Database Input Styles */
.database-input {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease-out;
}

.component-select-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 1px rgba(255, 255, 255, 0.1);
}

.centered-label {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.label-icon {
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin-right: 0.3rem;
}

/* Enhanced Badge Styles for Animation Demo */
.new-badge {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(16, 185, 129, 0.8));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.updated-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.8));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.critical-badge {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.8));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.high-priority {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.8), rgba(217, 119, 6, 0.8));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.important-info {
    position: relative;
    overflow: hidden;
}

/* Demo Cards Specific Styles */
.demo-cards-grid .demo-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.demo-card:hover::before {
    opacity: 1;
}

/* Enhanced Card Styling */
.analysis-card,
.result-panel,
.component-card,
.summary-card,
.info-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Flip Card Enhancement */
.flip-back-content {
    text-align: center;
}

.flip-back-content .detail-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.flip-back-content h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.flip-back-content ul {
    text-align: left;
    margin: 0;
    padding-left: 1.2rem;
}

.flip-back-content li {
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

.flip-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Social Links Styles */
.social-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-right: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.social-link:hover::before {
    left: 100%;
}

.social-link.github-link:hover {
    background: rgba(88, 96, 105, 0.2);
    color: #58606d;
}

.social-link.linkedin-link:hover {
    background: rgba(10, 102, 194, 0.2);
    color: #0a66c2;
}

.social-link svg {
    width: 20px;
    height: 20px;
    z-index: 1;
    position: relative;
}

/* Footer Styles */
.footer {
    margin-top: 4rem;
    padding: 3rem 0 2rem;
    background: linear-gradient(135deg, 
        rgba(var(--background-rgb), 0.95), 
        rgba(var(--surface-rgb), 0.98)
    );
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(var(--border-rgb), 0.3);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(var(--primary-rgb), 0.5), 
        transparent
    );
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.footer-info h3 {
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.footer-info p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.footer-info .copyright {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 1rem;
}

.footer-section h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.footer-section a:hover {
    color: var(--primary-color);
    transform: translateX(4px);
}

.footer-section a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.footer-section a:hover::after {
    width: 100%;
}

.footer-social h4 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.social-links-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.social-link-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.social-link-footer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.social-link-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.social-link-footer:hover::before {
    left: 100%;
}

.social-link-footer.github-footer:hover {
    background: rgba(88, 96, 105, 0.15);
    color: #58606d;
    border-color: rgba(88, 96, 105, 0.3);
}

.social-link-footer.linkedin-footer:hover {
    background: rgba(10, 102, 194, 0.15);
    color: #0a66c2;
    border-color: rgba(10, 102, 194, 0.3);
}

.social-link-footer svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.social-link-footer span {
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 1;
    position: relative;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .social-links-footer {
        align-items: center;
    }
    
    .social-link-footer {
        justify-content: center;
        max-width: 200px;
    }
}

/* Responsive Header Social Links */
@media (max-width: 576px) {
    .social-links {
        gap: 0.5rem;
    }
    
    .social-link {
        width: 32px;
        height: 32px;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
}

/* Animation Enhancements for Social Links */
.social-link,
.social-link-footer {
    animation: socialPulse 3s ease-in-out infinite;
}

.social-link:nth-child(1) {
    animation-delay: 0s;
}

.social-link:nth-child(2) {
    animation-delay: 0.2s;
}

.social-link-footer:nth-child(1) {
    animation-delay: 0.1s;
}

.social-link-footer:nth-child(2) {
    animation-delay: 0.3s;
}

@keyframes socialPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
}
