/* =============================================
   VARIABLES Y RESET
   ============================================= */
:root {
  --primary-color: #2c5f2d;
  --secondary-color: #97bc62;
  --accent-color: #1e3a8a;
  --gold: #d4af37;
  --text-dark: #2d3748;
  --text-light: #718096;
  --bg-light: #f7fafc;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', serif;
  font-weight: 700;
}

/* =============================================
   NAVEGACIÓN
   ============================================= */
.navbar {
  background: rgba(207, 210, 211, 0.95) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  padding: 0.5rem 0 !important;
  min-height: 60px;
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  color: var(--primary-color) !important;
  font-size: 1.2rem;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  line-height: 1.5;
  display: flex;
  align-items: center;
  height: 100%;
}

.navbar-brand i {
  margin-right: 8px;
  font-size: 1.2rem;
  line-height: 1;
}

.navbar-nav {
  align-items: center;
}

.nav-link {
  color: var(--text-dark) !important;
  font-weight: 500;
  margin: 0 10px;
  position: relative;
  /* CORREGIDO: era 3s (muy lento), ahora 0.3s */
  transition: color 0.3s;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  line-height: 1.5;
}

.btn-outline-success {
  padding-top: 0.375rem !important;
  padding-bottom: 0.375rem !important;
  line-height: 1.5;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: width 0.3s;
}

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

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
  min-height: 90vh;
  background: linear-gradient(135deg, rgba(18, 47, 19, 0.85) 30%, rgba(151, 188, 98, 0.75) 80%),
    url('../images/Quebec.jpg') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  color: white;
  overflow: hidden;
  padding: 80px 0;
}

/* Fallback si la imagen falla */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  z-index: -1;
  opacity: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* =============================================
   CONTENEDOR PERSONALIZADO
   ============================================= */
.container-custom {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* =============================================
   IMAGEN DE PERFIL
   ============================================= */
.profile-image-container {
  width: 280px;
  height: 280px;
  margin: 0 auto 0px;
  position: relative;
}

.profile-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: scale-down;
  border: 5px solid rgba(166, 133, 133, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
  background-color: #13141781;
}

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

/* =============================================
   BADGES HERO
   ============================================= */
.badge-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.achievement-badge {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s;
}

.achievement-badge:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-3px);
}

/* =============================================
   TIPOGRAFÍA HERO
   ============================================= */
.hero-title {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  margin-bottom: 10px;
}

.hero-contact {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

/* =============================================
   BOTONES HERO
   ============================================= */
.btn-hero {
  background: white;
  color: var(--primary-color);
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 700;
  margin: 0 10px;
  transition: all 0.3s;
  border: 2px solid white;
  text-decoration: none;
  display: inline-block;
}

.btn-hero:hover {
  background: transparent;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.btn-hero-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-hero-outline:hover {
  background: white;
  color: var(--primary-color);
}

/* =============================================
   REDES SOCIALES HERO
   ============================================= */
.social-links {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.social-links a {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.3rem;
  transition: all 0.3s;
  text-decoration: none;
}

.social-links a:hover {
  background: white;
  color: var(--primary-color);
  transform: translateY(-5px);
}

/* =============================================
   SECCIONES GENERALES
   ============================================= */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 50px;
  font-size: 1.1rem;
}

/* Títulos alineados a la izquierda */
.section-title.left-aligned {
  display: inline-block;
  left: 0;
  transform: none;
  text-align: left;
}

.section-title.left-aligned::after {
  left: 0;
  transform: none;
}

/* =============================================
   FLIP CARDS - EDUCACIÓN
   ============================================= */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
  height: 400px;
  margin-bottom: 30px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  cursor: pointer;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.flip-card-front {
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}

.flip-card:hover .flip-card-front {
  border-color: var(--secondary-color);
}

.flip-card-back {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.card-icon {
  font-size: 3.5rem;
  color: var(--secondary-color);
  margin-bottom: 20px;
}

.flip-card-front h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.flip-card-front .institution {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.flip-card-front .year {
  background: var(--bg-light);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
}

.flip-card-back h4 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.flip-card-back ul {
  text-align: left;
  list-style: none;
  padding: 0;
}

.flip-card-back li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
}

.flip-card-back li:last-child {
  border-bottom: none;
}

.flip-card-back li i {
  margin-right: 10px;
  color: var(--gold);
}

/* =============================================
   PUBLICACIONES
   ============================================= */
.pub-card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: all 0.3s;
  border-left: 4px solid var(--secondary-color);
  position: relative;
  overflow: hidden;
}

.pub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--secondary-color), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}

.pub-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.pub-card:hover::before {
  opacity: 0.05;
}

.pub-card > * {
  position: relative;
  z-index: 1;
}

.pub-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 10px;
  margin-right: 5px;
}

