/* Base styles for the entire site */
html,
body {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 30px; /* Default for mobile and smaller desktops */
}

@media (min-width: 1280px) {
  html {
    scroll-padding-top: 120px; /* For larger desktops */
  }
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #0c0c12;
  color: #ffffff;
  line-height: 1.6;
  max-width: 100vw;
  overflow-y: auto; /* Ensure vertical scrolling works properly */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scroll locking when mobile menu is open */
body.scroll-locked {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  /* Store current scroll position */
  top: calc(-1 * var(--window-scroll-y, 0px));
  left: 0;
}

/* Background patterns and effects */
.grid-bg {
  background-color: rgba(8, 10, 20, 0.95);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.9;
  position: relative;
  overflow: hidden;
}

/* Mobile circuit pattern (square) */
@media (max-width: 767px) {
  .grid-bg {
    background-image: url('../images/svg/circuit-pattern-mob.svg');
  }
}

/* Tablet and desktop circuit pattern (landscape) */
@media (min-width: 768px) {
  .grid-bg {
    background-image: url('../images/svg/circuit-pattern.svg');
    position: relative;
  }
}

/* Animated circuit node effect overlay */
.grid-bg:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 30% 40%, rgba(30, 202, 211, 0.7) 0%, transparent 12%),
    radial-gradient(circle at 70% 60%, rgba(30, 202, 211, 0.7) 0%, transparent 10%),
    radial-gradient(circle at 40% 80%, rgba(30, 202, 211, 0.7) 0%, transparent 11%),
    radial-gradient(circle at 80% 30%, rgba(30, 202, 211, 0.7) 0%, transparent 12%),
    radial-gradient(circle at 20% 20%, rgba(30, 202, 211, 0.7) 0%, transparent 10%),
    radial-gradient(circle at 60% 30%, rgba(30, 202, 211, 0.7) 0%, transparent 9%);
  pointer-events: none;
  animation: pulse-nodes 4s ease-in-out infinite;
}

/* Animated circuit flow effect overlay */
.grid-bg:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(30, 202, 211, 0.1) 50%,
      transparent 100%);
  pointer-events: none;
  animation: data-flow 25s linear infinite;
  /* Set z-index very low to be below everything */
  z-index: 0;
}

@keyframes pulse-nodes {

  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

@keyframes data-flow {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.hero-gradient {
  background: radial-gradient(circle at 50% 50%,
      rgba(30, 202, 211, 0.15) 0%,
      rgba(207, 35, 168, 0.08) 35%,
      rgba(12, 12, 18, 0.1) 70%);
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.3);
}

/* Background gradient */
.bg-gradient-animate {
  background: linear-gradient(135deg, 
      rgba(30, 202, 211, 0.4) 0%, 
      rgba(80, 44, 108, 0.4) 25%, 
      rgba(207, 35, 168, 0.4) 50%, 
      rgba(0, 45, 90, 0.4) 75%, 
      rgba(6, 131, 124, 0.4) 100%);
  background-size: 400% 400%;
  animation: gradient 10s ease infinite;
}

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

/* Container constraints */
.container {
  overflow-x: hidden;
  max-width: 100%;
  overflow-y: visible; /* Ensure vertical content flows properly */
}

.bg-flowing-data {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="none" stroke="%231ecad3" stroke-width="0.5" x="10" y="10" width="80" height="80" rx="10" ry="10" opacity="0.2"/></svg>');
  opacity: 0.05;
}

/* Animation classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.animate-pulse-slow {
  animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 0.2;
    transform: scale(0.97);
  }
}

.animate-glow {
  animation: glow 4s ease-in-out infinite;
}

@keyframes glow {

  0%,
  100% {
    filter: drop-shadow(0 0 5px rgba(30, 202, 211, 0.3));
  }

  50% {
    filter: drop-shadow(0 0 20px rgba(30, 202, 211, 0.7));
  }
}

/* Text effects */
.text-glow {
  text-shadow: 0 0 15px rgba(30, 202, 211, 0.5);
}

/* Header transitions */
#main-header {
  transition: all 0.3s ease;
}

#main-header.header-hidden {
  transform: translateY(-100%);
}

#main-header.header-visible {
  transform: translateY(0);
  background-color: rgba(12, 12, 18, 0.9);
  backdrop-filter: blur(8px);
}

/* Solid header styles */
#main-header.header-solid {
  background-color: rgba(12, 12, 18, 0.9);
  backdrop-filter: blur(8px);
}

