/* Reset básico */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  padding-top: 80px; /* espacio para el menú fijo */
}

/* NAVBAR oculto parcialmente */
nav {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  position: fixed;
  top: -40px; /* oculto parcialmente */
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
  transition: top 0.3s ease;
  animation: slideInDown 0.6s ease;
}

/* Mostrar el nav al hacer hover */
nav:hover {
  top: 0;
}

/* Menú principal */
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Items de menú */
.menu li {
  position: relative;
}

.menu a {
  display: block;
  padding: 20px 25px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Efecto hover en enlaces */
.menu a:hover {
  background: rgba(255,255,255,0.1);
  color: #3498db;
  transform: translateY(-2px);
}

/* Línea animada debajo del enlace */
.menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: #3498db;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.menu a:hover::after {
  width: 80%;
}

/* Submenú */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 200px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.submenu li a {
  padding: 15px 20px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: normal;
  display: block;
}

.submenu li:last-child a {
  border-bottom: none;
}

.submenu a:hover {
  background: rgba(52, 152, 219, 0.2);
  padding-left: 30px;
}

/* Mostrar submenú al hacer hover */
.menu li:hover .submenu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Quitar línea animada en submenú */
.submenu a::after {
  display: none;
}

/* Animación de entrada */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive: móviles */
@media (max-width: 768px) {
  .menu {
    flex-direction: column;
    align-items: stretch;
  }

  .menu li {
    width: 100%;
  }

  .menu a {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
  }

  .submenu {
    position: static;
    opacity: 1;
    transform: none;
    border-radius: 0;
    background: rgba(0,0,0,0.3);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
  }

  .submenu a {
    padding-left: 40px;
  }

  /* Menú siempre visible en móviles */
  nav {
    top: 0;
  }
}
