/* css/header.css */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Body override to allow banner to start at the top on overlapping pages, and safe margin on standard pages */
html body {
  padding-top: 95px;
}

/* Zero out body padding for hero-based pages where header overlaps */
html body:has(.banner-container),
html body:has(.banner),
html body:has(.overview-banner),
html body:has(.leadership-banner),
html body:has(.testimonial-hero),
html body:has(.why-hero),
html body:has(.howit-hero),
html body:has(.hero),
html body:has(.web-header),
html body:has(.talent-header),
html body:has(.offshore-header),
html body:has(.mobile-dev-header),
html body:has(.hrms-header),
html body:has(.digital-header),
html body:has(.analytics-header),
html body:has(.consulting-header),
html body:has(.ai-header),
html body:has(.contact-header) {
  padding-top: 0;
}

/* Push content inside hero/banner sections down to clear the floating header */
body .web-header,
body .talent-header,
body .offshore-header,
body .mobile-dev-header,
body .hrms-header,
body .digital-header,
body .analytics-header,
body .consulting-header,
body .ai-header,
body .contact-header {
  padding-top: 130px;
}

/* Floating Header Container - Compact Width - Higher Specificity Overrides Bootstrap Default Navbar */
body nav.navbar.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 83%;
  margin: 0 auto;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  background-color: #ffffff;
  border: none !important;
  box-shadow: none !important;
  z-index: 1000;
  height: 80px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

@media (max-width: 1199.98px) {
  body nav.navbar.fixed-header {
    padding: 0 10px;
  }
}

/* Adjust Container */
body nav.navbar.fixed-header .container {
  max-width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand/Logo */
body nav.navbar.fixed-header .navbar-brand {
  max-height: 80px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

body nav.navbar.fixed-header .navbar-brand img {
  width: auto;
  object-fit: contain;
}

/* Navigation Menu */
body nav.navbar.fixed-header .custom-menubar {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  /* Pushes the nav menu items slightly lower on the Y-axis */
}

body nav.navbar.fixed-header .custom-menubar>li {
  margin: 0;
  padding: 0;
}

body nav.navbar.fixed-header .custom-menubar>li>a {
  color: #002f56;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 10px;
  /* Reduced side padding */
  text-decoration: none;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

body nav.navbar.fixed-header .custom-menubar>li>a:hover {
  color: #0068bc;
  background-color: #f4f7fa;
}

/* Caret Animation */
body nav.navbar.fixed-header .custom-menubar>li>a svg {
  transition: transform 0.2s ease;
}

body nav.navbar.fixed-header .custom-menubar>li:hover>a svg,
body nav.navbar.fixed-header .custom-menubar>li>a.active svg {
  transform: rotate(180deg);
}

/* Dropdown Menu styling */
body nav.navbar.fixed-header .custom-menubar>li .dropdown-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  margin-top: 5px;
  background: #ffffff;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  z-index: 1010;
}

body nav.navbar.fixed-header .custom-menubar>li:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body nav.navbar.fixed-header .custom-menubar>li .dropdown-menu li {
  width: 100%;
}

body nav.navbar.fixed-header .custom-menubar>li .dropdown-menu li a {
  font-weight: 500;
  color: #333333;
  padding: 10px 20px;
  font-size: 0.9rem;
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
}

body nav.navbar.fixed-header .custom-menubar>li .dropdown-menu li a:hover {
  background-color: #f4f7fa;
  color: #002f56;
  padding-left: 24px;
}

/* Contact Us Button - Specific Overrides for Color and Structure */
body nav.navbar.fixed-header .custom-menubar>li a.nav-btn-contact,
body a.nav-btn-contact {
  background-color: #002f56;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: none;
}

body nav.navbar.fixed-header .custom-menubar>li a.nav-btn-contact:hover,
body a.nav-btn-contact:hover {
  background-color: #004b89;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 47, 86, 0.3);
  transform: translateY(-1px);
}

/* Responsive rules */
@media (max-width: 991.98px) {
  body nav.navbar.fixed-header {
    top: 0;
    width: 95%;
    left: 2.5%;
    right: 2.5%;
    height: auto;
    min-height: 70px;
    padding: 10px 20px;
  }

  body nav.navbar.fixed-header .navbar-collapse {
    background: #ffffff;
    border-radius: 12px;
    margin-top: 10px;
    padding: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  body nav.navbar.fixed-header .custom-menubar {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }

  body nav.navbar.fixed-header .custom-menubar>li>a {
    padding: 12px 16px;
    width: 100%;
  }

  body nav.navbar.fixed-header .custom-menubar>li .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 20px;
    width: 100%;
    display: none;
    margin-top: 0;
  }

  body nav.navbar.fixed-header .custom-menubar>li:hover .dropdown-menu {
    display: block;
  }

  body nav.navbar.fixed-header .custom-menubar>li a.nav-btn-contact,
  body .nav-btn-contact {
    width: 100%;
    margin-top: 10px;
    text-align: center;
    display: flex;
  }
}

.ai-mega-dropdown {
  position: fixed;
  top: 84px;
  left: 0;
  right: 0;
  width: 83%;
  margin: 0 auto;
  background: linear-gradient(to right, rgba(65, 65, 65, 0.45) 0%, rgba(25, 25, 25, 0.55) 100%);
  backdrop-filter: blur(35px) saturate(170%);
  -webkit-backdrop-filter: blur(35px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  z-index: 1999;
  padding: 12px 30px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100vh);
  transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-mega-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ai-mega-title {
  color: #38bdf8;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.5px;
  text-align: left;
}

.ai-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 35px;
}

.ai-mega-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 35px;
}

.ai-mega-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 35px;
}

