/* Services Page Styles with Sticky Navigation */

:root {
  --primary-color: #1b6ef3;
  --primary-light: #4285f4;
  --primary-dark: #0d4cb3;
  --secondary-text: #8baed8; /* Complementary blue for better harmony */
  --text-blue: #4a6997; /* Darker blue for left column text - still blue but more readable */
  --background-dark: #0a1929;
  --background-medium: #0f2844;
  --light-gray: #f8f9fc;
  --medium-gray: #e0e0e0;
  --dark-gray: #555;
  --text-dark: #333;
  --text-light: #fff;
  --text-content: #505050; /* For right column list items */
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
  --transition-standard: all 0.25s ease;
  --header-height: 100px; /* Fixed height for header to reference elsewhere */
}

/* Base styles */
.services-page {
  background: var(--light-gray);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

/* Typography with optimal readability */
.services-page h1,
.services-page h2,
.services-page h3 {
  font-weight: 600;
  color: var(--primary-dark);
}

.services-page h2 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.services-page h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.services-page p {
  margin-bottom: 0; /* Remove bottom margin to align with bullets */
  max-width: 70ch; /* Optimal reading line length */
  line-height: 1.6;
}

/* Fixed Header at top of page */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(1, 4, 9, 0.95); /* This matches your --background-dark variable */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  height: var(--header-height);
}

.header-container {
  padding: 0.75rem 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Hero Section with padding to clear the fixed header */
.services-page .page-hero {
  background-image: linear-gradient(to bottom, #010409 0%, #0d1117 100%) !important;
  background-size: 100% 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  color: var(--text-light);
  padding-top: calc(var(--header-height) + 50px);
  padding-bottom: 50px;
  text-align: center;
  position: relative;
}

.services-page .page-hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.services-page .page-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.services-page .page-subtitle {
  color: var(--secondary-text);
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto;
}

/* Sticky Service Navigation that stays below the fixed header */
.service-nav {
  background-color: rgba(255, 255, 255, 0.98);
  position: sticky;
  top: var(--header-height); /* Stick right below the fixed header */
  z-index: 900;
  box-shadow: var(--shadow-light);
  padding: 0;
  margin-bottom: 2rem;
}

.service-tabs-wrapper {
  display: flex;
  justify-content: center;
  padding: 0;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto; /* Allow horizontal scrolling if needed */
}

.service-tab {
  color: var(--text-dark);
  text-decoration: none;
  padding: 1rem 1.25rem;
  font-weight: 500;
  text-align: center;
  transition: var(--transition-standard);
  position: relative;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.service-tab:hover, .service-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Main Content */
.content-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--medium-gray);
}

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

.section-intro {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-intro p {
  font-size: 1.2rem;
  color: var(--dark-gray);
  margin: 0 auto;
}

/* Two-Column Layout with Top-Aligned Bullets */
.service-list {
  max-width: 1100px;
  margin: 0 auto;
}

.service-list-item {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--medium-gray);
  display: flex;
  flex-direction: row;
  gap: 3rem;
  position: relative;
  scroll-margin-top: 180px; /* Modern browsers - adds space above when scrolling to this element */
}

.service-list-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.service-list-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Use blue text for left column content */
.service-list-item-content p {
  color: var(--text-blue);
}

.service-list-item-list {
  flex: 1;
  margin-top: 4rem; /* Align with paragraph text, calculated based on typography */
}

.service-list-item h3 {
  position: relative;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--medium-gray);
  width: 100%;
  transition: color 0.3s ease;
}

/* Better anchor target positioning */
.anchor-target {
  display: block;
  position: relative;
  visibility: hidden;
  height: 0;
  width: 0;
  pointer-events: none;
}

/* This provides a fallback for browsers that don't support scroll-margin-top */
#em-modeling::before,
#applications::before,
#specialized::before,
#research::before {
  content: "";
  display: block;
  height: 180px; /* Adjust this value based on your header + navigation height */
  margin-top: -180px;
  visibility: hidden;
  pointer-events: none;
}

/* Highlight target heading when scrolled to */
.highlight {
  color: var(--primary-color) !important;
}

/* Ensure anchor links work properly with the fixed header */
html {
  scroll-padding-top: 180px; /* Modern browsers - adjust to match your fixed header + nav height */
}

/* Improved list styling with top alignment */
.service-list-item ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.service-list-item ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
  color: var(--text-content);
}

.service-list-item ul li:last-child {
  margin-bottom: 0;
}

.service-list-item ul li:before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* Professional CTA Section */
.cta-section {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary-light));
  color: var(--text-light);
  text-align: center;
  padding: 4rem 0;
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
}

.cta-content h2 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 2rem;
}

.cta-content p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

.cta-content .btn {
  background-color: var(--text-light);
  color: var(--primary-color);
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border-radius: 4px;
  border: none;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition-standard);
}

.cta-content .btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

/* Footer */
.services-page footer {
  background-color: var(--background-dark);
  color: var(--text-light);
  padding: 4rem 0 1rem;
}

.services-page footer h4,
.services-page footer .footer-link,
.services-page footer .footer-text {
  color: var(--text-light);
}

/* UPDATED: Ensure footer bottom text is centered */
.services-page .footer-bottom,
.footer-bottom {
  text-align: center !important;
  margin-top: 40px;
  width: 100%;
}

.services-page .footer-bottom p,
.footer-bottom p {
  text-align: center !important;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
}

/* Mobile Service Navigation */
.mobile-service-nav {
  display: none;
}

/* Back to top button */
.back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: var(--text-light);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  z-index: 999;
  opacity: 0.7;
  transition: var(--transition-standard);
}

.back-to-top:hover {
  opacity: 1;
}

.back-to-top.visible {
  display: block;
}

/* Responsive Design */
@media (max-width: 992px) {
  :root {
    --header-height: 60px; /* Smaller header on medium screens */
  }
  
  .services-page .page-hero h1 {
    font-size: 2.5rem;
  }
  
  .service-list-item {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .service-list-item-list {
    margin-top: 0; /* Reset margin when in column layout */
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px; /* Smaller header on small screens */
  }
  
  .services-page .page-hero {
    padding-top: calc(var(--header-height) + 40px); /* Adjusted padding for smaller screens */
    padding-bottom: 60px;
  }
  
  .services-page h2 {
    font-size: 1.75rem;
  }
  
  .section-intro p {
    font-size: 1.1rem;
  }
  
  .content-section {
    padding: 4rem 0;
  }
  
  .service-list-item h3 {
    font-size: 1.35rem;
  }
  
  .cta-content h2 {
    font-size: 1.75rem;
  }
  
  /* Show simplified mobile service navigation */
  .service-nav {
    display: none; /* Hide desktop navigation */
  }
  
  .mobile-service-nav {
    display: block;
    background-color: rgba(255, 255, 255, 0.98);
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    box-shadow: var(--shadow-light);
    padding: 0;
    margin-bottom: 1.5rem;
  }
  
  .mobile-service-tabs {
    display: flex;
    justify-content: flex-start;
    padding: 0;
    overflow-x: auto;
  }
  
  .mobile-service-tab {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.75rem 1rem;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  
  .mobile-service-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
  }
}