:root {
  --gradient: linear-gradient(45deg, #0008ff, #4834d4, #4834d4, #0008ff);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding-block: 5px;
  background: rgba(0, 0, 40, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 3px solid blue;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow);
}

.navbar.scrolled {
  padding-block: 0px;
  background: rgba(0, 0, 80, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 3px solid blue;
}

.navbar-container {
  display: flex;
  align-items: center;
  margin: 0 auto;
}

.logo {
  height: 60px;
  width: auto;
  margin-inline: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.logo img {
  height: 60px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
  margin-inline: auto 15px;
}

/* === Estilos generales para enlaces del menú principal === */
.nav-links > li > a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}

/* Líneas animadas superior e inferior */
.nav-links > li > a::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  background-size: 300%;
  transition: width 0.3s ease;
}

.nav-links > li > a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  background-size: 300%;
  transition: width 0.3s ease;
}

/* Hover principal */
.nav-links > li > a:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-links > li > a:hover::before,
.nav-links > li > a:hover::after {
  width: 100%;
  animation: gradient 8s linear infinite;
}

/* === Anulación de estilos para enlaces dentro de dropdown-menu === */
.dropdown-menu a {
  all: unset; /* limpia todos los estilos heredados, si es compatible */
  color: black; /* o el color que necesites */
  font-weight: normal;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  display: block;
  text-decoration: none;
  position: static;
  letter-spacing: normal;
  cursor: pointer;
}

.nav-links .menu-no-link {
  position: relative;
  display: inline-block;
  color: white;
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-links .menu-no-link::before,
.nav-links .menu-no-link::after {
  content: "";
  position: absolute;
  height: 2px;
  width: 0;
  background: var(--gradient);
  background-size: 300%;
  transition: width 0.3s ease;
}

.nav-links .menu-no-link::before {
  top: -4px;
  left: 0;
}

.nav-links .menu-no-link::after {
  bottom: -4px;
  right: 0;
}

.nav-links .menu-no-link:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-links .menu-no-link:hover::before,
.nav-links .menu-no-link:hover::after {
  width: 100%;
  animation: gradient 8s linear infinite;
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1001;
  border-radius: 50%;
  margin-inline: auto 10px;
  transition: background-color 0.3s ease;
}

.mobile-nav-toggle:hover {
  background: blue;
}

.mobile-nav-toggle .bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: white;
  transition: all 0.4s ease;
}

.mobile-nav-toggle .bar:nth-child(1) {
  top: 14px;
}
.mobile-nav-toggle .bar:nth-child(2) {
  top: 19px;
}
.mobile-nav-toggle .bar:nth-child(3) {
  top: 24px;
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: -16px;
    right: -100%;
    height: 100vh;
    width: 50%;
    max-width: 400px;
    background: rgba(0, 0, 40, 0.90);
    border-left: 3px solid blue;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    backdrop-filter: blur(10px);
    margin-right: 0px;
  }

  .nav-links::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03));
    pointer-events: none;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
  }

  .nav-links.active a {
    opacity: 1;
    transform: translateX(0);
  }

  .nav-links a:nth-child(1) {
    transition-delay: 0.1s;
  }
  .nav-links a:nth-child(2) {
    transition-delay: 0.2s;
  }
  .nav-links a:nth-child(3) {
    transition-delay: 0.3s;
  }
  .nav-links a:nth-child(4) {
    transition-delay: 0.4s;
  }
  .nav-links a:nth-child(5) {
    transition-delay: 0.5s;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .mobile-nav-toggle.active .bar:nth-child(1) {
    transform: translate(-50%, 5px) rotate(45deg);
    width: 24px;
  }

  .mobile-nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle.active .bar:nth-child(3) {
    transform: translate(-50%, -5px) rotate(-45deg);
    width: 24px;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(4px);
  }

  .overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

.section-title {
  font-size: 3rem;
}

.section-description {
  font-size: 1rem;
  padding: 0 1rem;
}

section {
  min-height: 100vh;
  padding: 120px 5% 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

section:nth-child(even) {
  background: var(--section-bg);
}

.section-content {
  max-width: 1400px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: 8vw;
  font-weight: 800;
  margin-bottom: 2rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient 8s linear infinite;
  background-size: 300%;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: -2px;
}

.section-description {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0.8;
  color: white;
}

/* Submenu Styles */
.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    background: rgba(0, 0, 60, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 255, 0.3);
    border-radius: 0 0 8px 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid blue;
}

.dropdown-menu li a i {
    font-size: 0.9rem;
}

/* Mobile Styles for Dropdown */
@media (max-width: 768px) {
    .nav-links .has-dropdown {
        display: flex;
        flex-direction: column;
        width: auto;
        align-content: center;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        background: rgba(0, 0, 80, 0.5);
        border: none;
        border-radius: 0;
        box-shadow: none;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 0;
        border: 2px solid blue;
        border-radius: 10px;
        margin-top: 10px;
    }

    .dropdown-menu li a {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 16px;
        color: white;
        text-decoration: none;
    }    
    
    .dropdown-menu li a:hover {
        background: rgba(255, 255, 255, 0.1);
        border-left: 0px;
    }
    
    .nav-links.active .dropdown-menu {
        animation: none;
    }
    
    .nav-links li.has-dropdown > a {
        padding-right: 40px;
    }
    
    .dropdown-menu li a {
        padding: 10px 16px;
        font-size: 1rem;
    }
}

/* Animation for mobile menu items */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-no-link {
    display: flex;
    align-items: center;
    color: white;
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    cursor: default;
}

.has-dropdown > .menu-no-link {
    cursor: pointer;
}