/* Background patterns for Services page */
.bg-grid-pattern {
  background-image: 
    linear-gradient(rgba(30, 202, 211, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 202, 211, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: center center;
}

/* Hide scrollbar but keep scrolling functionality */
.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

.no-scrollbar::-webkit-scrollbar {
  display: none;             /* Chrome, Safari and Opera */
}

/* Section Fixes */
section {
  width: 100%;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Add padding to main content when header is solid */
@media (min-width: 1024px) {
  body.has-solid-header .main-content {
    padding-top: 104px;  /* Adjust based on your header height */
  }
}
@media (max-width: 1023px) {
  body.has-solid-header .main-content {
    padding-top: 96px;  /* Adjust based on your header height */
  }
}

/* Desktop Submenu - Updated for JavaScript control */
@media (min-width: 1024px) {
  .menu-item-has-children {
    position: relative;
  }

  /* Remove hover behavior as we're using JavaScript for more control */
  /*.menu-item-has-children:hover .submenu {
    display: block;
  }*/

  /* Force CSS update */
  .css-loaded .menu-item-has-children .submenu,
  .submenu {
    display: none;
    position: fixed;
    /* Changed from absolute to fixed as suggested */
    min-width: 280px;
    background-color: #1a1b26;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    /* margin-top: 0.5rem; Removed as we're setting position via JS */
    z-index: 100;
    /* Moderate z-index sufficient with fixed positioning */
    border: 1px solid rgba(75, 85, 99, 0.3);
  }

  /* Add a pseudo-element to bridge the gap between menu item and dropdown */
  .menu-item-has-children::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    /* Extend below the menu item */
    width: 100%;
    height: 10px;
    /* Size of the bridge */
    background-color: transparent;
    /* Invisible but part of hover area */
  }

  /* We're now controlling this via JavaScript instead of CSS hover */
  /*.css-loaded .menu-item-has-children:hover .submenu {
    display: block;
  }*/

  .submenu a {
    padding: 0.5rem 0.75rem;
    display: block;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
  }

  .submenu a:hover {
    background-color: rgba(55, 65, 81, 0.5);
  }
}

/* Mobile menu styling improvements */
#drawer-navigation h5 {
  font-size: 1.25rem;
  /* Larger menu title */
}

#drawer-navigation button svg {
  width: 1.5rem;
  /* Bigger close icon */
  height: 1.5rem;
}

/* Direct menu items styling */
#drawer-navigation ul>li>a,
#drawer-navigation ul>li>button {
  justify-content: flex-start;
  font-size: 1.125rem;
  padding: 0.5rem 0.75rem !important;
  margin-bottom: 0.5rem;
  display: flex;
  width: 100%;
}

/* Add spacing between mobile submenu items and chevron */
.mobile-dropdown button span {
  margin-right: 1rem;
  /* Add space between text and arrow */
}

/* Override any Tailwind styles */
@media (max-width: 1023px) {

  #drawer-navigation a,
  #drawer-navigation button {
    padding: 0.5rem 0.75rem !important;
  }
}

/* Mobile submenu styling */
.mobile-dropdown button {
  font-size: 1.125rem;
}

.mobile-dropdown .mobile-dropdown-arrow {
  transition: transform 0.2s ease;
}

.mobile-dropdown.active .mobile-dropdown-arrow {
  transform: rotate(180deg);
}

.mobile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-submenu.open {
  display: block;
  max-height: 500px;
  /* Large enough to contain all items */
  transition: max-height 0.5s ease-in;
}

/* Fix padding for mobile submenu items to align with parent items */
.mobile-submenu li a {
  padding: 0.5rem 0.75rem;
  width: 100%;
  display: block;
}

/* Footer Accordion Styling */
.footer-accordion {
  margin-bottom: 0;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(75, 85, 99, 0.1);
}

.footer-accordion button {
  padding: 0 0 0.5rem 0;
  margin-bottom: 0;
  width: 100%;
}

.footer-dropdown-arrow {
  transition: transform 0.3s ease;
}

.footer-content {
  display: none;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Footer grid layout fixes */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  row-gap: 0;
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    justify-content: space-between;
    gap: 3.5rem;
  }

  .footer-menus-grid {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 4rem;
  }

  .footer-accordion {
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
  }

  .footer-accordion button {
    border-bottom: none;
    padding: 0;
    margin-bottom: 0;
  }

  .footer-content {
    display: block !important;
    margin-bottom: 0;
  }
}

@media (min-width: 1280px) {
  .footer-menus-grid {
    gap: 8rem;
  }
}
.simple-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  row-gap: 0;
}
@media (min-width: 768px) {
  .simple-footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
/* Div background behind banner content */
.banner-content-mid {
  box-shadow: 0 0 10px 10px rgba(5, 5, 7, 0.3);
  background-color: rgba(5, 5, 7, 0.3);
}
@media (min-width: 769px) {
  .banner-content-mid {
    box-shadow: 0 0 50px 50px rgba(5, 5, 7, 0.6);
    background-color: rgba(5, 5, 7, 0.6);
  }
}
.banner-content-light {
  box-shadow: 0 0 10px 10px rgba(5, 5, 7, 0.1);
  background-color: rgba(5, 5, 7, 0.1);
}
@media (min-width: 769px) {
  .banner-content-light {
    box-shadow: 0 0 50px 50px rgba(5, 5, 7, 0.3);
    background-color: rgba(5, 5, 7, 0.3);
  }
}

/* Fix for lighthouse accessibility issue with Learn More links */
.learn-more::before {
    content: 'Learn more';
}
.read-now::before {
  content: 'Read now';
}

* Hero heading line spacing - ensures proper line-height for hero text */
.hero-line-spacing {
  line-height: 1.3 !important;
}

/* Responsive hero line spacing */
@media (min-width: 768px) {
  .hero-line-spacing {
    line-height: 1.25 !important;
  }
}

@media (min-width: 1024px) {
  .hero-line-spacing {
    line-height: 1.2 !important;
  }
}