.team-member {
  position: relative;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 30px;
  max-width: 400px; /* Limita el ancho máximo */
  margin-left: auto;
  margin-right: auto;
}

.team-member:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.team-photo {
  position: relative;
  overflow: hidden;
  padding-top: 120%; /* Aumentamos la altura para mejor proporción */
  background-color: #f8f9fa;
}

.team-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* Enfoca la parte superior de la imagen */
  transition: transform 0.5s ease;
  image-rendering: -webkit-optimize-contrast; /* Mejora la nitidez en webkit */
  image-rendering: crisp-edges; /* Mejora la nitidez en otros navegadores */
  backface-visibility: hidden; /* Reduce el desenfoque durante las transiciones */
  transform: translateZ(0); /* Activa la aceleración por hardware */
}

.team-member:hover .team-photo img {
  transform: scale(1.1);
}

.team-info {
  padding: 25px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(255,255,255,0.95), #fff);
}

.team-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2b2b2b;
  margin-bottom: 10px;
}

.team-position {
  color: #006400;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.team-bio-btn {
  display: inline-block;
  padding: 10px 25px;
  background: #006400;
  color: #fff;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid #006400;
}

.team-bio-btn:hover {
  background: transparent;
  color: #006400;
}

.team-social {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
}

.team-member:hover .team-social {
  opacity: 1;
  transform: translateX(0);
}

.social-icon {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #006400;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: #006400;
  color: #fff;
}

/* Modal styles */
.team-modal .modal-content {
  border-radius: 20px;
  overflow: hidden;
  border: none;
}

.team-modal .modal-header {
  background: #006400;
  color: #fff;
  border: none;
}

.team-modal .modal-title {
  font-weight: 600;
}

.team-modal .modal-body {
  padding: 30px;
}

.team-modal .modal-footer {
  border: none;
  padding: 20px 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .team-name {
    font-size: 1.2rem;
  }
  
  .team-position {
    font-size: 1rem;
  }
}