.badge-q2    { background: #dbeafe; color: #1e40af; }
.badge-wos   { background: #fef3c7; color: #92400e; }
.badge-scopus    { background: #d1fae5; color: #065f46; }
.badge-conference { background: #fce7f3; color: #9d174d; }

.pub-title {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.pub-authors {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.pub-venue {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.pub-meta {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.pub-links {
  margin-top: 15px;
}

.pub-links a {
  color: var(--primary-color);
  text-decoration: none;
  margin-right: 15px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.3s;
}

.pub-links a:hover {
  color: var(--secondary-color);
}

/* =============================================
   TIMELINE - DOCENCIA
   ============================================= */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--secondary-color);
}

.timeline-item {
  margin-bottom: 40px;
  position: relative;
}

.timeline-content {
  background: white;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
  width: 45%;
  position: relative;
  transition: all 0.3s;
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-left: auto;
  margin-right: 55%;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-left: 55%;
}

.timeline-content:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--secondary-color);
  border: 4px solid white;
  border-radius: 50%;
  top: 25px;
  box-shadow: 0 0 0 4px var(--secondary-color);
  z-index: 1;
}

.timeline-date {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.timeline-title {
  color: var(--text-dark);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.timeline-desc {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* =============================================
   TARJETAS DE RECONOCIMIENTOS
   ============================================= */
.award-card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.award-card::before {
  content: '🏆';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 5rem;
  opacity: 0.1;
}

.award-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.award-year {
  display: inline-block;
  background: var(--gold);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.award-title {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-weight: 700;
}

.award-issuer {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* =============================================
   HABILIDADES
   ============================================= */
.skill-category {
  background: white;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: all 0.3s;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.skill-category h4 {
  color: var(--primary-color);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag {
  background: var(--bg-light);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.9rem;
  color: var(--text-dark);
  border: 2px solid transparent;
  transition: all 0.3s;
}

.skill-tag:hover {
  border-color: var(--secondary-color);
  background: white;
  transform: translateY(-2px);
}

/* =============================================
   FILTROS DE PUBLICACIONES
   ============================================= */
.filter-buttons {
  text-align: center;
  margin-bottom: 40px;
}

.filter-btn {
  background: white;
  border: 2px solid var(--secondary-color);
  color: var(--primary-color);
  padding: 10px 25px;
  border-radius: 50px;
  margin: 0 5px 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--secondary-color);
  color: white;
}

/* =============================================
   SECCIÓN CONTACTO
   ============================================= */
.contact-section {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 80px 0;
}

.contact-card {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  border: 1px solid rgba(255,255,255,0.2);
}

.contact-info-item {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  font-size: 1.1rem;
}

.contact-info-item i {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--text-dark);
  color: white;
  padding: 40px 0;
  text-align: center;
}

.footer-social {
  margin-bottom: 20px;
}

.footer-social a {
  color: white;
  font-size: 1.5rem;
  margin: 0 15px;
  transition: color 0.3s;
}

.footer-social a:hover {
  color: var(--secondary-color);
}

/* =============================================
   ANIMACIONES
   ============================================= */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

/* =============================================
   BOTÓN SCROLL TOP
   ============================================= */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--secondary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.scroll-top.visible {
  opacity: 1;
}

.scroll-top:hover {
  background: var(--primary-color);
  transform: translateY(-5px);
}

/* =============================================
   ENLACE PERSONALIZADO (ELAP, etc.)
   ============================================= */
a.elap-link {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  transition: all 0.3s;
}

a.elap-link:hover {
  color: var(--secondary-color);
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tabletas y superiores */
@media (max-width: 991px) {
  .navbar {
    padding: 0.5rem 1rem !important;
  }

  .navbar-collapse {
    padding-top: 10px;
  }

  .nav-link {
    padding: 0.5rem 0 !important;
  }

  #about .col-lg-7,
  #about .col-lg-5 {
    margin-bottom: 20px;
  }

  #about img {
    max-height: 150px !important;
  }
}

/* Móviles */
@media (max-width: 768px) {
  .container-custom {
    padding-left: 0rem;
    padding-right: 0rem;
  }

  @media (min-width: 768px) {
    #estancias .col-md-6 {
      flex: 0 0 50%;
      max-width: 50%;
    }
    
    /* Altura fija para consistencia */
    #estancias .card {
      min-height: 400px;
    }
  }


  /* En móvil, apilar verticalmente */
  @media (max-width: 767px) {
    #estancias .col-md-6:first-child {
      min-height: 250px !important;
    }
    
    #estancias img {
      min-height: 250px;
    }
  }

  /* Badge de fecha */
  .badge-danger {
    background-color: #dc3545;
    color: white;
    padding: 0.5em 0.75em;
    font-size: 0.85rem;
  }

  /* Links con icono */
  #estancias a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
  }

  #estancias a:hover {
    color: var(--secondary-color);
  }
  

  .hero-section {
    background-attachment: scroll;
    min-height: auto;
    padding: 100px 20px 60px;
  }

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

  /* Timeline en una sola columna */
  .timeline::before {
    left: 30px;
  }

  .timeline-content {
    width: calc(100% - 80px);
    margin-left: 80px !important;
    margin-right: 0 !important;
  }

  .timeline-dot {
    left: 30px;
  }

  .flip-card {
    height: 350px;
  }

  .pub-meta {
    flex-direction: column;
    gap: 5px;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .btn-hero {
    margin: 5px 5px;
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .profile-image-container {
    width: 200px;
    height: 200px;
  }

  .section {
    padding: 50px 0;
  }

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

  .contact-card {
    padding: 20px;
  }
}


  #education .card {
    background: linear-gradient(145deg, #ffffff 0%, #f5f9f5 100%);
    border: none; 
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(44, 95, 45, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  #research .card {
    background: linear-gradient(145deg, #ffffff 0%, #f5f9f5 100%);
    border: none; 
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(44, 95, 45, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  #education .card:hover {
    background: linear-gradient(145deg, #f0f7f0 0%, #e8f3e8 100%);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(44, 95, 45, 0.15);
  }
 
  #estancias .container {
    max-width: 1140px; /* Mismo ancho que las 3 tarjetas de arriba */
  }