/* Added smooth scrolling behavior for the entire page */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #ffffff;
  /* Simplified body animation - removed page transition styles */
  animation: fadeIn 0.4s ease-out;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Simplified header transition */
  transition: box-shadow 0.15s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  min-height: 80px;
}

.logos {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  height: 50px;
  width: auto;
}

.cemadis-logo {
  height: 60px;
}

.udla-logo {
  height: 80px;
}

.nav {
  display: flex;
  /* Reduced gap and removed flex-wrap to keep navigation in single line */
  gap: 1rem;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  /* Added consistent padding and white-space to prevent text wrapping */
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  border-radius: 4px;
}

/* Added smooth underline animation on hover */
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #e67e22;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Updated hover effect to include underline animation */
.nav-link:hover {
  color: #e67e22;
}

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

.nav-button {
  background: #e67e22;
  color: white;
  text-decoration: none;
  /* Adjusted padding to match nav-link padding for consistency */
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  /* Added margin-left to separate contact button from nav links */
  margin-left: 0.5rem;
}

.nav-button:hover {
  background: #d35400;
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  /* Restaurando la imagen de fondo original pero manteniendo las estadísticas con fondo blanco */
  background: linear-gradient(rgba(44, 62, 80, 0.6), rgba(52, 73, 94, 0.6)),
    url("https://hebbkx1anhila5yf.public.blob.vercel-storage.com/fondo_pagina_principal-padKJOlABAHnXR1Z02i7aEQPRgpKrJ.png");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  padding: 120px 0 80px;
  text-align: center;
  animation: slideInFromTop 0.6s ease-out;
  position: relative;
  min-height: 400px;
  overflow: visible;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
  /* Added top margin to push content down from header */
  margin-top: 40px;
}

.hero-title {
  /* Cambiando color del texto a oscuro para contraste con fondo blanco */
  /* Increased font size and improved spacing */
  font-size: 3.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  /* Added letter spacing for better readability */
  letter-spacing: -0.02em;
  /* Agregando sombra de texto para mejor legibilidad */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
  font-size: 1.25rem;
  /* Cambiando color del subtítulo a gris oscuro */
  color: #ffffff;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  /* Added text overflow handling for subtitle */
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* Agregando sombra de texto para mejor legibilidad */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

/* Actualizando colores de estadísticas para fondo blanco */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8f9fa;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  border: 2px solid #e67e22;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 150px;
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: #e67e22;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  font-weight: 500;
  color: #2c3e50;
  text-align: center;
}

/* Researchers Section */
.researchers {
  padding: 80px 0;
  background: #ffffff;
  scroll-margin-top: 100px;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 3rem;
}

.researchers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.researcher-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  /* Simplified card transition - only transform and shadow */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInUp 0.5s ease-out;
}

.researcher-card.hidden {
  display: none;
}

.researcher-card:hover {
  /* Simplified hover effect - less dramatic */
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.researcher-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
  /* Added flex properties to center images properly */
  display: flex;
  align-items: center;
  justify-content: center;
}

.researcher-image img {
  width: 100%;
  height: 100%;
  /* Changed from cover to contain to show full image without cropping */
  object-fit: contain;
  /* Added object-position to center the image */
  object-position: center;
  /* Added max dimensions to prevent oversized images */
  max-width: 100%;
  max-height: 100%;
}

.researcher-info {
  padding: 1.5rem;
}

.researcher-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.researcher-title {
  color: #e67e22;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.researcher-specialty {
  color: #6c757d;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.researcher-contact {
  margin-bottom: 1rem;
}

.email {
  color: #495057;
  font-size: 0.9rem;
}

