/* Cards catálogo cursos */
.course-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.04);
  transition: transform .25s ease, box-shadow .25s ease;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.course-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #a030e6, #4c146e);
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.12);
  font-size: 20px;
}

.course-card .card-icon i {
  font-size: 24px;
  color: #fff;
}

.course-card h5 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 500;
  color: #0f1724;
}

.course-card .btn {
  width: 95%;
  margin-top: auto;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  background-color: #E91E63;
  color: #fff;
  border: solid 2px #E91E63;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.course-card .btn:hover {
  background-color: #ffffff;
  color: #E91E63;
  border: solid 2px #E91E63;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}


/* Subcurso item inside modal */
.subcourse-item {
  cursor: pointer;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition: background .15s, transform .15s;
}

.subcourse-item:hover {
  background: rgba(13, 110, 253, 0.04);
  transform: translateY(-4px);
}

/* Modal content tweaks */

/* Carousel images */
#subcourseCarousel .carousel-inner img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 576px) {
  #subcourseCarousel .carousel-inner img {
    height: 220px;
  }
}

/* Popup overlay básico (no Bootstrap) */
.popup-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 20, 0.45);
  z-index: 1500;
  padding: 20px;
  transition: opacity .18s ease, visibility .18s ease;
  backdrop-filter: blur(4px);
}

.popup-overlay[aria-hidden="false"] {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* Card con diseño moderno */
.popup-card {
  width: 100%;
  max-width: 1000px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transform: translateY(10px);
  animation: popup-in .25s ease both;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.popup-card--wide {
  max-width: 1200px;
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header mejorado */
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: #fafbfc;
}

.popup-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #1e293b;
  font-weight: 600;
  font-family: 'Poppins', 'Inter', 'Nunito', 'Montserrat', sans-serif;
  margin-right: 2%;
}

.popup-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #334155;

}

.btn-back {
  background: transparent;
  border: none;
  color: #0d6efd;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
}

/* Body */
.popup-body {
  padding: 20px;
  max-height: 80vh;
  overflow: auto;
}

/* Subs grid - Diseño moderno de 2 columnas */
.subs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 8px;
}

.sub-item {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.6);
  min-height: 380px;
}

.sub-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Contenedor de imagen con badge */
.sub-item-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.sub-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sub-item:hover img {
  transform: scale(1.05);
}

/* Badge de tipo de curso */
.course-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #E91E63, #ad1457);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Inter', 'Poppins', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

/* Contenido de la tarjeta */
.sub-item-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.sub-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
  font-family: 'Poppins', 'Inter', sans-serif;
  margin: 0;
}

.sub-item-description {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: 'Inter', 'Nunito', sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Información adicional con iconos */
.sub-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 500;
}

.meta-item i {
  color: #E91E63;
  font-size: 0.9rem;
}



/* Subcourse popup layout - Diseño moderno de dos columnas */
.popup-body--columns {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding: 24px;
  min-height: 500px;
}

/* Columna izquierda - Carrusel prominente */
.carousel-wrap {
  flex: 1 1 55%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Carrusel principal con bordes redondeados */
.carousel-images {
  position: relative;
  height: 380px;
  border-radius: 16px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.carousel-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transition: opacity 0.3s ease;
}

.carousel-images img.active {
  display: block;
}

/* Controles del carrusel - Botones circulares semitransparentes */
.carousel-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  padding: 0 16px;
}

.carousel-btn {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Botón expandir mejorado */
.expand-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

.expand-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

/* Miniaturas (thumbnails) debajo del carrusel */
.carousel-thumbnails {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 8px;
}

.thumbnail {
  width: 80px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.thumbnail:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.thumbnail.active {
  border-color: #E91E63;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal para imagen ampliada */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.image-modal.active {
  display: flex;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.image-modal-nav.prev {
  left: 20px;
}

.image-modal-nav.next {
  right: 20px;
}

/* Columna derecha - Información del curso */
.subcourse-info {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 0;
}

/* Título principal mejorado */
.subcourse-title {
  font-family: 'Poppins', 'Inter', 'Nunito', 'Montserrat', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
  margin: 0 0 16px 0;
}

/* Descripción con mejor tipografía */
.subcourse-desc {
  color: #64748b;
  line-height: 1.6;
  font-size: 1rem;
  font-family: 'Inter', 'Nunito', 'Montserrat', sans-serif;
  margin-bottom: 12px;
}

/* Tarjetas de información con fondo gris claro */
.course-info-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.info-card:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.info-card-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #E91E63, #ad1457);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
}

.info-card-content {
  flex: 1;
}

.info-card-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 2px;
}

.info-card-value {
  font-size: 1rem;
  color: #1e293b;
  font-weight: 600;
}

/* Botón de acción moderno */
.subcourse-actions {
  margin-top: 8px;
  padding-top: 8px;
}

.subcourse-actions .btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 12px;
  background: #E91E63;
  border: 2px solid #E91E63;
  color: white;
  transition: all 0.3s ease;
  font-family: 'Inter', 'Nunito', 'Montserrat', sans-serif;
  text-transform: none;
  letter-spacing: 0.5px;
}