.ai-mega-item {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  font-size: 1.05rem;
  font-family: 'Poppins', sans-serif;
  transition: all 0.25s ease;
  padding: 4px 0;
  background: transparent;
  border: none;
}

/* Sub-dropdown Menu for IT Software Consultancy */
.services-sub-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 440px;
  background: linear-gradient(to right, rgba(65, 65, 65, 0.9) 0%, rgba(25, 25, 25, 0.95) 100%);
  backdrop-filter: blur(35px) saturate(170%);
  -webkit-backdrop-filter: blur(35px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  z-index: 2010;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100vh);
  transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 10px;
}

.services-sub-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.services-sub-title {
  color: #38bdf8;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}

.services-sub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

.services-sub-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.services-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
  white-space: nowrap;
}

.services-sub-item img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.services-sub-item:hover {
  color: #38bdf8;
  transform: translateX(4px);
}

.ai-mega-icon-wrapper {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-mega-icon-wrapper img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

/* Fine-tuned sizing to balance visual weight (solid/circular vs outline icons) */
.ai-mega-icon-wrapper img[src*="outsystems" i],
.ai-mega-icon-wrapper img[src*="sitecore" i] {
  width: 28px;
  height: 28px;
}

.ai-mega-icon-wrapper img[src*="LLM" i] {
  width: 30px;
  height: 30px;
}

.ai-mega-icon-wrapper img[src*="cms" i] {
  width: 42px;
  height: 42px;
}

.ai-mega-icon-wrapper img[src*="E-com" i] {
  width: 40px;
  height: 40px;
}

.ai-mega-icon-wrapper img[src*="Wordpress" i] {
  width: 38px;
  height: 38px;
}

.ai-mega-icon-wrapper img[src*="Shopify" i] {
  width: 34px;
  height: 34px;
}

.ai-mega-item:hover {
  color: #38bdf8;
  transform: translateX(4px);
}

.ai-mega-item:hover .ai-mega-icon-wrapper img {
  transform: scale(1.1) rotate(5deg);
}

/* Override bootstrap dropdown for AI Innovations on desktop */
@media (min-width: 992px) {

  body nav.navbar.fixed-header .ai-dropdown-parent:hover .dropdown-menu,
  body nav.navbar.fixed-header .ai-dropdown-parent .dropdown-menu {
    display: none;
    opacity: 0;
    visibility: hidden;
  }

  /* Active state color on link for any active menu item */
  body nav.navbar.fixed-header .custom-menubar .nav-link.active,
  body nav.navbar.fixed-header #ai-innovations-menu-item.active,
  body nav.navbar.fixed-header #web-design-menu-item.active,
  body nav.navbar.fixed-header #company-menu-item.active,
  body nav.navbar.fixed-header #services-menu-item.active {
    color: #0068bc;
    background-color: #f4f7fa;
  }
}

/* Responsive styling for the mega menu */
@media (max-width: 991.98px) {
  .ai-mega-dropdown {
    width: 95%;
    top: 80px;
    padding: 20px;
    max-height: 75vh;
    overflow-y: auto;
  }

  .ai-mega-grid,
  .ai-mega-grid-4,
  .ai-mega-grid-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .ai-mega-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
  }

  .ai-mega-item {
    font-size: 0.95rem;
    padding: 8px 12px;
  }

  .services-sub-dropdown {
    width: calc(100% - 10px);
    left: 5px;
    right: 5px;
    max-height: 250px;
    overflow-y: auto;
  }

  .services-sub-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .services-sub-item {
    white-space: normal;
  }
}

@media (max-width: 575.98px) {

  .ai-mega-grid,
  .ai-mega-grid-4,
  .ai-mega-grid-5 {
    grid-template-columns: 1fr;
  }
}