.researcher-metrics {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.metric {
  background: #f8f9fa;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #495057;
  font-weight: 500;
}

/* Research Lines Section */
.research-lines {
  padding: 80px 0;
  background: #f8f9fa;
  scroll-margin-top: 100px;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.research-lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.research-line-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  /* Simplified research card transition */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}

.research-line-card:hover {
  /* Simplified hover effect - less dramatic */
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* Removed icon rotation effect */
.research-line-icon {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.research-line-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.research-line-description {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: left;
}

.research-line-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.keyword {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Publications Section */
.publications {
  padding: 80px 0;
  background: #ffffff;
}

/* Added styles for new publications layout with sidebar and chart */
.publications-layout {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.publications-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

.filter-group {
  margin-bottom: 2rem;
}

.filter-title {
  font-size: 1rem;
  font-weight: 600;
  color: #34495e;
  margin-bottom: 0.75rem;
}

.year-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.year-btn {
  padding: 0.6rem 1rem;
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
  text-align: left;
}

.year-btn:hover {
  background: #e9ecef;
  border-color: #e67e22;
}

.year-btn.active {
  background: #e67e22;
  color: white;
  border-color: #e67e22;
}

.publications-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chart-container-wrapper {
  margin-top: 1rem;
}

.chart-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chart-btn {
  flex: 1;
  padding: 0.5rem;
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  transition: all 0.2s ease;
}

.chart-btn:hover {
  background: #e9ecef;
}

.chart-btn.active {
  background: #e67e22;
  color: white;
  border-color: #e67e22;
}

.chart-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.chart-container canvas {
  max-height: 400px;
}

.filter-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  color: #333;
  cursor: pointer;
  /* Simplified filter select transition */
  transition: border-color 0.15s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #e67e22;
}

.publications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.publication-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  /* Simplified publication card transitions */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border-left: 4px solid #e67e22;
}

.publication-card[data-image] {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-left-color 0.15s ease;
}

.publication-card[data-image]:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-left-color: #d35400;
}

.publication-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.publication-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.publication-type {
  background: #e67e22;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.publication-year {
  color: #6c757d;
  font-weight: 600;
}

.publication-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.publication-authors {
  color: #e67e22;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.publication-journal {
  color: #495057;
  font-style: italic;
  margin-bottom: 1rem;
}

.publication-abstract {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.publication-metrics {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.publication-links {
  display: flex;
  gap: 1rem;
}

.publication-link {
  color: #e67e22;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 2px solid #e67e22;
  border-radius: 6px;
  /* Simplified publication link transition */
  transition: background-color 0.15s ease, color 0.15s ease;
  font-size: 0.9rem;
}

.publication-link:hover {
  background: #e67e22;
  color: white;
}

/* About Section - Enhanced Design */
.about-section {
  padding: 80px 0;
  background: #ffffff;
}

.about-content {
  display: grid;
  /* Adjusted image column width to 650px for better proportion */
  grid-template-columns: 1fr 650px;
  gap: 4rem;
  align-items: center;
  margin-bottom: 4rem;
}

.about-text .section-title {
  text-align: left;
  margin-bottom: 2rem;
  font-size: 2.5rem;
  color: #2c3e50;
}

.about-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 0;
}

.about-image {
  position: relative;
  /* Removed border-radius, box-shadow, and overflow to eliminate white frame effect */
  transition: transform 0.3s ease;
  max-width: 650px;
  margin: 0 auto;
}

.about-image:hover {
  transform: translateY(-5px);
}

.about-image img {
  width: 100%;
  height: 650px;
  object-fit: contain;
  object-position: center;
}

.mission-vision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.mission-card,
.vision-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid #e67e22;
  position: relative;
  overflow: hidden;
}

.mission-card::before,
.vision-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #e67e22, #d35400);
}

.mission-card:hover,
.vision-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

.card-description {
  color: #555;
  line-height: 1.7;
  font-size: 1rem;
}

/* CTA Section */
.cta {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 80px 0;
  text-align: center;
  color: white;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-text {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-button {
  background: #e67e22;
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  /* Simplified CTA button transition */
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.cta-button:hover {
  background: #d35400;
  transform: translateY(-2px);
}

.boton:hover {
  background-color: blue;
  transform: scale(1.1);
}

/* Footer */
.footer {
  background: #2c3e50;
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: #e67e22;
}

.footer-section p {
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.footer-link {
  display: block;
  color: white;
  text-decoration: none;
  margin-bottom: 0.5rem;
  opacity: 0.8;
  /* Simplified footer link transition */
  transition: opacity 0.15s ease;
}

.footer-link:hover {
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid #34495e;
  padding-top: 1rem;
  text-align: center;
  opacity: 0.7;
}

/* Event Cards Section */
.event-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 500px;
  margin: 0 auto;
}

.event-poster {
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.event-card:hover .poster-image {
  transform: scale(1.05);
}

.event-content {
  padding: 2rem;
  flex: 1;
}

.poster-link {
  background: #e67e22 !important;
  color: white !important;
  border: 2px solid #e67e22 !important;
}

.poster-link:hover {
  background: #d35400;
  border-color: #d35400;
}

/* Poster Section */
.poster-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
  text-align: center;
  animation: fadeIn 0.3s ease-out;
}

.poster-image-small {
  max-width: 500px;
  max-height: 350px;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.poster-image-small:hover {
  transform: scale(1.05);
}

.expand-btn {
  background: #e67e22 !important;
  color: white !important;
  border: 2px solid #e67e22 !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expand-btn:hover {
  background: #d35400 !important;
  border-color: #d35400 !important;
  transform: translateY(-1px);
}

/* Carousel Section */
.carousel-section {
  padding: 60px 0;
  background: #f8f9fa;
}

.carousel-container {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.carousel-wrapper {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 3rem 2rem 2rem;
  text-align: center;
}

.carousel-caption h3 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.carousel-caption p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.carousel-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 20px;
}

.carousel-next {
  right: 20px;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: white;
  transform: scale(1.2);
}

/* Year Buttons Section */
.year-buttons-container {
  display: none; /* Hidden as filters are now in sidebar */
}

.year-buttons-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.year-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.year-btn {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px solid transparent;
  padding: 0.6rem 1rem;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.year-btn:hover {
  background: #e9ecef;
  border-color: #e67e22;
}

.year-btn.active {
  background: #e67e22;
  color: white;
  border-color: #e67e22;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .publications-layout {
    grid-template-columns: 1fr;
  }

  .publications-sidebar {
    position: relative;
    top: 0;
  }
}

/* =========================================
   ESTILOS PARA MÓVIL (BARRA COMPACTA)
   ========================================= */

@media (max-width: 768px) {
    
    /* 1. El contenedor principal: Una sola fila horizontal */
    .header-content {
        display: flex;
        flex-direction: row;       /* Elementos uno al lado del otro */
        flex-wrap: nowrap;         /* Prohibido bajar de línea */
        justify-content: space-between; /* Espacio entre logos y botón */
        align-items: center;       /* Centrados verticalmente */
        padding: 0.5rem 15px;      /* Relleno lateral */
        height: 70px;              /* Altura fija de la barra */
    }

    /* 2. Ajustar los logos para que quepan en la barra */
    .logos {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    /* Hacemos los logos pequeños para que entren en la barra */
    .cemadis-logo { 
        height: 35px; 
        width: auto; 
    }
    
    .udla-logo { 
        height: 35px; 
        width: auto; 
    }

    /* 3. El menú desplegable (se abre DEBAJO de la barra) */
    .nav {
        display: none; 
        position: absolute;
        top: 70px; /* Empieza justo donde termina la barra de 70px */
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
    }

    .nav.active {
        display: flex;
    }

    .nav-link {
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid #f5f5f5;
        width: 100%;
        display: block;
    }

    /* 4. Botón de menú (Hamburguesa) */
    .mobile-menu-toggle {
        display: block !important;
        font-size: 2rem;  /* Icono grande */
        background: none;
        border: none;
        color: #2c3e50;
        cursor: pointer;
        padding: 0;
        margin-left: auto; /* Empuja el botón a la derecha si sobra espacio */
    }

/* 5. Ajustes del Hero (Título) para que no se rompa */
    .hero {
        padding-top: 100px; 
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.7rem;   /* Un poquito más pequeña para asegurar */
        line-height: 1.2;
        
        /* ESTO ES LO QUE ARREGLA EL CORTE DE PALABRAS: */
        word-wrap: normal;       /* No partir palabras obligatoriamente */
        word-break: normal;      /* Respetar las palabras completas */
        overflow-wrap: normal;   /* Estándar moderno para no romper */
        hyphens: none;           /* Prohibir guiones automáticos */
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }

    /* Ajuste de estadísticas */
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat {
        width: 100%;
    }

    /* Otros ajustes responsive mantenidos */
    .researchers-grid, 
    .research-lines-grid, 
    .publications-grid,
    .mission-vision-grid,
    .about-content {
        grid-template-columns: 1fr;
    }

    .about-content {
        gap: 2rem;
        text-align: center;
    }

    .research-line-card, 
    .publication-card, 
    .mission-card, 
    .vision-card,
    .event-content {
        padding: 1.5rem;
    }

    .cta-title { font-size: 2rem; }

    .nav-button {
        margin-top: 0;
        margin-left: 0;
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }

    .filter-container {
        flex-direction: column;
        align-items: center;
    }

    .filter-select {
        width: 100%;
        max-width: 300px;
    }

    .event-card { max-width: 100%; }
    .event-poster { height: 200px; }

    .carousel-section { padding: 120px 0 0; }
    .carousel-wrapper { height: 300px; }
    .carousel-caption { padding: 2rem 1rem 1.5rem; }
    .carousel-caption h3 { font-size: 1.4rem; }
    .carousel-caption p { font-size: 1rem; }
    .carousel-btn { width: 40px; height: 40px; font-size: 1rem; }
    .carousel-prev { left: 10px; }
    .carousel-next { right: 10px; }

    .year-buttons { gap: 0.25rem; }
    .year-btn { padding: 0.5rem 1rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .hero {
    padding: 180px 0 60px;
  }

  .hero-title {
    font-size: 1.9rem;
    padding: 0 15px;
  }

  .hero-subtitle {
    font-size: 1rem;
    padding: 0 20px;
  }

  .section-title {
    font-size: 2rem;
  }

  /* Adjusting logo sizes for mobile while keeping UDLA larger */
  .udla-logo {
    height: 60px;
  }

  .cemadis-logo {
    height: 45px;
  }

  .nav {
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
  }

  .carousel-wrapper {
    height: 250px;
  }

  .carousel-caption h3 {
    font-size: 1.2rem;
  }

  .carousel-caption p {
    font-size: 0.9rem;
  }

  .year-buttons {
    gap: 0.3rem;
  }

  .year-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-width: 60px;
  }
}

/* Simplified keyframe animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Added new slide-in animation for hero */
@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Simplified staggered animation delays */
.researchers-grid .researcher-card:nth-child(1) {
  animation-delay: 0.1s;
}
.researchers-grid .researcher-card:nth-child(2) {
  animation-delay: 0.2s;
}
.researchers-grid .researcher-card:nth-child(3) {
  animation-delay: 0.3s;
}
.researchers-grid .researcher-card:nth-child(4) {
  animation-delay: 0.4s;
}
.researchers-grid .researcher-card:nth-child(5) {
  animation-delay: 0.5s;
}
.researchers-grid .researcher-card:nth-child(6) {
  animation-delay: 0.6s;
}

.research-lines-grid .research-line-card:nth-child(1) {
  animation-delay: 0.1s;
}
.research-lines-grid .research-line-card:nth-child(2) {
  animation-delay: 0.2s;
}
.research-lines-grid .research-line-card:nth-child(3) {
  animation-delay: 0.3s;
}

/* Added modern search input styling to match page design */
.search-container {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
}

.search-input {
  width: 100%;
  max-width: 600px;
  padding: 1rem 1.5rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  background: white;
  font-size: 1rem;
  font-family: "Inter", sans-serif;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.search-input:focus {
  border-color: #e67e22;
  box-shadow: 0 4px 16px rgba(230, 126, 34, 0.15);
  transform: translateY(-1px);
}

.search-input::placeholder {
  color: #6c757d;
  font-weight: 400;
}

/* Agregando estilos para el modal de preview de noticias */
.news-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

.news-modal.active {
  display: flex;
}

.news-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideInFromTop 0.4s ease-out;
}

.news-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 2rem;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.news-modal-close:hover {
  background: #e67e22;
  color: white;
  transform: rotate(90deg);
}

.news-modal-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.news-modal-image {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Agregando estilos para el modal de publicaciones */
.publication-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}

.publication-modal.active {
  display: flex;
}

.publication-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideInFromTop 0.4s ease-out;
}

.publication-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 2rem;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.publication-modal-close:hover {
  background: #e67e22;
  color: white;
  transform: rotate(90deg);
}

.publication-modal-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.publication-modal-image {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Agregando estilos para la lista de publicaciones */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.publication-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-left-color 0.15s ease;
  border-left: 4px solid #e67e22;
  cursor: pointer;
}

.publication-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-left-color: #d35400;
}

.publication-item .publication-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.publication-item .publication-link {
  color: #2c3e50;
  text-decoration: none;
  transition: color 0.2s ease;
  border: none;
  outline: none;
  display: inline;
  background: none;
  padding: 0;
}

.publication-item .publication-link:hover {
  color: #e67e22;
  text-decoration: none;
}

.publication-item .publication-link:focus {
  outline: none;
  color: #e67e22;
}

.publication-item a,
.publication-item a:link,
.publication-item a:visited,
.publication-item a:active {
  text-decoration: none;
  border: none;
  outline: none;
}

.publication-item .publication-authors {
  color: #e67e22;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.publication-item .publication-journal {
  color: #495057;
  font-style: italic;
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* Ocultar botón en escritorio */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}