/* PerturbArena Website Styles */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #2c3e50;
  --bg-color: #ffffff;
  --light-bg: #f8f9fa;
  --navbar-bg: #e8f4fd;
  --navbar-border: #bee5eb;
  --card-shadow: 0 8px 25px rgba(44, 62, 80, 0.1);
  --card-hover-shadow: 0 15px 35px rgba(44, 62, 80, 0.15);
  --gradient-primary: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  --gradient-light: linear-gradient(135deg, #e8f4fd 0%, #ffffff 100%);
}

/* Force override Bootstrap defaults */
.bg-light {
  background-color: var(--navbar-bg) !important;
}

.navbar-light {
  background-color: var(--navbar-bg) !important;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: #fafbfc;
}

/* Navigation Bar Styling */
.navbar.navbar-light.bg-light {
  background: var(--navbar-bg) !important;
  background-color: var(--navbar-bg) !important;
  box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1) !important;
  padding: 0.8rem 0 !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.navbar-brand {
  font-weight: bold;
  font-size: 1.8rem;
  color: var(--primary-color) !important;
  text-shadow: 0 1px 3px rgba(44, 62, 80, 0.1);
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  color: var(--secondary-color) !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--primary-color) !important;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem !important;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--secondary-color) !important;
  background-color: rgba(52, 152, 219, 0.1);
  transform: translateY(-2px);
}

.dropdown-menu {
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.7rem 1.5rem;
  transition: all 0.3s ease;
  color: var(--text-color);
}

.dropdown-item:hover,
.dropdown-item.active {
  background: var(--gradient-primary);
  color: white;
  transform: translateX(5px);
}

/* Hero Section */
.hero-section {
  background: var(--gradient-light) !important;
  background-color: #e8f4fd !important;
  padding: 5rem 0 !important;
  margin-bottom: 3rem !important;
  position: relative;
  overflow: hidden;
}

/* Alternative approach for hero background */
section.hero-section {
  background: linear-gradient(135deg, #e8f4fd 0%, #ffffff 100%) !important;
  min-height: 400px;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="g" cx="50%" cy="50%"><stop offset="0%" stop-color="%233498db" stop-opacity="0.03"/><stop offset="100%" stop-color="%233498db" stop-opacity="0"/></radialGradient></defs><circle fill="url(%23g)" cx="200" cy="200" r="300"/><circle fill="url(%23g)" cx="800" cy="800" r="300"/></svg>');
  background-size: 1000px 1000px;
  pointer-events: none;
  z-index: 0;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-title {
  color: var(--primary-color);
  font-weight: 800;
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(44, 62, 80, 0.1);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: var(--secondary-color);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 2rem;
  line-height: 1.4;
}

/* Cards and Components */
.task-card {
  border: none;
  box-shadow: var(--card-shadow);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 2rem;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid rgba(52, 152, 219, 0.1);
}

.task-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--card-hover-shadow);
  border-color: rgba(52, 152, 219, 0.2);
}

.task-card .card-body {
  padding: 2rem;
}

.task-number {
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  position: relative;
}

.task-number::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-primary);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.3;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.1; }
}

/* Figure and Image Styling */
.figure-container {
  text-align: center;
  margin: 3rem 0;
  position: relative;
}

.figure-img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.figure-img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.performance-table {
  font-size: 0.9rem;
}

.performance-table th {
  background-color: var(--light-bg);
  font-weight: 600;
}

/* Button Styling */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2980b9 0%, #34495e 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-outline-primary {
  border: 2px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 0.75rem 2rem;
  font-weight: 600;
  border-radius: 8px;
  background: transparent;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a252f 100%);
  color: white;
  text-align: center;
  padding: 3rem 0;
  margin-top: 4rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.footer p {
  margin: 0;
  opacity: 0.9;
  font-weight: 500;
}

/* Metric Highlights */
.metric-highlight {
  background: linear-gradient(135deg, rgba(232, 244, 253, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
  border: 1px solid rgba(52, 152, 219, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 0 2px 2px 0;
}

.metric-highlight:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: rgba(52, 152, 219, 0.2);
}

.metric-highlight h4 {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

.metric-highlight h5 {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.metric-highlight .text-primary {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: var(--secondary-color) !important;
  /* Remove gradient text to fix readability */
}

/* Section Headings */
h2 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

h3 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Lead text styling */
.lead {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.9;
}

/* Research Impact section - only for numeric values */
.text-center h3.text-primary {
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* Regular text-primary styling */
.text-primary {
  color: var(--secondary-color) !important;
  font-weight: 600 !important;
}

/* Interactive legend styles */
.d3-tooltip {
  pointer-events: none;
  background: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

svg text {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Section spacing */
section {
  margin-bottom: 4rem;
}

/* Equal height model cards - specifically for methods page */
.container .row.mb-4 {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.container .row.mb-4 > .col-md-4,
.container .row.mb-4 > .col-md-6 {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.container .row.mb-4 .metric-highlight {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .task-card .card-body {
    padding: 1.5rem;
  }
  
  .task-number {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
  
  .btn-primary, .btn-outline-primary {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
  }
  
  .metric-highlight {
    padding: 1.2rem;
    margin: 1rem 0;
    min-height: auto;
  }
  
  h2::after {
    width: 40px;
  }
  
  /* Reset equal height on mobile for better stacking */
  .container .row.mb-4 {
    flex-direction: column;
  }
  
  .container .row.mb-4 > .col-md-4,
  .container .row.mb-4 > .col-md-6 {
    margin-bottom: 1rem;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .navbar-brand {
    font-size: 1.5rem;
  }
  
  .task-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
}