/* ======= MODERN HEADER STYLING ======= */
/* Base header styling with glassmorphism effect */
#header {
  height: 80px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  background: rgba(20, 12, 80, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 0 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: visible;
}

/* Transparent header state */
#header.header-transparent {
  background: rgba(20, 12, 80, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scrolled header states */
#header.header-scrolled,
#header.scrolled,
#header.scrolled-color {
  background: rgba(20, 12, 80, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  height: 70px;
  box-shadow: 0 4px 20px rgba(20, 12, 80, 0.3);
  border-bottom: 1px solid rgba(67, 156, 239, 0.2);
}

/* Container modifications for better spacing */
#header .container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  max-width: 100vw;
  overflow: visible;
}

/* ======= LOGO STYLING ======= */
#header .logo {
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

#header .logo:hover {
  transform: translateY(-1px);
}

#header .logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Logo image with subtle glow effect */
#header .logo img {
  height: 40px;
  max-height: 40px;
  width: auto;
  display: block;
  margin-right: 12px;
  transition: filter 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(67, 156, 239, 0.3));
}

#header.header-scrolled .logo img {
  height: 36px;
  max-height: 36px;
}

/* Logo text with modern typography */
#header .logo span {
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  white-space: nowrap;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, #a2cce3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

#header.header-scrolled .logo span {
  font-size: 24px;
}

/* ======= DESKTOP NAVIGATION STYLING ======= */
.navbar {
  padding: 0;
  position: relative;
  z-index: 1001;
}

.navbar ul,
.navbar-nav {
  margin: 0;
  padding: 0;
  display: flex;
  list-style: none;
  align-items: center;
  gap: 8px;
}

.navbar li,
.nav-item {
  position: relative;
}

/* Navigation links - Always visible on desktop */
.navbar a,
.nav-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 12px 20px !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #fff !important;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  border-radius: 12px;
  position: relative;
  letter-spacing: 0.01em;
}

/* Hover effects - Blue theme */
.navbar a:hover,
.nav-link:hover {
  color: #4fa8d8 !important;
  background: rgba(79, 168, 216, 0.15) !important;
  backdrop-filter: blur(10px);
  transform: translateY(-1px);
}

/* Active state - Blue theme */
.nav-link.active {
  color: #4fa8d8 !important;
  background: rgba(79, 168, 216, 0.12) !important;
}

/* ======= DROPDOWN STYLING ======= */
/* Hide Bootstrap's default chevron and style our own */
.dropdown-toggle::after {
  display: none !important;
}

.dropdown-toggle .bi-chevron-down {
  margin-left: 6px;
  transition: transform 0.3s ease;
  font-size: 12px;
  color: inherit;
}

.nav-item.dropdown:hover .dropdown-toggle .bi-chevron-down {
  transform: rotate(180deg);
}

/* Desktop dropdown menu */
.navbar .dropdown {
  position: relative !important;
}

.dropdown-menu {
  display: none !important;
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: 100% !important;
  bottom: auto !important;
  transform: none !important;
  margin: 0 !important;
  min-width: 240px;
  padding: 12px;
  background: linear-gradient(145deg, 
    rgba(28, 45, 94, 0.98) 0%, 
    rgba(20, 35, 75, 0.98) 100%) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px !important;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.25),
    0 8px 16px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(79, 168, 216, 0.1),
    0 0 0 1px rgba(79, 168, 216, 0.15) !important;
  border: 1px solid rgba(79, 168, 216, 0.2) !important;
  z-index: 9999 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Create hover bridge - invisible area to prevent dropdown closing */
.nav-item.dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
  z-index: 9998;
}

