/* Navbar Styles - Enhanced Design */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  background-color: transparent;
}

.navbar.scrolled {
  background-color: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  padding: 12px 0;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

/* Logo Styling */
.logo {
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  position: relative;
  padding: 5px 0;
  z-index: 2;
}

.logo-text {
  display: inline-block;
  position: relative;
  letter-spacing: 0.5px;
  background: transparent; /* Ensure no background affects text color */
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  background-clip: initial;
}

.logo-text-static {
  color: white !important; /* Ensure white color with highest priority */
  -webkit-text-fill-color: white !important; /* For webkit browsers */
  background: none; /* Remove any background that might affect the text */
  -webkit-background-clip: initial;
  background-clip: initial;
}

.logo-text-animated {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: colorShift 8s infinite alternate;
  transform-origin: bottom left;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

@keyframes colorShift {
  0% {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  50% {
    background: linear-gradient(135deg, #36b3f9, #ca4dfd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  100% {
    background: linear-gradient(135deg, var(--secondary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

.logo-text-animated.tilted {
  transform: scaleX(-1);
  transform-origin: center;
}

.logo-text-animated.upright {
  transform: scaleX(1);
}

.logo::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.15;
  filter: blur(15px);
  border-radius: 50%;
  z-index: -1;
  transform: scale(1.2);
  animation: pulseLogo 3s infinite alternate ease-in-out;
}

/* Navigation Links Styling */
.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
  font-weight: 500;
  align-items: center;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 8px 0;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Advanced Hover Effect */
.nav-links a:hover {
  color: white;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Dropdown Menu Styling - Glassmorphism */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px 0;
}

.dropdown-toggle i {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: var(--primary-light);
}

.dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 220px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(15px);
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), 
              0 1px 3px rgba(124, 58, 237, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 100;
  padding: 8px 0;
  border: 1px solid rgba(124, 58, 237, 0.15);
  overflow: hidden;
  list-style-type: none;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.5), transparent);
}

.dropdown-menu::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.1), transparent 70%);
  z-index: -1;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.dropdown-menu a {
  display: flex;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
  align-items: center;
  position: relative;
}

.dropdown-menu a::before {
  content: '';
  position: absolute;
  width: 4px;
  height: 0;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
  transition: height 0.2s ease;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}

.dropdown-menu a:hover {
  background: rgba(124, 58, 237, 0.08);
  color: white;
  padding-left: 25px;
}

.dropdown-menu a:hover::before {
  height: 70%;
}

.dropdown-menu a::after {
  display: none;
}

/* Menu Toggle for Mobile */
.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: white;
  width: 40px;
  height: 40px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 8px;
  z-index: 1001;
}

.menu-toggle:hover {
  background: rgba(124, 58, 237, 0.1);
}

/* Active State for Current Page */
.nav-links .active a {
  color: white;
  font-weight: 600;
}

.nav-links .active a::after {
  width: 100%;
}

/* Mobile Responsive Styles */
@media (max-width: 1024px) {
  .navbar-container {
    padding: 0 20px;
  }
  
  .nav-links {
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    z-index: 1001;
    width: 44px;
    height: 44px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    gap: 0;
    transition: right 0.4s ease;
    z-index: 1000;
    border-left: 1px solid rgba(124, 58, 237, 0.15);
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  }

  /* Mobile Menu Header - Simplified without logo or background */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 15px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent; /* Removed background */
    min-height: auto; /* Removed fixed height */
  }

  .mobile-logo {
    display: flex;
    align-items: center;
  }

  .mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
  }

  .mobile-close:hover {
    background: rgba(124, 58, 237, 0.3);
  }
  
  .menu-item {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    width: 100%;
  }
  
  .nav-links.active .menu-item:nth-child(2) { /* Adjust for menu-header being first child */
    transition-delay: 0.1s;
  }
  
  .nav-links.active .menu-item:nth-child(3) {
    transition-delay: 0.15s;
  }
  
  .nav-links.active .menu-item:nth-child(4) {
    transition-delay: 0.2s;
  }
  
  .nav-links.active .menu-item:nth-child(5) {
    transition-delay: 0.25s;
  }
  
  .nav-links.active .menu-item:nth-child(6) {
    transition-delay: 0.3s;
  }
  
  .nav-links.active .menu-item {
    opacity: 1;
    transform: translateX(0);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 15px 20px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Mobile Dropdown Menu */
  .dropdown {
    width: 100%;
  }
  
  .dropdown-toggle {
    justify-content: space-between;
    width: 100%;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    background: rgba(31, 41, 55, 0.5);
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: none;
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
  }
  
  .dropdown-menu.active {
    max-height: 300px;
    margin: 5px 0 15px;
    padding: 8px 0;
    border: 1px solid rgba(124, 58, 237, 0.1);
  }
  
  .dropdown-menu a {
    padding: 12px 20px 12px 35px;
    border-bottom: none;
  }
  
  .dropdown-menu a:hover {
    padding-left: 40px;
  }
  
  /* Fix for dropdown menu items */
  .dropdown-menu li {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .dropdown-menu.active li {
    opacity: 1;
    transform: translateY(0);
  }
  
  .dropdown-menu.active li:nth-child(1) { transition-delay: 0.05s; }
  .dropdown-menu.active li:nth-child(2) { transition-delay: 0.1s; }
  .dropdown-menu.active li:nth-child(3) { transition-delay: 0.15s; }
}

/* Enhanced Burger Menu & Mobile Navigation */
.menu-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
  z-index: 2000;
  transition: all 0.3s ease;
}