.subcourse-actions .btn:hover {
  background: transparent;
  color: #E91E63;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(233, 30, 99, 0.3);
}

/* Responsive mejorado */
@media (max-width: 1024px) {
  .popup-card--wide {
    max-width: 95vw;
  }
  
  .popup-body--columns {
    gap: 24px;
  }
}

@media (max-width: 900px) {
  .subs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .sub-item {
    min-height: 350px;
  }
  
  .sub-item-image {
    height: 180px;
  }

  .popup-card {
    max-width: 90vw;
  }
  
  .popup-card--wide {
    max-width: 95vw;
  }

  .popup-body--columns {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }
  
  .carousel-wrap {
    flex: none;
  }
  
  .subcourse-info {
    flex: none;
  }

  .carousel-images {
    height: 280px;
  }
  
  .subcourse-title {
    font-size: 1.5rem;
  }
  
  .course-info-cards {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .info-card {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
  }
  
  .info-card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .info-card-label {
    font-size: 0.8rem;
  }
  
  .info-card-value {
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  .carousel-thumbnails {
    gap: 8px;
  }
  
  .thumbnail {
    width: 60px;
    height: 45px;
  }
  
  .course-info-cards {
    flex-direction: column;
  }
  
  .info-card {
    flex: none;
  }
}

@media (max-width: 640px) {
  .subs-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .sub-item {
    min-height: 320px;
  }
  
  .sub-item-image {
    height: 160px;
  }
  
  .sub-item-content {
    padding: 16px;
  }
  
  .sub-item-title {
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .subs-grid {
    grid-template-columns: 1fr;
  }

  .carousel-images {
    height: 220px;
  }

  .popup-card {
    max-width: 96vw;
    border-radius: 16px;
  }
  
  .popup-card--wide {
    max-width: 96vw;
  }
  
  .popup-body--columns {
    padding: 16px;
  }
  
  .popup-header {
    padding: 16px 20px;
  }
  
  .popup-header h3 {
    font-size: 1rem;
  }
  
  .subcourse-title {
    font-size: 1.3rem;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .expand-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .carousel-thumbnails {
    gap: 6px;
    padding: 0 4px;
  }
  
  .thumbnail {
    width: 50px;
    height: 38px;
  }
}

/* prevent body scroll when popup open */
body.popup-open {
  overflow: hidden;
}

/* Mejoras adicionales para la experiencia de usuario */
.carousel-images {
  transition: all 0.3s ease;
}



/* Animaciones suaves para las miniaturas */
@keyframes thumbnail-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 0.7;
    transform: translateY(0);
  }
}

.thumbnail {
  animation: thumbnail-appear 0.3s ease forwards;
}

.thumbnail:nth-child(1) { animation-delay: 0.1s; }
.thumbnail:nth-child(2) { animation-delay: 0.15s; }
.thumbnail:nth-child(3) { animation-delay: 0.2s; }
.thumbnail:nth-child(4) { animation-delay: 0.25s; }
.thumbnail:nth-child(5) { animation-delay: 0.3s; }

/* Mejora del contraste para accesibilidad */
.info-card-label {
  color: #475569;
}

.info-card-value {
  color: #0f172a;
}

/* Hover states mejorados */
.subcourse-actions .btn:focus {
  outline: 2px solid #E91E63;
  outline-offset: 2px;
}

.carousel-btn:focus,
.expand-btn:focus {
  outline: 2px solid #E91E63;
  outline-offset: 2px;
}