:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #1abc9c;
  --text-color: #333;
  --light-gray: #ecf0f1;
  --dark-gray: #34495e;
  --white: #ffffff;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

body {
  padding-top: 76px;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Open Sans', 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--white);
}

p {
  font-size: 18px;
  line-height: 1.6;
}

main {
  flex: 1;
  overflow-y: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  font-weight: 600;
}

.navbar {
  box-shadow: var(--box-shadow);
  background: var(--primary-color) !important;
  transition: var(--transition);
}

.navbar-brand img {
  transition: var(--transition);
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

.nav-link {
  position: relative;
  margin: 0 5px;
  transition: var(--transition);
}

.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--secondary-color);
  transition: var(--transition);
}

.nav-link:hover:after {
  width: 100%;
}

.team-section,
.research-section,
.projects-section,
.publications-section,
.contact-section,
.about-section {
  padding: 80px 0;
  position: relative;
}

.section-heading {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 15px;
}

.section-heading:after {
  content: '';
  position: absolute;
  width: 70px;
  height: 3px;
  background-color: var(--accent-color);
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.team-photo,
.research-graphic img,
.project-graphic,
.map-placeholder,
.about-photo {
  border: none;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  height: auto;
  width: 100%;
  margin-top: 10px;
  overflow: hidden;
  transition: var(--transition);
}

.team-photo:hover,
.research-graphic img:hover,
.project-graphic:hover,
.about-photo:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.hero {
  position: relative;
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  overflow: hidden;
  /* Allow hero to occupy remaining space without causing page scroll */
  flex: 1 0 auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 40px;
  background-color: rgba(44, 62, 80, 0.7);
  border-radius: 10px;
  backdrop-filter: blur(5px);
  max-width: 800px;
}

.hero-title {
  font-size: 5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero video {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

footer {
  flex-shrink: 0;
  padding: 20px 0;
  background: linear-gradient(to right, var(--primary-color), var(--dark-gray)) !important;
  /* Ensure footer always sticks to bottom without adding extra scroll */
}

footer a {
  transition: var(--transition);
}

footer a:hover {
  transform: scale(1.1);
}

.disabled {
  pointer-events: none;
  color: #ccc;
  text-decoration: none;
}

.custom-modal {
  max-width: 60%;
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .custom-modal {
    max-width: 90%;
  }
  
  .hero-title {
    font-size: 3.5rem;
  }
  
  .section-heading {
    font-size: 2rem;
  }
  
  .hero {
    height: 70vh;
  }
  
  body {
    padding-top: 66px;
  }
}

.modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* Tarjetas para proyectos e investigación */
.card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--box-shadow);
  height: 100%;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
}

.btn-primary {
  background-color: var(--secondary-color);
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

#map {
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

/* Animaciones */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