/* Burger Icon with Animation */
.burger-icon {
  position: relative;
  width: 24px;
  height: 20px;
  margin: 0 auto;
}

.burger-icon span {
  position: absolute;
  height: 2px;
  width: 100%;
  background-color: white;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: all 0.25s ease-in-out;
}

.burger-icon span:nth-child(1) {
  top: 0px;
}

.burger-icon span:nth-child(2),
.burger-icon span:nth-child(3) {
  top: 9px;
}

.burger-icon span:nth-child(4) {
  top: 18px;
}

/* Animated Burger Icon - Active State */
.menu-active .burger-icon span:nth-child(1),
.menu-active .burger-icon span:nth-child(4) {
  top: 9px;
  width: 0%;
  left: 50%;
  opacity: 0;
}

.menu-active .burger-icon span:nth-child(2) {
  transform: rotate(45deg);
}

.menu-active .burger-icon span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Mobile Navigation Overlay */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
  }

  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
  }

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

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.98), rgba(17, 24, 39, 0.98));
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    z-index: 999;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-links.active {
    transform: translateX(0);
    right: 0;
  }

  /* Mobile Menu Header */
  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px 20px;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 24, 39, 0.8);
    min-height: 60px;
  }

  /* Menu Items Animation */
  .menu-item {
    transform: translateX(30px);
    opacity: 0;
    transition: all 0.5s ease;
    transition-delay: calc(0.05s * var(--delay-index, 1));
  }

  .nav-links.active .menu-item {
    transform: translateX(0);
    opacity: 1;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 15px 25px;
    width: 100%;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* Mobile Dropdown Styling */
  .dropdown {
    width: 100%;
  }
  
  .dropdown-toggle {
    width: 100%;
    padding: 15px 25px;
    justify-content: space-between;
  }
  
  .dropdown-menu {
    position: static;
    transform: none;
    width: 100%;
    background: rgba(31, 41, 55, 0.5);
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    border-radius: 0;
  }
  
  .dropdown-menu.active {
    max-height: 350px;
    padding: 0;
    border-left: 2px solid var(--primary);
    margin: 5px 0;
  }
  
  .dropdown-menu a {
    padding: 12px 25px 12px 40px;
    font-size: 0.95rem;
  }
  
  /* Enhanced animation for dropdown items */
  .dropdown-menu li {
    transform: translateX(20px);
    opacity: 0;
    transition: all 0.3s ease;
    transition-delay: calc(0.05s * var(--delay-index, 1));
  }
  
  .dropdown-menu.active li {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
