/* Enhanced Header & Navigation Styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

/* Different styling for home page vs other pages */
body.home header {
  background-color: transparent; /* Transparent on home page */
}

body:not(.home) header {
  background-color: #111111; /* Solid black on other pages */
}

/* When scrolled down past threshold */
header.scrolled {
  background-color: rgba(15, 15, 15, 0.9); /* Dark semi-transparent when scrolled */
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Hide header on scroll with improved animation */
header.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none; /* Prevent interaction when hidden */
}

/* FIXED: Header container with professional centered layout */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100px;
  position: relative;
}

/* Make header more compact when scrolled */
header.scrolled .header-container {
  height: 70px;
}

/* Logo styling logo size khalidfpv*/

/* Logo styling */
.brand {
  flex: 0 0 auto;
  display: block;
  z-index: 2;
}

.brand img {
  height: 80px; /* Further increased to match Sager site */
  transition: all 0.4s ease;
  /* Removed filter to show original colors */
}

body.home header:not(.scrolled) .brand img {
  transform: scale(1.05); /* Slightly larger logo on home page */
}

header.scrolled .brand img {
  height: 35px; /* Smaller logo when scrolled */
}

/* FIXED: Navigation links with centered position */
.main-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.main-nav ul {
  display: flex;
  list-style: none;
  height: 100%;
  align-items: center;
  margin: 0;
  padding: 0;
}

.main-nav ul li {
  margin: 0 1rem;
}

.main-nav ul li a {
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease, transform 0.2s ease;
}

.main-nav ul li a:hover {
  transform: translateY(-2px); /* Subtle lift effect on hover */
}

/* Underline animation effect */
.main-nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0; /* Start with NO underline */
  height: 2px;
  background-color: #e51825; /* Red accent color */
  transition: width 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Only show underline for active state or hover */
.main-nav ul li a:hover::after,
.main-nav ul li a.active::after {
  width: 100%; /* Full width underline */
}

/* Reset any other rules that might override this */
.main-nav ul li a:not(:hover):not(.active)::after {
  width: 0 !important; /* Force no underline for non-active, non-hover links */
}

/* FIXED: CTA Button styling */
.cta-buttons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  z-index: 2;
}

.cta-buttons .btn-primary {
  background-color: #e51825; /* User specified red */
  border: 2px solid #e51825; /* User specified red */
  color: white;
  padding: 0.75rem 1.5rem;
  min-width: 160px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-buttons .btn-primary:hover {
  background-color: transparent;
  color: #e63946;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(230, 57, 70, 0.3);
}

.cta-buttons .btn-primary:active {
  transform: translateY(-1px);
}

/* Add ripple effect to button */
.cta-buttons .btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.cta-buttons .btn-primary:hover::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Fix body spacing to account for fixed header */
body {
  padding-top: 80px; /* Set initial padding to match header height */
}

body.home {
  padding-top: 0; /* No padding needed for home page since header is transparent */
}

/* NEW: Return to top button */
.return-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #e51825;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  z-index: 99;
}

.return-to-top:hover {
  background-color: #c41420;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.return-to-top i {
  font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .header-container {
    height: 70px;
    padding: 0 1rem;
  }
  
  header.scrolled .header-container {
    height: 60px;
  }
  
  .brand img {
    height: 35px;
  }
  
  .main-nav ul li {
    margin: 0 0.8rem;
  }
  
  .main-nav ul li a {
    font-size: 0.9rem;
    padding: 0.4rem 0;
  }
  
  .cta-buttons .btn-primary {
    padding: 0.6rem 1.2rem;
    min-width: 140px;
    font-size: 0.9rem;
  }
  
  .return-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 768px) {
  .header-container {
    height: 68px;
    padding: 0;
  }

  .brand {
    padding: 14px 18px;
  }

  .brand img {
    max-height: 40px;
    width: auto;
  }

  .main-nav {
    display: none; /* Will be replaced by overlay nav on mobile */
  }
  header .header-container .cta-buttons {
    display: none; /* Hide original CTA in header on mobile */
  }
  
  .return-to-top {
    width: 40px;
    height: 40px;
    bottom: 15px;
    right: 15px;
  }
}

/* Accessibility - respect user preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Override any conflicting styles from other CSS files */
.header-container .cta-buttons .btn,
.header-container .cta-buttons .btn-primary {
  padding: 0.75rem 1.5rem !important;
  min-width: 160px !important;
  font-size: 1rem !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  border: 2px solid #e51825 !important;
  background-color: #e51825 !important;
  color: white !important;
}

@media (max-width: 992px) {
  .header-container .cta-buttons .btn,
  .header-container .cta-buttons .btn-primary {
    padding: 0.6rem 1.2rem !important;
    min-width: 140px !important;
    font-size: 0.9rem !important;
  }
}