/* Show dropdown on hover */
.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown .dropdown-menu:hover {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-menu:hover {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Dropdown items */
.dropdown-item {
  display: block !important;
  width: 100% !important;
  padding: 12px 16px !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
  text-align: left !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.dropdown-menu {
  text-align: left !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: linear-gradient(135deg, 
    rgba(79, 168, 216, 0.15) 0%, 
    rgba(79, 168, 216, 0.08) 100%) !important;
  color: #4fa8d8 !important;
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(79, 168, 216, 0.15);
}

/* ======= MOBILE NAVIGATION TOGGLE ======= */
.mobile-nav-toggle {
  color: #fff !important;
  font-size: 24px;
  cursor: pointer;
  display: none;
  line-height: 0;
  transition: all 0.3s ease;
  padding: 8px;
  border-radius: 8px;
  background: rgba(67, 156, 239, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(67, 156, 239, 0.2);
  position: relative;
  z-index: 1002;
}

.mobile-nav-toggle:hover {
  background: rgba(67, 156, 239, 0.2);
  transform: scale(1.05);
}

.mobile-nav-toggle.active {
  background: rgba(67, 156, 239, 0.3);
  transform: rotate(90deg);
}

/* ======= MOBILE NAVIGATION OVERLAY ======= */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: rgba(20, 12, 80, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile navigation container */
.mobile-nav-container {
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  max-height: 80dvh;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(0.8) translateY(50px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.mobile-nav-overlay.active .mobile-nav-container {
  transform: scale(1) translateY(0);
}

/* Mobile close button */
.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1003;
}

.mobile-nav-close:hover {
  background: rgba(255, 69, 69, 0.2);
  border-color: rgba(255, 69, 69, 0.3);
  transform: scale(1.1);
}

.mobile-nav-close i {
  color: #fff;
  font-size: 18px;
}

/* Mobile navigation list */
.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Mobile navigation links */
.mobile-nav-list li a {
  display: block;
  padding: 16px 20px;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mobile-nav-list li a:hover,
.mobile-nav-list li a.active {
  background: rgba(67, 156, 239, 0.2);
  color: #fff;
  transform: translateX(8px);
  box-shadow: 0 4px 20px rgba(67, 156, 239, 0.3);
}

/* Mobile dropdown styling */
.mobile-nav-list .dropdown > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-nav-list .dropdown > a i {
  transition: transform 0.3s ease;
  font-size: 14px;
}

.mobile-nav-list .dropdown.active > a i {
  transform: rotate(180deg);
}

.mobile-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin: 8px 0 0 0;
}

.mobile-dropdown-menu.active {
  max-height: 200px;
  padding: 8px 0;
}

.mobile-dropdown-menu li a {
  padding: 12px 24px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ======= BACK TO TOP BUTTON ======= */
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 20px;
  bottom: 20px;
  z-index: 996;
  background: rgba(20, 12, 80, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 52px;
  height: 52px;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(67, 156, 239, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 25px rgba(20, 12, 80, 0.3);
}

.back-to-top i {
  font-size: 20px;
  color: #fff;
  transition: all 0.3s ease;
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(67, 156, 239, 0.9);
  border-color: rgba(67, 156, 239, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(67, 156, 239, 0.4);
}

.back-to-top:hover i {
  color: #fff;
  transform: translateY(-2px);
}

/* ======= FOOTER STYLING ======= */
#footer {
  background: #0b212d;
  color: #fff;
  font-size: 15px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transform: none;
  will-change: auto;
}

#footer .footer-top {
  background: #0d2735;
  border-top: 1px solid #17455e;
  border-bottom: 1px solid #123649;
  padding: 60px 0 30px 0;
  transform: translateZ(0);
}

#footer .footer-links h4,
#footer .footer-contact h4,
#footer .footer-info h3 {
  color: #a2cce3;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 24px;
  padding: 0;
  line-height: 1.3;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#footer .footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#footer .footer-links ul li {
  padding: 8px 0;
  border-bottom: none;
  display: flex;
  align-items: center;
}

#footer .footer-links ul li i {
  padding-right: 8px;
  color: #a2cce3;
  font-size: 16px;
}

#footer .footer-links ul a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 400;
}

#footer .footer-links ul a:hover {
  color: #a2cce3;
}

#footer .footer-contact p {
  margin: 0 0 16px 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

#footer .footer-contact strong {
  color: #a2cce3;
  font-weight: 600;
}

#footer .footer-contact a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s ease;
}

#footer .footer-contact a:hover {
  color: #a2cce3;
}

