/* ===== CATÁLOGO DE ESPECIES VEGETALES ===== */

.species-catalog {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.catalog-header h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
}

.catalog-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.species-total {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-refresh {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-refresh:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Filtros del catálogo */
.catalog-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.catalog-search {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.catalog-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.catalog-filter {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.catalog-filter:focus {
    outline: none;
    border-color: #007bff;
}

/* Contenedor del catálogo */
.catalog-container {
    min-height: 400px;
    margin-bottom: 1.5rem;
}

.species-catalog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Cards de especies */
.catalog-species-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.catalog-species-card:hover {
    border-color: #007bff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
}

.species-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.species-scientific {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.species-origin-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.species-origin-badge.native {
    background: #d4edda;
    color: #155724;
}

.species-origin-badge.introduced {
    background: #f8d7da;
    color: #721c24;
}

.species-card-content {
    margin-bottom: 1rem;
}

.species-common-name {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.species-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.species-habit,
.species-zone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

.species-habit i,
.species-zone i {
    width: 16px;
    color: #28a745;
}

.species-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #495057;
}

.metric-item i {
    color: #007bff;
    width: 14px;
}

/* Acciones de la card */
.species-card-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-species-info,
.btn-species-add {
    background: none;
    border: 1px solid;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-species-info {
    border-color: #17a2b8;
    color: #17a2b8;
}

.btn-species-info:hover {
    background: #17a2b8;
    color: white;
}

.btn-species-add {
    border-color: #28a745;
    color: #28a745;
}

.btn-species-add:hover {
    background: #28a745;
    color: white;
}

/* Paginación */
.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.btn-page {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-page:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-page:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    font-weight: 500;
    color: #495057;
    padding: 0 1rem;
}

/* Estados especiales */
.catalog-loading,
.catalog-empty,
.catalog-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6c757d;
    text-align: center;
}

.catalog-loading i,
.catalog-empty i,
.catalog-error i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.catalog-error {
    color: #dc3545;
}

.catalog-error i {
    color: #dc3545;
}

/* Modal de información de especies */
.species-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    padding: 1rem;
}

.species-info-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.species-info-modal .modal-content {
    position: relative;
    background: #fff;
    border: 4px solid #000;
    border-radius: 0;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 8px 8px 0 rgba(0,0,0,1);
}

.species-info-modal .modal-header {
    padding: 1.5rem;
    background: #000;
    color: #fff;
    border-bottom: 4px solid #000;
    position: relative;
}

.species-info-modal .modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.species-info-modal .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fff;
    border: 3px solid #fff;
    font-size: 1.5rem;
    cursor: pointer;
    color: #000;
    width: 30px;
    height: 30px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    transition: all 0.2s;
}

.species-info-modal .btn-close:hover {
    background: #000;
    color: #fff;
    border-color: #000;
}

.species-info-modal .modal-body {
    padding: 1.5rem;
}

.species-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.info-section h4 {
    color: #000;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 3px solid #000;
    padding-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.info-section p {
    margin-bottom: 0.5rem;
    color: #000;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .species-catalog {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .catalog-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .catalog-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .catalog-filters {
        flex-direction: column;
    }
    
    .catalog-search {
        min-width: auto;
    }
    
    .species-catalog-list {
        grid-template-columns: 1fr;
    }
    
    .species-metrics {
        grid-template-columns: 1fr;
    }
    
    .catalog-pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .species-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .catalog-header h3 {
        font-size: 1.2rem;
    }
    
    .species-scientific {
        font-size: 1rem;
    }
    
    .catalog-species-card {
        padding: 1rem;
    }
    
    .species-info-modal .modal-content {
        width: 95%;
    }
}