/* Catalogo de Peces titulo*/

.catalogo-peces {
  text-align: center;
  margin: 80px 0 40px 0;
  background: url("../Photos/infoteca/fondo_infoteca.jpg");
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
  padding: 80px 40px;
}

.catalogo-peces h2 {
  color: #fff;
  background-color: #27272793;
  padding: 10px 20px;
  display: inline-block;
  border-radius: 8px;
}

.title-underline {
  display: block;
  width: 180px;
  height: 4px;
  background-color: rgb(255, 174, 0);
  margin: 10px auto 0;
  border-radius: 2px;
}

.subtitulo-catalogo {
  font-size: 18px;
  color: #fff;
  margin: 10px auto 0;
  background-color: #27272793;
  padding: 5px 10px;
  border-radius: 8px;
  display: block;
  width: fit-content;
}

/* Sección de especies */
.especies-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.especies-section h2 {
  text-align: center;
  font-size: 32px;
  color: #333;
  margin-bottom: 30px;
}

.especies-section h3 {
  font-size: 24px;
  color: #333;
  margin: 40px 0 20px 0;
  text-align: center;
}

/* Contenedor de filtros */
.filtros-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 10px;
  align-items: flex-end;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 200px;
}

.filtro-grupo label {
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.filtro-grupo select,
.filtro-grupo input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus {
  outline: none;
  border-color: #4caf50;
}

.btn-limpiar {
  padding: 10px 20px;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s;
  height: fit-content;
}

.btn-limpiar:hover {
  background: #1976d2;
}

/* Tabla de especies */
.tabla-container {
  overflow-x: auto;
  margin-bottom: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#tabla-especies {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

#tabla-especies thead {
  background: var(--secondary-color);
  color: white;
}

#tabla-especies th {
  padding: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

#tabla-especies tbody tr {
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  cursor: pointer;
}

#tabla-especies tbody tr:hover {
  background: #f5f5f5;
}

#tabla-especies td {
  padding: 12px 15px;
  font-size: 14px;
  color: #555;
}

#tabla-especies tbody tr:nth-child(even) {
  background: #fafafa;
}

#tabla-especies tbody tr:nth-child(even):hover {
  background: #f0f0f0;
}

/* Galería de especies */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 20px 0;
}

.gallery-item {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.gallery-item img.img-error {
  object-fit: contain;
  background: #f5f5f5;
  padding: 20px;
}

.gallery-info {
  padding: 15px;
}

.gallery-item .nombre-cientifico {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
}

.gallery-item .num-catalogo {
  font-size: 13px;
  color: #27ae60;
  margin: 5px 0;
  font-weight: 500;
}

.gallery-item .num-catalogo i {
  margin-right: 5px;
  color: #27ae60;
}

.gallery-item .coleccion {
  font-size: 13px;
  color: #7f8c8d;
  margin: 5px 0;
}

.gallery-item .coleccion i {
  margin-right: 5px;
}

.gallery-item .ubicacion {
  font-size: 13px;
  color: #3498db;
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.gallery-item .ubicacion i {
  color: #e74c3c;
}

.btn-mapa {
  color: #3498db;
  text-decoration: none;
  font-size: 12px;
  margin-left: 5px;
  transition: color 0.3s;
}

.btn-mapa:hover {
  color: #2980b9;
  text-decoration: underline;
}

.btn-mapa i {
  font-size: 10px;
}

.btn-mapa-modal {
  display: inline-block;
  padding: 5px 12px;
  background: #3498db;
  color: white !important;
  text-decoration: none;
  border-radius: 4px;
  margin-left: 10px;
  font-size: 13px;
  transition: background 0.3s;
}

.btn-mapa-modal:hover {
  background: #2980b9;
  text-decoration: none;
}

.btn-mapa-modal i {
  margin-left: 5px;
  font-size: 11px;
}

.gallery-item .id-specimen {
  font-size: 11px;
  color: #95a5a6;
  margin: 8px 0 0 0;
  font-family: monospace;
  background: #ecf0f1;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-block;
}

/* Mensajes de estado */
.loading,
.no-resultados,
.error {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #666;
  grid-column: 1 / -1;
}

.error {
  color: #e74c3c;
}

/* Mensaje informativo de filtros */
.info-filtros {
  grid-column: 1 / -1;
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  text-align: center;
}

.info-filtros p {
  margin: 0;
  color: #1565c0;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.info-filtros i {
  font-size: 20px;
}

/* Contador de resultados */
.resultados-info {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
}

.resultados-info p {
  margin: 0;
  color: #555;
  font-size: 16px;
}

/* Modal para imagen completa */
.modal-imagen {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 30px;
  right: 45px;
  color: #f1f1f1;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover,
.close-modal:focus {
  color: #bbb;
}

.modal-info {
  text-align: center;
  color: white;
  padding: 20px;
  margin-top: 20px;
}

.modal-info h3 {
  font-size: 24px;
  margin-bottom: 10px;
}

.modal-info p {
  font-size: 16px;
  margin: 5px 0;
  color: #ddd;
}

/* Animación pulse para resaltar */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .filtros-container {
    flex-direction: column;
  }

  .filtro-grupo {
    min-width: 100%;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .tabla-container {
    font-size: 12px;
  }

  #tabla-especies th,
  #tabla-especies td {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Estilos antiguos para compatibilidad */
foto-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  padding: 20px;
}
.foto-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.foto-item img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.foto-item:hover img {
  transform: scale(1.05);
}

.foto-caption {
  position: absolute;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  width: 100%;
  text-align: center;
  padding: 10px;
  font-size: 14px;
}
.foto-caption:hover {
  background: rgba(0, 0, 0, 0.8);
}
.foto-item a {
  text-decoration: none;
  color: inherit;
}
.foto-item a:hover .foto-caption {
  background: rgba(0, 0, 0, 0.9);
}
.foto-item a:hover img {
  transform: scale(1.1);
}
.foto-gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}
.foto-gallery-header {
  text-align: center;
  margin: 40px 0 20px 0;
}
.foto-gallery-header h1 {
  font-size: 36px;
  color: #333;
}
.foto-gallery-header p {
  font-size: 18px;
  color: #666;
}
@media (max-width: 600px) {
  .foto-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
@media (max-width: 400px) {
  .foto-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
