/* HED Modern Design System */

:root {
  /* Color Palette - Navy blue to match HED brand */
  --primary-blue: #000080;      /* Navy blue - matches brain graphic */
  --primary-dark: #000066;      /* Darker navy for depth */
  --accent-cyan: #06b6d4;       /* Cyan accent */
  --accent-purple: #8b5cf6;     /* Purple for science/research */
  --success-green: #10b981;     /* Success states */
  --warning-amber: #f59e0b;     /* Warnings */
  --error-red: #ef4444;         /* Errors */
  
  /* Neutrals - Light Theme */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Semantic Colors - Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Dark Theme */
[data-bs-theme="dark"] {
  --primary-blue: #3b82f6;      /* Brighter blue for dark mode */
  --primary-dark: #2563eb;
  
  /* Neutrals - Dark Theme */
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-400: #64748b;
  --gray-500: #94a3b8;
  --gray-600: #cbd5e1;
  --gray-700: #e2e8f0;
  --gray-800: #f1f5f9;
  --gray-900: #f8fafc;
  
  /* Semantic Colors - Dark Theme */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  
  /* Shadows for dark mode */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

/* System preference dark mode fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme]) {
    --primary-blue: #3b82f6;
    --primary-dark: #2563eb;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-900: #f8fafc;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
  }
}

/* Base Styles */
body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  color: var(--primary-blue);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Modern Navigation */
.navbar-modern {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-md) 0;
}

.navbar-modern .container {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 8rem;
  padding-right: 8rem;
}

.navbar-modern .navbar-brand {
  margin-right: 2rem;
}

.navbar-modern .navbar-brand img {
  height: 4rem;
  width: auto;
  display: block;
}


/* Custom background matching navbar gradient */
.bg-custom {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-dark) 100%) !important;
}

/* Hamburger menu icon - white for dark navbar */
.navbar-modern .navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  padding: 0.5rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-modern .navbar-toggler:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.navbar-modern .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5em;
  height: 1.5em;
  display: inline-block;
}

.navbar-modern .navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
  outline: none;
}

.nav-link-modern {
  color: white !important;
  font-weight: 700;
  font-size: 1.5rem;
  padding: var(--space-sm) var(--space-md) !important;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link-modern:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.navbar-nav {
  gap: 0.5rem;
}

/* Hero Section */
.hero-modern {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}

.hero-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e2e8f0' fill-opacity='0.4'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-lg);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: var(--space-xl);
}

/* Feature Cards */
.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--gray-200);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  color: white;
  font-size: 1.5rem;
}

/* Buttons */
.btn-modern-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
  border: none;
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.btn-modern-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-modern-secondary {
  background: white;
  border: 2px solid var(--primary-blue);
  color: var(--primary-blue);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-modern-secondary:hover {
  background: var(--primary-blue);
  color: white;
}

/* Search */
.search-modern {
  position: relative;
  max-width: 400px;
}

.search-modern input {
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: var(--space-md) var(--space-lg);
  padding-right: 3rem;
}

.search-modern input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-modern button {
  position: absolute;
  right: var(--space-xs);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  padding: var(--space-sm);
}

/* Utility Classes */
.text-balance {
  text-wrap: balance;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive Typography */
.text-responsive-xl {
  font-size: clamp(1.5rem, 4vw, 3rem);
}

.text-responsive-lg {
  font-size: clamp(1.25rem, 3vw, 2rem);
}

/* Modern Footer */
.footer-modern {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-modern a {
  color: var(--gray-300);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-modern a:hover {
  color: var(--accent-cyan);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus states */
.btn-modern-primary:focus,
.btn-modern-secondary:focus,
.nav-link-modern:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Dark Theme Specific Overrides */
[data-bs-theme="dark"] .feature-card {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .hero-modern {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

[data-bs-theme="dark"] .hero-subtitle {
  color: var(--text-secondary);
}

[data-bs-theme="dark"] .btn-modern-secondary {
  background: var(--bg-secondary);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

[data-bs-theme="dark"] .btn-modern-secondary:hover {
  background: var(--primary-blue);
  color: white;
}

[data-bs-theme="dark"] .bg-light {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .bg-body-tertiary {
  background-color: var(--bg-secondary) !important;
}

[data-bs-theme="dark"] .text-muted {
  color: var(--text-muted) !important;
}

[data-bs-theme="dark"] .border-bottom {
  border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-bs-theme="dark"] .dropdown-item {
  color: var(--text-primary);
}

[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}
