
/* Contenedor general de resultados */
.resultados-carreras {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.5s ease-out;
  max-width: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Artículo individual de carrera */
.resultados-carreras article.carrera {
  border: 1px solid #e1e5e9;
  padding: 1.5rem;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  height: fit-content;
  min-height: 300px;
}

.resultados-carreras article.carrera::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #193A63, #005fa3);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.resultados-carreras article.carrera:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #193A63;
}

.resultados-carreras article.carrera:hover::before {
  transform: scaleX(1);
}

/* Título de la carrera */
.resultados-carreras .titulo-carrera {
  font-size: 1.25rem;
  margin: 0;
  line-height: 1.3;
  order: -1;
  flex-shrink: 0;
}

.resultados-carreras .titulo-carrera a {
  text-decoration: none;
  color: #1f2937;
  transition: color 0.2s ease;
  display: block;
}

.resultados-carreras .titulo-carrera a:hover {
  color: #193A63;
}

/* Tipo de programa destacado */
.tipo-programa {
  order: -2;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.tipo-programa .etiqueta {
  background: linear-gradient(135deg, #b91010, #960505);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Grupos de etiquetas */
.grupo-etiquetas {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #e1e5e9;
  flex-shrink: 0;
}

.grupo-etiquetas:hover {
  background: #f1f5f9;
  border-left-color: #193A63;
}

.titulo-taxonomia {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.contenedor-etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.etiqueta {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.etiqueta:hover {
  background: #cbd5e1;
  color: #334155;
  transform: translateY(-1px);
}

/* Duración especial */
.grupo-etiquetas.duracion {
  background: #eff6ff;
  border-left-color: #3b82f6;
}

.grupo-etiquetas.duracion .etiqueta {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

/* Botón Ver más */
.boton-ver-mas {
  background: linear-gradient(135deg, #193A63, #005fa3);
  color: white;
  padding: 0.875rem 1rem;
  text-align: center;
  width: 100%;
  display: inline-block;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.boton-ver-mas::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.boton-ver-mas:hover {
  background: linear-gradient(135deg, #005fa3, #193A63);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(25, 58, 99, 0.3);
}

.boton-ver-mas:hover::before {
  left: 100%;
}

.boton-ver-mas:active {
  transform: translateY(0);
}

/* Resumen de la carrera */
.resultados-carreras article.carrera p {
  color: #6b7280;
  line-height: 1.6;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* Mensaje de no resultados */
.resultados-carreras .no-resultados {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  font-size: 1.1rem;
}

.resultados-carreras .no-resultados .icono {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Estados de carga */
.resultados-carreras.cargando {
  opacity: 0.6;
  pointer-events: none;
}

.resultados-carreras.cargando::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #193A63;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (min-width: 768px) {
  .resultados-carreras {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .resultados-carreras article.carrera {
    min-height: 300px;
  }
}

@media screen and (min-width: 1024px) {
  .resultados-carreras {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
  
  .resultados-carreras article.carrera {
    min-height: 310px;
  }
}

/* Pantallas muy grandes - opcionalmente 3 columnas */
@media screen and (min-width: 1600px) {
  .resultados-carreras {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  .resultados-carreras article.carrera {
    min-height: 320px;
  }
}

@media screen and (min-width: 1400px) {
  .resultados-carreras {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

/* Layout de la página */
.layout-oferta {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Contenedor de resultados con ancho máximo */
.resultados-wrapper {
  flex: 3 1 0;
  min-width: 0;
  max-width: 100%;
}

.filtros-wrapper {
  flex: 1 1 320px;
  position: sticky;
  top: 2rem;
}

.resultados-wrapper {
  flex: 3 1 0;
  min-width: 0;
}

/* Responsive: en móviles los filtros van abajo */
@media (max-width: 768px) {
  .layout-oferta {
    flex-direction: column;
    padding: 0 0.5rem;
  }

  .filtros-wrapper {
    order: 2;
    position: static;
    width: 100%;
  }

  .resultados-wrapper {
    order: 1;
    width: 100%;
  }

  .resultados-carreras {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .resultados-carreras article.carrera {
    padding: 1rem;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
  .resultados-carreras {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .resultados-carreras article.carrera {
    padding: 0.875rem;
  }
}

/* Si hay una sola carrera */
.resultados-carreras.solo-una {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.resultados-carreras.solo-una article.carrera {
  max-width: none;
  width: 100%;
}

@media (max-width: 768px) {
  .resultados-carreras.solo-una {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .resultados-carreras.solo-una article.carrera {
    max-width: 100%;
  }
}

/* Mejoras de accesibilidad */
.resultados-carreras article.carrera:focus-within {
  outline: 2px solid #193A63;
  outline-offset: 2px;
}

.boton-ver-mas:focus {
  outline: 2px solid #193A63;
  outline-offset: 2px;
}

/* Animaciones de entrada para cada tarjeta */
.resultados-carreras article.carrera {
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.resultados-carreras article.carrera:nth-child(1) { animation-delay: 0.1s; }
.resultados-carreras article.carrera:nth-child(2) { animation-delay: 0.2s; }
.resultados-carreras article.carrera:nth-child(3) { animation-delay: 0.3s; }
.resultados-carreras article.carrera:nth-child(4) { animation-delay: 0.4s; }
.resultados-carreras article.carrera:nth-child(5) { animation-delay: 0.5s; }
.resultados-carreras article.carrera:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estados de hover mejorados para etiquetas */
.grupo-etiquetas:hover .etiqueta {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Efecto de pulso para el botón */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.boton-ver-mas:hover {
  animation: pulse 0.3s ease-in-out;
}