#footer .footer-info p {
  margin: 0 0 20px 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

#footer .social-links a {
  background: #1e4356;
  color: #fff;
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  text-align: center;
  font-size: 18px;
  margin-right: 8px;
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: inline-block;
  text-decoration: none;
  transform: translateZ(0);
}

#footer .social-links a:hover {
  background: #68A4C4;
  color: #fff;
  transform: translateZ(0) translateY(-2px);
}

/* ======= GLOBAL FIXES ======= */
body, html {
  overflow-x: hidden;
}

body.mobile-nav-active {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Performance optimizations */
#footer * {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#footer[data-aos] {
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
}

/* ======= RESPONSIVE BREAKPOINTS ======= */

/* Hide desktop navbar on mobile, show mobile toggle */
@media (max-width: 991.98px) {
  /* Hide desktop navbar */
  #navbar {
    display: none !important;
  }
  
  /* Show mobile toggle */
  .mobile-nav-toggle {
    display: block !important;
  }
  
  /* Header adjustments for mobile */
  #header {
    padding: 0 20px;
    height: 70px;
    overflow-x: hidden;
  }
  
  #header.header-scrolled {
    height: 65px;
  }
  
  #header .container {
    padding: 0 15px;
  }
}

/* Show desktop navbar on larger screens, hide mobile elements */
@media (min-width: 992px) {
  /* Show desktop navbar */
  #navbar {
    display: block !important;
  }
  
  /* Hide mobile elements */
  .mobile-nav-toggle {
    display: none !important;
  }
  
  .mobile-nav-overlay {
    display: none !important;
  }
}

@media (max-width: 768px) {
  #header {
    padding: 0 15px;
  }
  
  #header .logo img {
    height: 32px;
    max-height: 32px;
  }
  
  #header .logo span {
    font-size: 24px;
  }
  
  #header.header-scrolled .logo span {
    font-size: 22px;
  }
  
  .dropdown-menu {
    min-width: 220px;
  }
  
  .mobile-nav-container {
    width: 95%;
    padding: 30px 20px;
  }
  
  .mobile-nav-list li a {
    font-size: 17px;
    padding: 14px 16px;
  }
  
  .back-to-top {
    right: 15px;
    bottom: 15px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  
  .back-to-top i {
    font-size: 18px;
  }
  
  #footer .footer-top {
    padding: 40px 0 20px 0;
  }
  
  #footer .footer-links h4,
  #footer .footer-contact h4,
  #footer .footer-info h3 {
    font-size: 16px;
    margin-bottom: 20px;
  }
  
  #footer .social-links a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #header .logo span {
    font-size: 20px;
  }
  
  .mobile-nav-container {
    padding: 25px 15px;
  }
  
  .mobile-nav-list li a {
    font-size: 16px;
    padding: 12px 14px;
  }
  
  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  
  .back-to-top i {
    font-size: 16px;
  }
}

/* ======= ANIMATION UTILITIES ======= */
.mobile-nav-list li {
  opacity: 0;
  transform: translateY(20px);
  animation: mobileNavSlideIn 0.4s ease forwards;
}

.mobile-nav-list li:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-list li:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-list li:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-list li:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-list li:nth-child(5) { animation-delay: 0.3s; }

@keyframes mobileNavSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav-overlay:not(.active) .mobile-nav-list li {
  animation: none;
  opacity: 0;
  transform: translateY(20px);
}

/* ======= ACCESSIBILITY IMPROVEMENTS ======= */
.mobile-nav-toggle:focus,
.mobile-nav-close:focus,
.back-to-top:focus {
  outline: 2px solid #439cef;
  outline-offset: 2px;
}

/* iOS Safari viewport height fix */
@supports (-webkit-touch-callout: none) {
  .mobile-nav-overlay {
    height: -webkit-fill-available;
  }
}

/* Additional iOS fixes */
.mobile-nav-overlay,
.mobile-nav-container {
  touch-action: manipulation;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Hide horizontal scrollbar */
body::-webkit-scrollbar {
  height: 0;
}