/* ==========================================================================
   1. CARRUSEL PERSONALIZADO (Manual / Central-Lateral)
   ========================================================================== */
.profesores-carrusel-container {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  padding: 1rem 0;
}

#profesoresCustomCarrusel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 280px;
}

.profesor-central,
.profesor-lateral {
  height: 280px !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.18);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.profesor-central { z-index: 2; width: 18rem; }

.profesor-lateral {
  opacity: 0.7;
  transform: scale(0.92);
  z-index: 1;
  width: 12rem;
  margin: 0 -2.5rem !important; /* Superposición de tarjetas */
  cursor: pointer;
}

.profesor-lateral:hover { opacity: 0.9; }

/* Contenido de Tarjetas */
.profesor-img {
  width: 120px !important;
  height: 120px !important;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin: 10px auto;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.profesor-img:hover { transform: scale(1.1); }

/* ==========================================================================
   2. SISTEMA SWIPER (Librería Externa)
   ========================================================================== */
.profesoresSwiper {
  margin-top: 40px;
  padding: 40px 0; /* Un poco más de aire arriba y abajo */
}

.swiper-slide {
  background-color: #ffffff;
  /* Sombra más profunda y difusa para que flote sobre el fondo */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15); 
  border-radius: 20px; /* Bordes un poco más curvos para que sea más moderno */
  height: 280px; /* Un poquito más altas */
  width: 220px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  border: 1px solid rgba(255, 255, 255, 0.1); /* Un borde sutil que ayuda a separar */
}

/* Efecto al pasar el mouse (Hover) */
.swiper-slide:hover {
  transform: translateY(-10px); /* Sube un poquito más */
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

/* Degradado del texto mejorado para legibilidad */
.swiper-txt {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 15px 15px;
  /* Degradado más oscuro abajo para que el texto blanco siempre se lea */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  color: white;
  text-align: left;
}

.swiper-txt h3 {
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.swiper-txt p {
  font-size: 0.85rem;
  opacity: 0.9;
  margin: 0;
}

/* ==========================================================================
   3. MODAL DE DETALLE (Biografía)
   ========================================================================== */
.modal-profesor {
  display: none; 
  position: fixed;
  z-index: 2500;
  left: 0;
  top: 0;
  width: 100vw; /* Aseguramos que use TODO el ancho de la pantalla */
  height: 100vh; /* Aseguramos que use TODO el alto */
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);

  /* CENTRADO ABSOLUTO */
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-profesor-content {
  background-color: white;
  border-radius: 20px; /* Bordes redondeados parejos */
  width: 95%;
  max-width: 500px;
  max-height: 85vh;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  animation: modalPop 0.3s ease-out;
  
  /* SECRETO PARA EL REDONDEO: */
  overflow: hidden; /* Esto obliga a que el contenido de adentro no se "salga" de los bordes curvos */
  display: flex;
  flex-direction: column;
}

.modal-profesor-close {
  position: absolute; /* Cambiado a absolute para que flote sobre el header */
  top: 15px;
  right: 15px;
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.8); /* Fondo claro para que se vea sobre la foto */
  color: #333;
  font-size: 20px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.modal-profesor-close:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #000;
}

/* --- Encabezado --- */
.modal-profesor-header {
  text-align: center;
  padding: 40px 20px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-profesor-header img {
  width: 130px !important;
  height: 130px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid white;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 15px;
}

/* --- Cuerpo del texto --- */
.modal-profesor-body {
  padding: 30px;
  overflow-y: auto; /* El scroll ahora vive solo aquí adentro */
  flex-grow: 1;
}

/* Animación de entrada */
@keyframes slideIn {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Animación de escala para que "salte" a la vista */
@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   4. RESPONSIVE GENERAL
   ========================================================================== */

@media (max-width: 768px) {
  .profesor-central { width: 14rem !important; height: 260px !important; }
  .profesor-lateral { width: 9rem !important; height: 220px !important; margin: 0 -1.2rem !important; }
  .swiper-slide { height: 200px; width: 160px; }
  .modal-profesor-content { width: 98%; margin: 5% auto; }
}

@media (max-width: 480px) {
  .profesor-central { width: 12rem !important; }
  .swiper-slide { height: 180px; width: 140px; }
  .modal-profesor-content { border-radius: 0; height: 100vh; margin: 0; }
}