:root {
    --primary-color: #3D8361;
    --secondary-color: #EEF2E6;
    --accent-color: #D6CDA4;
    --text-color: #1C3D36;
    --light-text: #4F6F52;
    --border-color: #D6CDA4;
    --white: #FFFFFF;
    --light-bg: #F5F5F5;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    /* font-family: 'Lato', sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    line-height: 1.6;
     */
     height: auto !important;
    overflow: visible !important;
    overflow-x: hidden; /* Solo ocultar scroll horizontal si es necesario */
    overflow-y: auto; /* Permitir scroll vertical */ 
}

header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    box-shadow: var(--shadow);
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.search-container {
    background-color: var(--white);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.search-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.search-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 700;
    color: var(--light-text);
    background: transparent;
    border: none;
    outline: none;
    transition: all 0.3s;
}

.search-tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.search-content {
    display: none;
}

.search-content.active {
    display: block;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: var(--light-text);
}

input[type="text"], select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2a6e4d;
}

.results-container {
    background-color: var(--white);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 200px;
}

.species-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.species-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 700;
    color: var(--light-text);
    background: transparent;
    border: none;
    outline: none;
    transition: all 0.3s;
}

.species-tab.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.species-content {
    display: none;
}

.species-content.active {
    display: block;
}
.contador-visitas {
    position: absolute;
    font-size: 16px;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Estilos para tabla de resultados */
.scientific-name {
    font-style: italic;
}

.author-name {
    font-style: normal;
}

.table-responsive {
    margin-top: 20px;
}

.filter-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}
/* Estados para especies */
.estado-aceptado {
    color: green;
    font-weight: 500;
}

.estado-otro {
    color: #777;
}

.fila-aceptado {
    background-color: #f0fff0 !important;
}

.fila-otro {
    background-color: #f9f9f9 !important;
}

/* Responsividad */
@media (max-width: 768px) {
    .search-tabs, .species-tabs {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
    }
    
    .search-tab, .species-tab {
        padding: 0.75rem 1rem;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .search-tab, .species-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .species-name {
        font-size: 1.5rem;
    }
}

footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

/* Estilos para mensajes de error o información */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Estilos para la paginación */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a {
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a:hover, .pagination a.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Estilos para el mensaje de carga */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 5px solid #ddd;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Estilos para la barra superior */
.registros-info {
    background-color: #f8f9fa;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Estilos para el botón de sinónimos */
#toggleSynonyms {
    transition: all 0.3s ease;
    min-width: 160px;
}

#toggleSynonyms .fas {
    margin-right: 5px;
}

/* Contador de registros */
.contador-registros {
    font-weight: 600;
    color: #28a745;
}

/* Estilo busqueda bibliografía */
.table-responsive {
    margin-top: 20px;
}

.table thead th {
    background-color: #343a40;
    color: white;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.alert {
    margin-top: 20px;
}

.loading {
    padding: 20px;
    text-align: center;
    font-style: italic;
    color: #6c757d;
}

/* Estilos para el formulario */
.search-content {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-6 {
    padding: 0 15px;
    flex: 0 0 50%;
    max-width: 50%;
}

.floating-label-group {
    position: relative;
    margin-bottom: 20px;
}

.floating-input {
    width: 100%;
    height: 50px;
    padding: 15px 20px 0 20px;
    font-size: 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.floating-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.floating-label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
}

.floating-input:focus + .floating-label,
.floating-input:not(:placeholder-shown) + .floating-label {
    top: 10px;
    transform: translateY(0);
    font-size: 12px;
    color: #007bff;
}

/* Estilos para el botón */
.btn-lg {
    padding: 10px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Contenedor del enlace */
.logo-container2 {
    display: inline-block;     /* Permite dimensionar el contenedor */
    max-width: 100%;           /* Máximo ancho disponible */
    overflow: hidden;          /* Oculta cualquier contenido que sobresalga */
}

/* Estilos para la imagen */
.responsive-logo2 {
    width: 100%;               /* Ocupa todo el ancho del contenedor */
    height: auto;              /* Altura automática para mantener proporción */
    display: block;            /* Elimina espacios no deseados */
    object-fit: contain;       /* Garantiza que toda la imagen sea visible */
}

/* html {
    scroll-behavior: smooth;
} */

.searchResults {
    scroll-margin-top: 100px; /* Espacio para no quedar detrás del encabezado */
}
/* =============================================== */
/* ESTILOS PARA LA PESTAÑA DE DISTRIBUCIÓN ADAPTABLE */
/* =============================================== */

#seccion-distribucion.species-content {
    /* display: flex; */
    flex-direction: column;
    height: 100%;
    min-height: 600px; /* Altura mínima garantizada */
}

#mapa_container {
    display: flex;
    flex-direction: column;
    flex: 1; /* Ocupa todo el espacio disponible */
    overflow: hidden; /* Evita desbordamientos */
    position: relative;
}

.species-Distrib {
    overflow-y: auto; /* Permite scroll si hay mucho contenido */
    max-height: 50vh; /* Máximo 50% de la ventana visible */
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.species-distribucion {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e0e0e0;
}

.species-distribucion:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#mapa_distribucion_container {
    flex: 1; /* Ocupa el espacio restante */
    min-height: 300px; /* Altura mínima para el mapa */
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
}

#mapa_distribucion {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#mapa_loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Diseño para pantallas grandes */
@media (min-width: 992px) {
    #mapa_container {
        flex-direction: row;
    }
    
    .species-Distrib {
        max-height: none;
        max-width: 40%;
        margin-right: 20px;
        margin-bottom: 0;
    }
    
    #mapa_distribucion_container {
        flex: 1;
        min-height: 400px;
    }
}

/* Ajustes para cuando hay mucho contenido */
@media (min-height: 800px) {
    #seccion-distribucion.species-content {
        min-height: 700px;
    }
}

@media (min-height: 1000px) {
    #seccion-distribucion.species-content {
        min-height: 800px;
    }
}