/* Estilos para la sección de modelos */
.models-section {
  padding: 80px 0;
  background: linear-gradient(to bottom, #f8f9fa, #ffffff);
  position: relative;
  overflow: hidden;
}

/* Elementos decorativos de fondo */
.models-section::before,
.models-section::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(65, 139, 250, 0.05) 0%, rgba(65, 139, 250, 0) 70%);
  z-index: 0;
}

.models-section::before {
  top: -100px;
  left: -100px;
}

.models-section::after {
  bottom: -100px;
  right: -100px;
}

.section-header {
  position: relative;
  z-index: 1;
}

.models-accordion {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.accordion-item {
  margin-bottom: 25px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  background: #ffffff;
  border: 1px solid rgba(65, 139, 250, 0.1);
}

.accordion-item:hover {
  box-shadow: 0 8px 25px rgba(65, 139, 250, 0.15);
}

.accordion-item.active {
  box-shadow: 0 10px 30px rgba(65, 139, 250, 0.2);
}

.accordion-header {
  background: linear-gradient(135deg, #418bfa, #3a7fe0);
  padding: 18px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.accordion-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.accordion-header:hover::before {
  transform: translateX(100%);
}

.accordion-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  transition: transform 0.3s ease;
}

.accordion-header:hover h3 {
  transform: translateX(5px);
}

.accordion-icon {
  color: #ffffff;
  font-size: 18px;
  transition: all 0.4s ease;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  background: rgba(255, 255, 255, 0.3);
}

.accordion-content {
  background-color: #ffffff;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-content {
  max-height: 2000px;
  padding: 25px;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.accordion-item.active .models-grid {
  opacity: 1;
  transform: translateY(0);
}

.model-card {
  background: linear-gradient(to bottom, #ffffff, #f0f4ff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  border: 1px solid rgba(65, 139, 250, 0.1);
  /* Añadir display flex y flex-direction column para alinear los botones */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.model-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: 0 10px 30px rgba(65, 139, 250, 0.2);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 12px;
}

.model-card:hover {
  transform: translateY(-10px);
}

.model-card:hover::after {
  opacity: 1;
}

.model-thumbnail {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.model-thumbnail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(65, 139, 250, 0.1), rgba(65, 139, 250, 0));
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.model-card:hover .model-thumbnail::before {
  opacity: 1;
}

.model-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.model-card:hover .model-thumbnail img {
  transform: scale(1.08);
}

.model-info {
  padding: 25px;
  position: relative;
  background: linear-gradient(to bottom, rgba(240, 244, 255, 0.8), rgba(255, 255, 255, 1));
  backdrop-filter: blur(5px);
  /* Añadir flex-grow para que ocupe el espacio disponible */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.model-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, rgba(65, 139, 250, 0.2), rgba(65, 139, 250, 0.8), rgba(65, 139, 250, 0.2));
  border-radius: 3px;
}

.model-info h4 {
  font-size: 22px;
  margin-top: 10px;
  margin-bottom: 12px;
  color: #333;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.model-card:hover .model-info h4 {
  color: #418bfa;
}

.model-info p {
  color: #666;
  margin-bottom: 25px;
  font-size: 15px;
  line-height: 1.6;
  /* Añadir flex-grow para que el párrafo ocupe el espacio disponible */
  flex-grow: 1;
}

.btn-preview {
  width: 100%;
  text-align: center;
  display: inline-block;
  background: linear-gradient(135deg, #418bfa, #3a7fe0);
  color: white;
  padding: 12px 20px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 4px 10px rgba(65, 139, 250, 0.3);
  /* Asegurar que el botón esté al final del contenedor */
  margin-top: auto;
}

.btn-preview::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3a7fe0, #418bfa);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-preview:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(65, 139, 250, 0.4);
}

.btn-preview:hover::before {
  opacity: 1;
}

.btn-preview:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(65, 139, 250, 0.4);
}

/* Estilos para el modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  position: relative;
  background-color: #fefefe;
  margin: 2% auto;
  width: 90%;
  height: 90%;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  animation: modalopen 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.modal.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

@keyframes modalopen {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  background-color: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background-color: rgba(65, 139, 250, 0.8);
  transform: rotate(90deg);
}

#example-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Efectos de carga */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.loading .model-thumbnail {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .models-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    height: 80%;
    margin: 10% auto;
  }

  .accordion-header h3 {
    font-size: 18px;
  }

  .model-info h4 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .accordion-header {
    padding: 15px 20px;
  }

  .model-info {
    padding: 20px;
  }

  .btn-preview {
    padding: 10px 15px;
  }
}
